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 196713 - Java EE is missing on project classpath
Summary: Java EE is missing on project classpath
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-15 08:32 UTC by Tomas Mysik
Modified: 2011-06-08 07:26 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (34.86 KB, image/png)
2011-03-15 08:32 UTC, Tomas Mysik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Mysik 2011-03-15 08:32:26 UTC
Created attachment 107009 [details]
screenshot

I have a Maven web project, and I can see this hint in JUnit test file (no Java EE in this test, of course).

Have a look at the screenshot.

Product Version: NetBeans IDE Dev (Build 110315-3eff329f3724)
Java: 1.6.0_24; Java HotSpot(TM) 64-Bit Server VM 19.1-b02
System: Linux version 2.6.37-02063702-generic running on amd64; UTF-8; cs_CZ
Comment 1 Martin Fousek 2011-05-02 06:30:26 UTC
Related to MissingJavaEEForUnitTestExecutionHint.isEEType(), reassigning.
Comment 2 David Konecny 2011-05-09 22:14:24 UTC
Cau Tomas!

so you are saying that you can execute PosTabularGeneratorTest without problem? What the hint does is that it tries to load PosTabularGenerator class - mavenProjectExecutionCP.getClassLoader(true).loadClass(name) - and if it fails (usually because PosTabularGenerator extends or depends on some *abstract* EE 6 class which has missing bytecode in javaee-api artifact) then the hint it shown. I wonder why is it shown in your case?? What EE artifact you are using in your project? Could you narrow this down to a reproducible case please? Thanks.
Comment 3 Tomas Mysik 2011-05-10 08:28:03 UTC
ÄŒau Davide!

(In reply to comment #2)
> so you are saying that you can execute PosTabularGeneratorTest without problem?

Yes.

> What the hint does is that it tries to load PosTabularGenerator class -
> mavenProjectExecutionCP.getClassLoader(true).loadClass(name) - and if it fails
> (usually because PosTabularGenerator extends or depends on some *abstract* EE 6
> class which has missing bytecode in javaee-api artifact) then the hint it
> shown. I wonder why is it shown in your case??

Me too. One thing to mention - PosTabularGeneratorTest (extends TestCase) does not depend on Java EE; it is just simple test for XLS generator (again, this generator does not depend on Java EE).

> What EE artifact you are using
> in your project? Could you narrow this down to a reproducible case please?
> Thanks.

We use Spring, Servlet 2.4, Hibernate, REST WS (Jersey, Jackson). Project Properties dialog (category Run) says "J2EE 1.4".

However, I cannot reproduce this issue anymore so feel free to close this issue.

Product Version: NetBeans IDE Dev (Build 20110510-c3136340b53d)
Java: 1.6.0_24; Java HotSpot(TM) 64-Bit Server VM 19.1-b02
System: Linux version 2.6.37-02063706-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 4 David Konecny 2011-05-10 21:25:18 UTC
(In reply to comment #3)
> One thing to mention - PosTabularGeneratorTest (extends TestCase) does
> not depend on Java EE; it is just simple test for XLS generator (again, this
> generator does not depend on Java EE).

My only explanation is that classpath of your project must got temporarily incomplete which resulted in ClassNotFoundException when PosTabularGenerator class was loaded by the hint. I will have a look if I can ignore ClassNotFoundExceptions in the hint if missing class is not Java EE class.
Comment 5 David Konecny 2011-05-11 01:02:28 UTC
I found the problem. Thanks for the report. ClassNotFound exception is thrown any time when ... hmmm... project source is not compiled and therefore it cannot be loaded. :-)

For now I just ignore ClassNotFound exception - main reason for the hint was to check ClassFormatError exception anyway.

3cecfb33a748
Comment 6 Tomas Mysik 2011-05-11 07:46:23 UTC
Thanks a lot!
Comment 7 Marian Petras 2011-06-01 17:39:07 UTC
I can see this hint on lines of code containing something related to Swing GroupLayout. For example on these lines:

   - import static javax.swing.LayoutStyle.ComponentPlacement.RELATED;
   - {all uses of the imported constant RELATED}
   - layout.setHorizontalGroup(...);
   - private GroupLayout.SequentialGroup createGroup(...) { ... }
Comment 8 David Konecny 2011-06-06 21:29:14 UTC
Marian, on what version do you experience the problem? It should be fixed in trunk and 7.0.1.
Comment 9 Marian Petras 2011-06-08 07:26:26 UTC
It was in NetBeans 7.0.

The bug seems to be fixed in NB 7.0.1, indeed.