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.
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)
Created attachment 71972 [details] stacktrace
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
Fix in progress
Fixed in changeset 1598cba016d8 in hg.netbeans.org/main
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.