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 204564 - NullPointerException at org.netbeans.modules.j2ee.ejbcore._RetoucheUtil.resolveFileObjectForClass
Summary: NullPointerException at org.netbeans.modules.j2ee.ejbcore._RetoucheUtil.resol...
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB (show other bugs)
Version: 7.1
Hardware: All All
: P3 normal (vote)
Assignee: Martin Fousek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-02 09:19 UTC by Jiri Skrivanek
Modified: 2011-11-07 10:17 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 182512


Attachments
stacktrace (2.49 KB, text/plain)
2011-11-02 09:19 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2011-11-02 09:19:33 UTC
Build: NetBeans IDE Dev (Build 201111010600)
VM: Java HotSpot(TM) Client VM, 21.1-b02, Java(TM) SE Runtime Environment, 1.7.0_01-b08
OS: Windows XP

User Comments:
jskrivanek: To reproduce:
- create EJB project with WebLogic server
- open new file wizard
- choose "Enterprise JavaBeans - CMP Entity Beans from Database"
- Specify some data source. For example jdbc/sample
- Select some of available tables - lets say Customer
- click Finish




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.j2ee.ejbcore._RetoucheUtil.resolveFileObjectForClass(_RetoucheUtil.java:309)
   at org.netbeans.modules.j2ee.ejbcore.action.CmFieldGenerator.addFieldToClass(CmFieldGenerator.java:140)
   at org.netbeans.modules.j2ee.ejbcore.action.CmFieldGenerator.addCmpField(CmFieldGenerator.java:105)
   at org.netbeans.modules.j2ee.ejbcore.ejb.wizard.cmp.CmpFromDbGenerator.addCmpFields(CmpFromDbGenerator.java:347)
   at org.netbeans.modules.j2ee.ejbcore.ejb.wizard.cmp.CmpFromDbGenerator.generateBeans(CmpFromDbGenerator.java:170)
   at org.netbeans.modules.j2ee.ejbcore.ejb.wizard.cmp.CmpGenerator.generateBeans(CmpGenerator.java:97)
Comment 1 Jiri Skrivanek 2011-11-02 09:19:37 UTC
Created attachment 112714 [details]
stacktrace
Comment 2 Martin Fousek 2011-11-03 07:58:16 UTC
Looks like issue similar to bug #202495, but I don't understand why did you not get additional debug/logging information. Definitely valid issue, I will investigate what could happen there.
Comment 3 Jiri Skrivanek 2011-11-03 09:03:06 UTC
What do you mean by additional debug/logging information? This bug was reported by the exception reporter, so I expect you have as much data as possible.
Comment 4 Martin Fousek 2011-11-03 09:10:05 UTC
Since http://hg.netbeans.org/web-main/rev/1b9c5ba7b4f9 I would expect more information about the fileObject for javaSource creation, but probably the problem wasn't directly there.
Comment 5 Martin Fousek 2011-11-03 16:54:39 UTC
You were right, I forgot that the rest of needed information will be in the log. So the cause of these troubles is non-valid fileobject - the javaSource is not returned then. Problem will be probably in codes which calls this method.
Comment 6 Martin Fousek 2011-11-04 14:53:00 UTC
CmFieldGenerator should got javaSource for the same class twice and failed (returned null) only in the second creation. Means that it can cause code between those two calls. This code makes changes in the ejbClass and rewrite its source Tree. I'm not aware that it should make any troubles but for assurance there will be the modificationTask on the ejbClass source called at the end of the method.

web-main #5f1df1b8e16a
Comment 7 Quality Engineering 2011-11-05 16:29:43 UTC
Integrated into 'main-golden', will be available in build *201111050600* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/5f1df1b8e16a
User: Martin Fousek <marfous@netbeans.org>
Log: #204564 - NullPointerException at org.netbeans.modules.j2ee.ejbcore._RetoucheUtil.resolveFileObjectForClass