2 Replies Latest reply on Nov 27, 2005 1:16 PM by Dirk Koehler

    NoClassDefFoundError and DeploymentException

    Karan Newbie

      My EJB skills are not really the best, and I am trying to deploy this application written by someone else on JBoss AS 4.0.3SP1.
      The system is running Windows XP with JDK 1.5_05. If someone could help me out with getting this setup, it would be really great, as I have already spent a considerable time trying to solve the problem. I'm positive its going to be something simple. I am facing the following errors:

      17:27:46,399 INFO [EARDeployer] Init J2EE application: file:/C:/Java/jboss-4.0.3SP1/server/default/deploy/MyAPP.ear
      17:28:03,366 WARN [EJBDeployer] Verify failed; continuing
      java.lang.NoClassDefFoundError: com/company/circle/util/UserRegistryException
       at java.lang.Class.getDeclaredMethods0(Native Method)
       at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
       at java.lang.Class.privateGetPublicMethods(Class.java:2488)
       at java.lang.Class.getMethods(Class.java:1406)
       at org.jboss.verifier.strategy.AbstractVerifier.hasEJBCreateMethod(AbstractVerifier.java:664)
       at org.jboss.verifier.strategy.EJBVerifier20.verifySessionBean(EJBVerifier20.java:834)
       at org.jboss.verifier.strategy.EJBVerifier20.checkSession(EJBVerifier20.java:64)
       at org.jboss.verifier.BeanVerifier.verify(BeanVerifier.java:166)
       at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:559)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
       at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy35.create(Unknown Source)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:935)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:925)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:789)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
       at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy6.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:489)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
      17:28:03,569 ERROR [MainDeployer] Could not create deployment: file:/C:/Java/jboss-4.0.3SP1/server/default/tmp/deploy/tmp35857MyAPP.ear-contents/MyAPP-E
      JBs.jar
      org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
       at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:575)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
       at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy35.create(Unknown Source)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:935)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:925)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:789)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
       at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy6.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:489)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
      


      JBoss is complaining about not finding class com/company/circle/util/UserRegistryException
      which does exist within the WAR (packaging details are below).

      The application is packaged in an EAR:
      >jar -tf MyAPP.ear
      META-INF/
      META-INF/MANIFEST.MF
      oracle-ds.xml
      MyAPP-UI.war
      MyAPP-EJBs.jar
      META-INF/jboss-app.xml
      META-INF/application.xml

      application.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE application PUBLIC
       "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
       "http://java.sun.com/dtd/application_1_3.dtd">
      <application>
       <display-name>MyAPP</display-name>
       <module>
       <ejb>MyAPP-EJBs.jar</ejb>
       </module>
       <module>
       <web>
       <web-uri>MyAPP-UI.war</web-uri>
       <context-root>/moms</context-root>
       </web>
       </module>
       <security-role id="SecurityRole_1">
       <description>All Authenticated</description>
       <role-name>All Authenticated</role-name>
       </security-role>
       <security-role id="SecurityRole_2">
       <description>Everyone</description> <role-name>Everyone</role-name>
       </security-role>
      </application>
      


      jboss-app.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss-app
       PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN"
       "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
      
      <jboss-app>
       <loader-repository>
       moms:loader=MyAPP.ear
       <loader-repository-config>
       java2ParentDelegation=false
       </loader-repository-config>
       </loader-repository>
      </jboss-app>
      


      The EJBs are in MyAPP-EJBs.jar. There are 8 stateless Session Beans.
      >jar -tf MyAPP-EJBs.jar
      META-INF/
      META-INF/MANIFEST.MF
      com/
      com/myApp/
      com/myApp/ejb/
      com/myApp/ejb/interfaces/
      com/myApp/ejb/CallTrackSBBean.class
      .....more EJBs....
      com/myApp/ejb/interfaces/CallTrackSB.class
      com/myApp/ejb/interfaces/CallTrackSBHome.class
      .....more EJB interfaces...
      META-INF/ejb-jar.xml
      META-INF/jboss.xml

      ejb-jar.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
      <ejb-jar >
      
       <description>[CDATA[No Description.]]</description>
       <display-name>Generated by XDoclet</display-name>
      
       <enterprise-beans>
      
       .....more <session> descriptions....
       <session >
       <description>[CDATA[Description for CallTrackSB]]</description>
       <display-name>Name for CallTrackSB</display-name>
      
       <ejb-name>CallTrackSB</ejb-name>
      
       <home>com.myApp.ejb.interfaces.CallTrackSBHome</home>
       <remote>com.myApp.ejb.interfaces.CallTrackSB</remote>
       <ejb-class>com.myApp.ejb.CallTrackSBBean</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
       </session>
       .....more <session> descriptions....
      
       </enterprise-beans>
      
       <assembly-descriptor>
      
       <security-role id="SecurityRole_1">
       <description>All Authenticated</description>
       <role-name>All Authenticated</role-name>
       </security-role>
       <security-role id="SecurityRole_2">
       <description>Everyone</description>
       <role-name>Everyone</role-name>
       </security-role>
      
       <container-transaction id="MethodTransaction_1">
       <method id="MethodElement_1">
       <ejb-name>CallTrackSB</ejb-name>
       <method-name>*</method-name>
       </method>
       <trans-attribute>Required</trans-attribute>
       </container-transaction>
       ....more <container-transaction> descriptions...
      
       </assembly-descriptor>
      </ejb-jar>
      


      jboss.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
      
      <jboss>
       <enterprise-beans>
       ....more <session> descriptions...
       <session>
       <ejb-name>CallTrackSB</ejb-name>
       <jndi-name>CallTrackSB</jndi-name>
      
       <method-attributes>
       </method-attributes>
       </session>
       ....more <session> descriptions...
       </enterprise-beans>
      
       <assembly-descriptor>
       </assembly-descriptor>
      
       <resource-managers>
       </resource-managers>
      </jboss>
      


      All the JSPs and other java classes are in MyAPP-UI.war:
      WEB-INF/jboss-web.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss-web PUBLIC
       "-//JBoss//DTD Web Application 2.4//EN"
       "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
      <jboss-web>
      </jboss-web>
      


      WEB-INF/web.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app PUBLIC
       "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      
      
      "http://java.sun.com/dtd/web-app_2_3.dtd">
      <web-app>
       <display-name>MyAPP</display-name>
      
       <servlet id="Servlet_1">
       <servlet-name>Dispatcher</servlet-name>
       <description></description>
       <servlet-class>webwork.servlets.Dispatcher</servlet-class>
       </servlet>
      
       <servlet id="Servlet_2">
       <servlet-name>WorkOrderChartServlet</servlet-name>
       <display-name>Work Order Chart Servlet</display-name>
       <description>Work Order Chart Servlet</description>
       <servlet-class>
       com.myApp.chart.WorkOrderChartServlet
       </servlet-class>
       <load-on-startup>0</load-on-startup>
       </servlet>
      
       ....more servlet descriptions here...
      
       <servlet-mapping id="ServletMapping_1">
       <servlet-name>Dispatcher</servlet-name>
       <url-pattern>*.action</url-pattern>
       </servlet-mapping>
      
       <servlet-mapping id="ServletMapping_2">
       <servlet-name>WorkOrderChartServlet</servlet-name>
       <url-pattern>/servlet/workOrderChartServlet</url-pattern>
       </servlet-mapping>
      
       ....more servlet-mappings here....
      
       <welcome-file-list>
       <welcome-file>index.html</welcome-file>
       <welcome-file>index.jsp</welcome-file>
       <welcome-file>logon.jsp</welcome-file>
       </welcome-file-list>
      
       <security-role id="SecurityRole_1">
       <description>All Authenticated</description>
       <role-name>All Authenticated</role-name>
       </security-role>
      
       <security-role id="SecurityRole_2">
       <description>Everyone</description>
       <role-name>Everyone</role-name>
       </security-role>
      
      </web-app>
      


      I know people have faced this problem before and its probably something very simple. I looked into jbossweb-tomcat55.sar and in META-INF/jboss-service.xml is this:
      <attribute name="Java2ClassLoadingCompliance">false</attribute>
      <attribute name="UseJBossWebLoader">false</attribute>
      


      Please let me know if you need more info.
      Thanks.