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.
- Register an AS 8.x server - New EJB module project using it (J2EE 1.4) - New CMP from DB - NoClassDefFoundError when mapping is being generated
Created attachment 47842 [details] stack trace
The problem is that these classes come from the appserver jars and 3 of those classes were not present in the appserver until AS 9.x. Supplying those 3 missing classes somewhere else won't work because of the module/package uniqueness rules in NB classloading. I have verified that this is really the problem using the system property in <http://openide.netbeans.org/servlets/ReadMsg?list=dev&msgNo=29179>, but this is not a reasonable approach for the shipping product.
At the very least we should catch the exception and skip the generation of sun-cmp-mappings.xml and fail more gracefully.
I see the with "com.sun.jdo.api.persistence.mapping.ejb.EJBInfoHelper". I assume you mean that there are 2 more such classes besides this one that would behave this way. Please add their fully qualified names to this report. I'm confused about a few things. This class is referenced directly by CmpMappingProviderImpl.java in appsrvbridge which is derived from the old code in EjbJarRoot.java from NB 5.x. But this class (EJBInfoHelper.java) has been referenced in that package since the original code in NetBeans 4.1. So I don't understand the "It's in Glassfish, but not in AS 8.2" reference. Can you elaborate?
The 3 missing .class files are: 1) com.sun.jdo.api.persistence.mapping.ejb.AbstractNameMapper (abstract class) 2) com.sun.jdo.api.persistence.mapping.ejb.EJBInfoHelper (interface) 3) com.sun.jdo.api.persistence.mapping.ejb.MappingGenerator (class) In NB 4.1 all these classes lived in the serverplugins/external jar persistence-tool-support and thus were found in a single jar. In NB 6, there is no external jar anymore and the classes needed are loaded from the appserver's lib jars. In AS 8.x that jar file did not contain the above classes - they were added later in the 9.x timeframe. They *existed* earlier on a branch in the appserver, but were not present in the shipped libs of the appserver until 9.x.
Got it, thanks for clarifying.
Link to diffs for updated api jar: <http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrvbridge/external/appservapis-2.0.58.3.jar?r1=1.1&r2=1.2> <http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrvbridge/buildapijar.sh?r1=1.2&r2=1.3>
Link to diffs for Integer fetchgroup instead of String: <http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddapi/src/org/netbeans/modules/j2ee/sun/dd/impl/resources/sun-cmp-mapping_1_0.mdd?r1=1.4&r2=1.5> <http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddapi/src/org/netbeans/modules/j2ee/sun/dd/impl/resources/sun-cmp-mapping_1_1.mdd?r1=1.4&r2=1.5> <http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddapi/src/org/netbeans/modules/j2ee/sun/dd/impl/resources/sun-cmp-mapping_1_2.mdd?r1=1.4&r2=1.5> <http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddapi/src/org/netbeans/modules/j2ee/sun/dd/api/cmp/FetchedWith.java?r1=1.2&r2=1.3> <http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrvbridge/src/org/netbeans/modules/j2ee/sun/bridge/cmp/CmpMappingProviderImpl.java?r1=1.2&r2=1.3>
3 missing class files added and their package added to the list of packages that can live in multiple jars: <http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/dm/SunDeploymentManager.java?r1=1.44&r2=1.45> <http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrvbridge/src/com/sun/jdo/api/persistence/mapping/ejb/AbstractNameMapper.java?rev=1.1&view=markup> <http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrvbridge/src/com/sun/jdo/api/persistence/mapping/ejb/EJBInfoHelper.java?rev=1.1&view=markup> <http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrvbridge/src/com/sun/jdo/api/persistence/mapping/ejb/MappingGenerator.java?rev=1.1&view=markup>