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 200811011401) VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33 OS: Windows XP, 5.1, x86 User Comments: rajivderas: tried to add entity class sunbiz: Creating new RESTful web services from available entity classes sunbiz: Steps to reproduce bug: 1.) Create New Web Application 2.) Create New Entity Classes from database (select sakila DB) 3.) Follow the instructions (I selected All tables for my PU... and java.util.List as my collection class) and Finish 4.) Create New RESTful Web Services from Entity Classes 5.) Click Add all available entity classes and the exception is thrown. Probably it is because of the error message that "Some Selected Entity Classes are not valid" rajivderas: tried to add entity class Stacktrace: java.lang.NullPointerException at org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder.createItemResourceBean(EntityResourceModelBuilder.java:176) at org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder.getItemResourceBean(EntityResourceModelBuilder.java:162) at org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder.createContainerResourceBean(EntityResourceModelBuilder.java:150) at org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder.getContainerResourceBean(EntityResourceModelBuilder.java:134) at org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder.build(EntityResourceModelBuilder.java:117) at org.netbeans.modules.websvc.rest.wizard.EntitySelectionPanelVisual.refreshModel(EntitySelectionPanelVisual.java:582)
Created attachment 73099 [details] stacktrace
Build: NetBeans IDE Dev (Build 200811011401) VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33 OS: Windows XP, 5.1, x86 User Comments: Stacktrace: java.lang.NullPointerException at org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder.createItemResourceBean(EntityResourceModelBuilder.java:176) at org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder.getItemResourceBean(EntityResourceModelBuilder.java:162) at org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder.createContainerResourceBean(EntityResourceModelBuilder.java:150) at org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder.getContainerResourceBean(EntityResourceModelBuilder.java:134) at org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder.build(EntityResourceModelBuilder.java:117) at org.netbeans.modules.websvc.rest.wizard.EntitySelectionPanelVisual.refreshModel(EntitySelectionPanelVisual.java:582)
Created attachment 73100 [details] stacktrace
I believe this is happening because the database table is question does not have a column named "id", and the websvc code expects that column to be present.
Integrated into 'main-golden', will be available in build *200812050201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/7d2d3c28a07b User: PeterTLiu@netbeans.org Log: Initial fixes for IZ #152170, #152640
I turns out that entity classes without Id fields are invalid per the JPA spec. The reason we are getting these entity classes without id fields is because they are generated from views in the sakila mysql sample database which do not have primary keys. The fix on our side is to filter out all these entity classes without id fields so we will never hit the NPE. I am also going to file another IZ against persistence since these entity classes shouldn't be generated in the first place.
Here is the issue against persistence: http://www.netbeans.org/issues/show_bug.cgi?id=154822
Integrated into 'main-golden', will be available in build *200812070201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/03b23cd2055d User: PeterTLiu@netbeans.org Log: More fixes for IZ #152170, #152640 (related to sikila sample database for MySQL)
Build: NetBeans IDE Dev (Build 200807040101) VM: Java HotSpot(TM) Client VM, 1.5.0_15-b04, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_15-b04 OS: Windows 2003, 5.2, x86 User Comments: Stacktrace: java.lang.NullPointerException at org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder.createItemResourceBean(EntityResourceModelBuilder.java:175) at org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder.getItemResourceBean(EntityResourceModelBuilder.java:161) at org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder.createContainerResourceBean(EntityResourceModelBuilder.java:149) at org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder.getContainerResourceBean(EntityResourceModelBuilder.java:133) at org.netbeans.modules.websvc.rest.codegen.model.EntityResourceModelBuilder.build(EntityResourceModelBuilder.java:116) at org.netbeans.modules.websvc.rest.wizard.EntitySelectionPanelVisual.refreshModel(EntitySelectionPanelVisual.java:580)
Created attachment 74751 [details] stacktrace
*** Issue 158172 has been marked as a duplicate of this issue. ***