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 76142 - NPE from EjbJarProvider.getModuleVersion()
Summary: NPE from EjbJarProvider.getModuleVersion()
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB Project (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
: 80003 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-10 09:12 UTC by Jan Horvath
Modified: 2007-01-23 10:44 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NPE (3.87 KB, text/plain)
2006-05-10 09:13 UTC, Jan Horvath
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Horvath 2006-05-10 09:12:36 UTC
build 200605100500

I've got NPE during IDE startup. I had opened one EJB module.
Comment 1 Jan Horvath 2006-05-10 09:13:42 UTC
Created attachment 30318 [details]
NPE
Comment 2 Tomasz Slota 2006-05-10 09:26:10 UTC
The same problem (NPE from EjbJarProvider.getModuleVersion()) is preventing the
verification hints from working. This issue is blocking me, setting priority to P1

java.lang.RuntimeException: java.lang.NullPointerException
	at
org.netbeans.modules.j2ee.verification.JEEVerificationAnnotationProvider.processDocument(JEEVerificationAnnotationProvider.java:255)
	at
org.netbeans.modules.j2ee.verification.JEEVerificationAnnotationProvider.access$100(JEEVerificationAnnotationProvider.java:68)
	at
org.netbeans.modules.j2ee.verification.JEEVerificationAnnotationProvider$ChangeListener$1.run(JEEVerificationAnnotationProvider.java:344)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:493)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:926)
Caused by: java.lang.NullPointerException
	at
org.netbeans.modules.j2ee.ejbjarproject.EjbJarProvider.getModuleVersion(EjbJarProvider.java:245)
	at
org.netbeans.modules.j2ee.verification.ejb.EJBAPIProblemFinder.isApplicable(EJBAPIProblemFinder.java:96)
	at
org.netbeans.modules.j2ee.verification.ejb.EJBAPIProblemFinder.parseDocument(EJBAPIProblemFinder.java:57)
	at
org.netbeans.modules.j2ee.verification.JEEVerificationAnnotationProvider.processDocument(JEEVerificationAnnotationProvider.java:240)
Comment 3 Andrei Badea 2006-05-10 09:38:26 UTC
Looks like a problem in the EJB project, I will look at it.
Comment 4 Lukas Jungmann 2006-05-10 09:46:18 UTC
Andrei, the cause of this is missing ejb-jar.xml. Therefore mentioned NPE is
being thrown. Similar issue was in appclient project and is fixed now, please
check issue 73710.
Comment 5 Andrei Badea 2006-05-10 10:10:46 UTC
Caused by Stepan's change of the Java EE 5 programmatic version from "1.5" to
"5", which was a planned change. Please change j2ee.platform in your project's
project.properties from "1.5" to "5". Closing as invalid.
Comment 6 Tomasz Slota 2006-05-10 12:48:41 UTC
shouldn't there be something like automatic migration? version synonims? guess
another dozen of users will be struggling with this issue
Comment 7 Andrei Badea 2006-05-10 16:41:02 UTC
No. Importing projects created in non-FCS versions (e.g., importing projects
from beta 1 in beta 2) is not supported.
Comment 8 _ ludo 2006-05-10 17:08:10 UTC
If you take the customer's hat, this is a real bug...
Accepting 1.5 and 5 as valid entries is a must.

Or this is the best way to be right, and still piss of the entire community:
what do you prefer?
Comment 9 _ ludo 2006-05-10 17:14:54 UTC
Having NPEs instead of a nice error message saying that this version number is
not a valid one is a bug. Reopening.
Change the priority to whatever you want (P3 I guess), but all of the properties
in project.properties should be validated as this file is user visible.
Wrong properties should be nicely reported to the user.

For example if your conf dir is not correctly described, you have other npes or
hard to detect behaviour. 
Comment 10 _ pcw 2006-05-10 18:22:09 UTC
For this specific field and this specific value (j2ee.platform=1.5) would it be
that difficult to add a hook, not sure if it would be on "properties read" or
"project open", that automatically converted the 1.5 to a 5 and triggered a save?

I have to agree with Ludo that this will be visible enough that we should deal
with it, but silently fixing it would be much better than just telling the user
to fix it themselves.
Comment 11 Petr Jiricka 2006-05-11 09:40:58 UTC
Again: Importing projects created in non-FCS versions (e.g., importing projects
from beta 1 in beta 2) is not supported.

I am willing to treat this as a P3 defect. Let's see how many duplicates we'll get.

Comment 12 Andrei Badea 2006-05-25 11:13:11 UTC
Now that the programmatic version has benn rollbacked to 1.5 the issue is not
visible anymore. Exceptions caused by invalid properties don't have a big user
impact since not many users modify their project.properties file. Downgrading to P4.
Comment 13 Tomasz Slota 2006-07-19 08:50:17 UTC
*** Issue 80003 has been marked as a duplicate of this issue. ***
Comment 14 Tomasz Slota 2006-07-19 08:50:43 UTC
*** Issue 80086 has been marked as a duplicate of this issue. ***
Comment 15 Martin Krauskopf 2006-08-25 12:14:40 UTC
Note that you can never get NPE from getModuleVersion() again. See my last
comment in issue 77626. And since "the programmatic version has benn rollbacked
to 1.5" as Andrei said this is not issue anymore this is actually fixed by 83114.

http://j2ee.netbeans.org/source/browse/j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/EjbJarProvider.java?r1=1.23.36.6.2.6&r2=1.23.36.6.2.7

Please reopen with better summary if I misunderstand something. Thanks.
Comment 16 Jan Horvath 2007-01-23 10:44:38 UTC
v