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.
-NullPointerException occurs when adding CMP entity bean to an EJB project -The problem only happens when user delete the project and re-create it STEPS TO REPRODUCE 1. Install Netbean 6.0 nightly build (8/15/2007) with glassfish V2-58b build 2. Create a 1.4 J2EE EJB module project 3. Select to add CMP Entity Beans from default jdbc/sample to the project (select all available tables) 4. Delete the project and re-create it (step 2-3) BUG: java.lang.NullPointerException at org.netbeans.modules.j2ee.sun.ddloaders.DDMultiViewDataObject.writeModel(DDMultiViewDataObject.java:113) at org.netbeans.modules.j2ee.sun.ddloaders.DDMultiViewDataObject.writeModel(DDMultiViewDataObject.java:103) at org.netbeans.modules.j2ee.sun.dd.impl.cmp.SunCmpMappingsProxy.write(SunCmpMappingsProxy.java:338) at org.netbeans.modules.j2ee.sun.share.configbean.SunONEDeploymentConfiguration.mapCmpBeans(SunONEDeploymentConfiguration.java:1662) Caused: org.netbeans.modules.j2ee.deployment.common.api.ConfigurationException: NullPointerException while setting cmp mapping information. at org.netbeans.modules.j2ee.sun.share.configbean.SunONEDeploymentConfiguration.mapCmpBeans(SunONEDeploymentConfiguration.java:1675) at org.netbeans.modules.j2ee.sun.ide.j2ee.ModuleConfigurationImpl.setMappingInfo(ModuleConfigurationImpl.java:160) at org.netbeans.modules.j2ee.deployment.config.ConfigSupportImpl.setCMPMappingInfo(ConfigSupportImpl.java:280) at org.netbeans.modules.j2ee.ejbcore.ejb.wizard.cmp.CmpFromDbGenerator.generateBeans(CmpFromDbGenerator.java:184) at org.netbeans.modules.j2ee.ejbcore.ejb.wizard.cmp.CmpGenerator.generateBeans(CmpGenerator.java:72) at org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard.createBeans(RelatedCMPWizard.java:317) at org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard.access$000(RelatedCMPWizard.java:58) at org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard$1.run(RelatedCMPWizard.java:233) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:539) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:964)
Created attachment 46694 [details] messages.log
Peter, I think this is the same as the race condition you mentioned.
*** Issue 113743 has been marked as a duplicate of this issue. ***
Will try to fix for beta1.
these bugs did not make it into beta1. please re-evaluate the Target milestone settings.
reproduced this on my new host solaris-x86 without delete and recreate of the project. NB 6.0 200709121200 & GF V2 b58g bundled & jdk 1.6u2 JsfJpaCrud project (web Java EE 1.5) is created from IDE -samples/enterprise deploy, run, undelpoy and remove the jdbc resources over jdbc/sample, SamplePool (used the IDE-Services/../Resources/JDBC.. "Delete". The "sample" DB is created and populated by this application. New EJB - J2EE 1.4 project called as testEntityFromDBAlone is created add CMP entity bean from database selected the proposed data source in the Wizard: jdbc/sample add all the tables, NEXT give the entity bean package name keep the two combo boxes checked for: Generate FinderMethods for CMP Fields, Add CMP and CMR Fields to the Local Interfaces. ==>>> Warning ConfigurationException window In the Projects/project, under Configuration Files / App_testEntityFromDBAlone.dbschema/APP_testEntityFromDBAlone can see the mapped tables. adding myself to cc. When the wizard shows the list of data sources + new data source choice, the jdbc/sample data source had been deployed, can see the message in Ouput-GlassFish V2 << ADM1041:Sent the event to instance:[ResourceDeployEvent -- reference-added jdbc/jdbc/sample] CORE5004: Resource Deployed: [jdbc:jdbc/sample]. >>
*** Issue 115942 has been marked as a duplicate of this issue. ***
You can work around this issue by creating a trival sun-cmp-mappings.xml in the configuration folder before invoking the wizard.
Not just CMP. This exception can happen when adding a JAX RPC web service to a J2EE 1.4 ejb-jar (which will attempt to set endpoint-uri field in sun-ejb-jar.xml). See attached trace.
Created attachment 51070 [details] stack trace
was able to reproduce for JAXRPC service add to an EJB on windows/xp with daily 200710211200 & jdk 1.6u3 & gf v2 ur1-b05 (cluster setup). got also from IDE a Warning window with: << Fatal errors found in sun-ejb-jar.xml file It is impossible to merge the latest changes with sun-ejb-jar.xml Do you want to overwrite sun-ejb-jar.xml completely ? >> will add the snapshoot of the screen.
Created attachment 51398 [details] snapshot of screen
I have discovered the cause of this exception and tested a bandage fix to confirm that. I am creating a proper fix now. This will be not be fixed in beta 2 but will be fixed in trunk soon and for 6.0 release.
Cause was premature GC of DataObject for the respective Sun Descriptor file. So Sun DD was created, graph retrieved and then modified. During modification, the DataObject was GC'd, so when graph was merged for saving, a new DataObject and new graph was created and that causes major problems (not supported scenario by API). Fix is to ensure that DataObject is not GC'd in this manner. http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddapi/src/org/netbeans/modules/j2ee/sun/dd/api/DDProvider.java?r1=1.15&r2=1.16
NB daily 200710301200 & GF v2 ur1 b06 & jdk1.6 u03-b05: on windows/xp 2) Create a 1.4 J2EE EJB module project (EJBModule14) 3) Select to add CMP Entity Beans from default jdbc/sample to the project(select all available tables) Browsing in Projects/EJBModule14/Configuration Files, can see the 3 files ejb-jar.xml, sun-cmp-mappings.xml, sun-ejb-jar.xml 4. Delete the project and re-create it (step 2-3) ==> no more exception will continue for JaxRPC case in EJB 1.4
was able to verify on solaris-sparc using 200710291200 & gf v2 ur1 -06 & jdk 1.6 u3 (b05) for cmp Entity Beans from jdbc/sample. No more problem for sun-cmp-mappings.xml for Jax-RPC web service in ejb 1.4 on windows/xp did not hit the exception. for Jax-RPC web service in ejb 1.4 on solaris-sparc : could not add the web service as hit another exception reported to http://statistics.netbeans.org/exceptions/detail.do?id=9614 will try again with.
for Jax-RPC web service in ejb 1.4 on solaris-sparc upgraded to 200710301200 and was able to add the web service + op. Did not hit anymore the NPE at org.netbeans.modules.j2ee.sun.ddloaders.DDMultiViewDataObject.writeModel(DDMultiViewDataObject.java:113)
marking this issues as Verified in 6.0 see previous comments.