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 189054 - NullPointerException at org.netbeans.modules.maven.j2ee.web.EntRefContainerImpl.addResourceRef
Summary: NullPointerException at org.netbeans.modules.maven.j2ee.web.EntRefContainerIm...
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-29 14:37 UTC by Petr Jiricka
Modified: 2011-04-02 08:50 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 171633


Attachments
stacktrace (2.70 KB, text/plain)
2010-07-29 14:37 UTC, Petr Jiricka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2010-07-29 14:37:36 UTC
Build: NetBeans IDE Dev (Build web-main-3582-on-100729)
VM: Java HotSpot(TM) 64-Bit Server VM, 16.3-b01-279, Java(TM) SE Runtime Environment, 1.6.0_20-b02-279-9M3165
OS: Mac OS X

User Comments:
pjiricka: 1. Create a Java EE 6 Maven Web project
2. Create a new Java class
3. Set target server of the project to GlassFish
4. In the editor popup menu, use Insert Code -> Use Database, go through the dialog (selecting existing server DS) and click Ok.




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.maven.j2ee.web.EntRefContainerImpl.addResourceRef(EntRefContainerImpl.java:252)
   at org.netbeans.modules.j2ee.ejbcore.action.UseDatabaseGenerator.generateJNDILookup(UseDatabaseGenerator.java:199)
   at org.netbeans.modules.j2ee.ejbcore.action.UseDatabaseGenerator.generate(UseDatabaseGenerator.java:111)
   at org.netbeans.modules.j2ee.ejbcore.ui.logicalview.entries.UseDatabaseCodeGenerator.invoke(UseDatabaseCodeGenerator.java:194)
   at org.netbeans.modules.editor.codegen.GenerateCodePanel.invokeSelected(GenerateCodePanel.java:162)
   at org.netbeans.modules.editor.codegen.GenerateCodePanel.listKeyReleased(GenerateCodePanel.java:131)
Comment 1 Petr Jiricka 2010-07-29 14:37:40 UTC
Created attachment 101084 [details]
stacktrace
Comment 2 Sergey Petrov 2010-08-31 14:46:12 UTC
Is it persistence related? (all "use database" issues, and this one specifically as it may be more maven related)
Comment 3 Sergey Petrov 2010-10-27 11:06:10 UTC
there is another npe in ant web project and both ant and maven works with Use Database in Servlet. Should it work in plain java class?
Comment 4 Petr Jiricka 2010-11-01 20:14:44 UTC
Yes, it should work in plain Java classes (the generated code may need to be different). What is the stack trace for Ant?
Comment 5 Sergey Petrov 2011-04-01 13:32:16 UTC
http://hg.netbeans.org/web-main/rev/0ab6b6bd6975
maven is fixed, can't reproduce with ant
Comment 6 Quality Engineering 2011-04-02 08:50:51 UTC
Integrated into 'main-golden', will be available in build *201104020400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/0ab6b6bd6975
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: fix #189054 - ee6 ,may not have webxml already created