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 150378 - [65cat] NullPointerException at org.netbeans.modules.websvc.rest.codegen.EntityResourcesGenerator$1.run
Summary: [65cat] NullPointerException at org.netbeans.modules.websvc.rest.codegen.Enti...
Status: RESOLVED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Nathan Fiedler
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-16 14:00 UTC by sunbiz
Modified: 2009-02-19 23:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 128904


Attachments
stacktrace (922 bytes, text/plain)
2008-10-16 14:00 UTC, sunbiz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sunbiz 2008-10-16 14:00:09 UTC
Build: NetBeans IDE Dev (Build 200810140201)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-rc2-b32
OS: Windows Vista, 6.0, x86

User Comments:
sunbiz: Generating RESTful Web service from Database...



Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.websvc.rest.codegen.EntityResourcesGenerator$1.run(EntityResourcesGenerator.java:348)
        at org.netbeans.modules.websvc.rest.codegen.EntityResourcesGenerator$1.run(EntityResourcesGenerator.java:345)
        at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:953)
        at org.netbeans.modules.websvc.rest.codegen.EntityResourcesGenerator.generatePersistenceService(EntityResourcesGenerator.java:343)
        at org.netbeans.modules.websvc.rest.codegen.EntityResourcesGenerator.generate(EntityResourcesGenerator.java:267)
        at org.netbeans.modules.websvc.rest.wizard.fromdb.DatabaseResourceWizardIterator$3.run(DatabaseResourceWizardIterator.java:248)
Comment 1 sunbiz 2008-10-16 14:00:29 UTC
Created attachment 71972 [details]
stacktrace
Comment 2 Lukas Jungmann 2008-11-05 23:02:06 UTC
happens if there's no persistence unit in the project, use ie these steps to reproduce:

-create new webapp
-open the rest from db wizard
-in the first panel there choose some db connection, choose some table, push Add/Add all and press next
-in this second panel fill in some pkg name, push Create PU button but dismiss it when it appears (ie. by Cancel button)
-finish the wizard

=> NPE
Comment 3 Nathan Fiedler 2008-12-06 04:25:19 UTC
Fix in progress
Comment 4 Nathan Fiedler 2008-12-06 04:42:16 UTC
Fixed in changeset 1598cba016d8 in hg.netbeans.org/main
Comment 5 Quality Engineering 2008-12-09 18:35:02 UTC
Integrated into 'main-golden', will be available in build *200812091520* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/1598cba016d8
User: Nathan Fiedler <nlfiedler@netbeans.org>
Log: #150378: ensure persistence unit exists to avoid NPE.