This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 166575 - Cannot compile, run, test
Summary: Cannot compile, run, test
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P1 blocker (vote)
Assignee: Milan Kubec
URL:
Keywords:
: 164464 (view as bug list)
Depends on: 166910
Blocks:
  Show dependency tree
 
Reported: 2009-06-04 22:42 UTC by psecheresse
Modified: 2009-09-07 16:05 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Example Project that cannot be run (36.85 KB, application/x-compressed)
2009-06-05 11:29 UTC, psecheresse
Details
disabled actions in RC2 (20.09 KB, image/png)
2009-06-08 12:03 UTC, Lukas Jungmann
Details
disabled actions in RC2 - project level (28.56 KB, image/png)
2009-06-08 12:16 UTC, Lukas Jungmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description psecheresse 2009-06-04 22:42:39 UTC
I have installed the 6.7RC, I could use some of my existing projects, the menu options were all deactivated: build,
clean and build, run tests, debug, debug... After opening some older projects, the options were reactivated, it is
working now.
Comment 1 Jan Jancura 2009-06-05 07:47:37 UTC
Looks like P1 for me...
Comment 2 Marian Mirilovic 2009-06-05 08:48:02 UTC
Lukas(jungi), 
I think you told me about this problem some time ago .. are you able to reproduce it ?

Jirka(jiriprox), 
also please try to look at this ... I was not able to reproduce it ;(

psecheresse,
could you please provide more informations (type of the project, steps to reproduce, messages.log file, your project
causing this problem .....)? Thanks in advance.
Comment 3 Lukas Jungmann 2009-06-05 09:01:16 UTC
not yet, checking RC2...

From what I did to get to this state (in 6.7RC1):
-use installer on win (I'm using vista, original reporter uses XP)
-work on some SVN versioned JavaSE project (with CoS disabled) - do clean, build and test, svn up, diff and commit
-create new JavaSE app project (CoS enabled) with main class, put there some exec code into its main class and hit a
shortcut for run file
-get back to original project
-repeat previous steps several times through 1-3days
-at some point this happens

if this happens then the only reliable workaround for this I've found so far is to delete userdir (sometimes cleaning a
$UD/var/cache doesn't help) and start over

Will try to get better steps to reproduce
Comment 4 psecheresse 2009-06-05 09:24:05 UTC
There is nothing special, it is impossible to reproduce, that's the problem.
I opened a project with dependencies to 3 others projects. All the projects are simple JavaSE projects created with
NetBeans 6.5.
One of the project is a NetBeans project created from sources into another directory, with something like 600000 lines
of code and Groovy support. The others are 'pure' netbeans projects, the sources are into the project directory.
All the projects use JUnit and various externals jars and libraries.

After opening two old NetBeans 5.5 projects, one JavaSe, one Web, the options were enabled, I could run them.

No exception seems to occur, I will have a look into the log files.
Comment 5 Jiri Prox 2009-06-05 11:01:45 UTC
it's probably duplicate of issue 164464, or vice versa
Comment 6 psecheresse 2009-06-05 11:29:18 UTC
Created attachment 83235 [details]
Example Project that cannot be run
Comment 7 psecheresse 2009-06-05 11:38:15 UTC
Eventually, the issue is consistent. I tried again to close the projects, close NB reopen, open the main project with
the dependant projects (3) and got the issue on all the projects except the main project. I closed everything opened one
of the dependant project and still have the issue. I attached the project.
However, after closing NB, reopening the project the issue disappeared.

If I close all the project, open the main project again asking for dependent project, the issue reappear: the issue
seems to occur only when opening projects with dependant projects
Comment 8 psecheresse 2009-06-05 12:26:00 UTC
Can reproduce it:
- create a new java project
- create a second java project, add the first project as dependant project
- close the projects
- close NetBeans
- open NetBeans
- open the second project with depedencies
==> the first project has the options disabled
Comment 9 Jaroslav Tulach 2009-06-06 07:48:13 UTC
Steps to reproduce involve restart. This means it is unlikely the problem is caused by any ergonomic features.
Comment 10 Lukas Jungmann 2009-06-08 12:03:50 UTC
Created attachment 83310 [details]
disabled actions in RC2
Comment 11 Lukas Jungmann 2009-06-08 12:05:54 UTC
reproducible in RC2 too
Comment 12 David Strupl 2009-06-08 12:09:23 UTC
I am not able to reproduce using the steps. But I am on linux - can anyone with windows try the steps to reproduce?

Making the issue P2 since this is not IMHO a stopper for FCS (but I can be wrong).
Comment 13 David Strupl 2009-06-08 12:13:04 UTC
I was checking the actions on the project node - are we talking about the actions on the files or on the project level?
Comment 14 Lukas Jungmann 2009-06-08 12:16:58 UTC
Created attachment 83312 [details]
disabled actions in RC2 - project level
Comment 15 Lukas Jungmann 2009-06-08 12:30:14 UTC
both, it's the same for file as well as for project level actions.

This worked fine in 6.5 (AFAIK) and can cause troubles for people with existing project migrating to 6.7 and as
therefore it should be, IMHO, treated as a stopper.
Comment 16 Lukas Jungmann 2009-06-08 13:35:37 UTC
just for the record - I'm able to reproduce this even on linux/ubuntu, my current steps were:

-for the project I have do svn up on the cmd line
-install fresh RC2 (java distro)
-enable everything except for JavaME
-restart IDE
-add SVN_ROOT to favorites
-open 2 projects (from ~30)
-wait for scanning etc
-restart IDE
-wait for scanning etc
-open the rest of projects from favorites
-wait for scanning etc
-invoke popup on some java se project node to ie build it

=> all build, clean etc actions are disabled...
Comment 17 Marian Mirilovic 2009-06-09 09:54:36 UTC
RANDOM but nasty ... would like to see that fixed in NB 6.7
Comment 18 Lukas Jungmann 2009-06-09 10:19:14 UTC
caused by enabled Groovy - to be able to face this issue one has to have enabled groovy in his IDE, adding Petr H. to cc...
Comment 19 Milan Kubec 2009-06-09 13:07:38 UTC
The problem seems to be in groovy LookupMergerSupport that is supposed to merge all project actions but from some reason
it doesn't work and only actions supported by groovy are actually enabled for some projects.
Comment 20 Milan Kubec 2009-06-09 14:07:03 UTC
To be more specific - LookupMerger<ActionProvider> provided by groovy module works OK, but for some j2seprojects it
doesn't return one when project.lookup(ActionProvider.class) is called, but it returns GroovyActionProvider itself.
LookupMerger is registered via annotation @LookupMerger.Registration(projectType="org-netbeans-modules-java-j2seproject").
Comment 21 Milan Kubec 2009-06-10 13:14:19 UTC
Unfortunately the problem is in annotation declaration of LookupMerger and it's kind of beyond my knowledge. The fix is
only changing declarative way of registration to explicit registration by LookupProvider. (Provided patch is against
core-main; I'll provide one against release67).

diff -uprN core-main_work.71c179e30950/groovy.support/src/org/netbeans/modules/groovy/support/GroovyLookupProvider.java
core-main_work/groovy.support/src/org/netbeans/modules/groovy/support/GroovyLookupProvider.java
--- core-main_work.71c179e30950/groovy.support/src/org/netbeans/modules/groovy/support/GroovyLookupProvider.java
2009-06-10 13:55:46.000000000 +0200
+++ core-main_work/groovy.support/src/org/netbeans/modules/groovy/support/GroovyLookupProvider.java	2009-06-10
13:55:46.000000000 +0200
@@ -58,7 +58,9 @@ public class GroovyLookupProvider implem
             return Lookup.EMPTY;
         }
 
-        return Lookups.fixed(new J2seProjectOpenedHook(project));
+        return Lookups.fixed(new J2seProjectOpenedHook(project), 
+                             LookupMergerSupport.createActionProviderLookupMerger());
+
     }
 
     private static class J2seProjectOpenedHook extends ProjectOpenedHook {
diff -uprN core-main_work.71c179e30950/groovy.support/src/org/netbeans/modules/groovy/support/LookupMergerSupport.java
core-main_work/groovy.support/src/org/netbeans/modules/groovy/support/LookupMergerSupport.java
--- core-main_work.71c179e30950/groovy.support/src/org/netbeans/modules/groovy/support/LookupMergerSupport.java
2009-06-10 13:55:46.000000000 +0200
+++ core-main_work/groovy.support/src/org/netbeans/modules/groovy/support/LookupMergerSupport.java	2009-06-10
13:55:46.000000000 +0200
@@ -62,7 +62,7 @@ public final class LookupMergerSupport {
      * is found.
      * @return
      */
-    @LookupMerger.Registration(projectType="org-netbeans-modules-java-j2seproject")
+    // @LookupMerger.Registration(projectType="org-netbeans-modules-java-j2seproject")
     public static LookupMerger<ActionProvider> createActionProviderLookupMerger() {
         return new ActionProviderMerger();
     }

Please, review the patch. Thanks.
Comment 22 Milos Kleint 2009-06-10 13:26:51 UTC
have you reviewed other instances which use the @LookupMerger annotations? it might be worth reverting all such
usecases. The ActionProvider one is rather visible, but we can assume it's a general problem so we might have more
subtle problems elsewhere.
Comment 23 Milan Kubec 2009-06-10 14:02:54 UTC
It seems that @LookupMerger.Registration annotation has been used only in groovy.support.
Comment 24 Milan Kubec 2009-06-10 14:34:01 UTC
Fix pushed to core-main: http://hg.netbeans.org/core-main/rev/a0f17ba18c17
Comment 25 Milos Kleint 2009-06-10 14:39:48 UTC
if you don't plan (or don't manage) to fix the annotation code, maybe we should delete it altogether.
Comment 26 Milan Kubec 2009-06-10 14:46:49 UTC
We can try to fix it later, but this fix was (very) hot fix for 6.7 release. 
I'd like to know what Jesse can say about the issue.
Comment 27 Lukas Jungmann 2009-06-11 08:36:54 UTC
v. current fix in NetBeans-dev-NB-Core-Build-2736-on-090610-full.zip
Comment 28 Quality Engineering 2009-06-11 08:55:52 UTC
Integrated into 'main-golden', will be available in build *200906110201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a0f17ba18c17
User: Milan Kubec <mkubec@netbeans.org>
Log: #166575: annotation based registration of LookupMerger doesn't work; using LookupProvider instead
Comment 29 Milos Kleint 2009-06-11 09:59:27 UTC
the fix looks ok to me. 
Comment 30 Milan Kubec 2009-06-11 10:21:20 UTC
Fixed in release67:

http://hg.netbeans.org/release67/rev/031c2b3e0ea9

Leaving the issue opened, since the real problem hasn't been fixed. Lowering priority to P3. Have to investigate.
Comment 31 Marian Mirilovic 2009-06-11 11:58:05 UTC
Fixed for NB 6.7 .... 
> Leaving the issue opened, since the real problem hasn't been fixed. Lowering priority to P3. Have to investigate.
reported as issue 166910
Comment 32 Jesse Glick 2009-06-12 18:36:04 UTC
Backing out hotfix in core-main #7b0482d954a1 due to proper fix of issue #166910. Could be merged to 6.7 if the real fix
is as well.
Comment 33 Quality Engineering 2009-06-13 06:54:37 UTC
Integrated into 'main-golden', will be available in build *200906130201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/7b0482d954a1
User: Jesse Glick <jglick@netbeans.org>
Log: Backed out changeset a0f17ba18c17
#166575 hotfix unnecessary given proper fix of #166910.
Comment 34 matusdekanek 2009-06-17 11:09:02 UTC
the scenario for reproducing seems to work, marking verified
Comment 35 psecheresse 2009-06-17 21:22:09 UTC
That works with 6.7RC3. That's great, thanks.
Comment 36 Petr Hejl 2009-09-07 16:05:34 UTC
*** Issue 164464 has been marked as a duplicate of this issue. ***