JiBX
  1. JiBX
  2. JIBX-80

NoClassDefFoundError when deploying to jboss

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.0-RC1
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:
      Windows XP. Eclipse 3.1. Maven 1.0.2, jdk 1.4.2_08 build 3. JiBX 1.0-RC1. JBoss 4.0.3
    • Number of attachments :
      1

      Description

      After running the binding compiler against my java classes and deploying to a Jboss server, I receive the following stack trace:

      java.lang.NoClassDefFoundError: com/caiso/ads/entity/DispatchBatch
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:1655)
      at java.lang.Class.privateGetPublicMethods(Class.java:1778)
      at java.lang.Class.getMethods(Class.java:832)
      at org.jboss.verifier.strategy.AbstractVerifier.hasEJBCreateMethod(AbstractVerifier.java:664)
      at org.jboss.verifier.strategy.EJBVerifier21.verifySessionBean(EJBVerifier21.java:843)
      at org.jboss.verifier.strategy.EJBVerifier21.checkSession(EJBVerifier21.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:324)
      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 $Proxy24.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.GeneratedMethodAccessor51.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      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 $Proxy9.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:265)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:428)
      at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      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 $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:285)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)
      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:324)
      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 $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:453)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:330)
      at org.jboss.Main.boot(Main.java:187)
      at org.jboss.Main$1.run(Main.java:438)
      at java.lang.Thread.run(Thread.java:534)

      I am using the following ant task within maven to run the binding compiler:
      <postGoal name="java:compile">
      <echo>Running JiBX Compiler ...</echo>
      <ant:taskdef name="bind" classname="org.jibx.binding.ant.CompileTask"
      classpathref="maven.dependency.classpath"/>

      <bind verbose="false" load="true" binding="src/main/jibx/binding.xml">
      <classpathset dir="target/classes"/>
      </bind>
      </postGoal>

      When I remove the JiBX binding compiler from the maven project, the project deploys just fine.
      I've tried running the binding compiler outside of maven manually and rebuilding the jar file. Same results (the above error).
      The DispatchBatch class is being referenced by an SLSB in one of the method signatures (as a return type). JBoss is failing when trying to verify this bean.

      I've even tried creating a seperate jar file for my JiBX classes, building and compiling them (including the binding compiler) in a seperate project and deploying. Same results.

      I must be doing something wrong and numerous searchs have produced no results. Most of the problems related to this exception appeared to occur at compile time, not runtime, or in this case, deployment time.

        Activity

        Hide
        Mark Lassiter added a comment -

        I apologize sincerely. I don't think this is a bug with JiBX. It was a problem with my EAR file. The included JiBX jar files were not referenced in the application.xml. By either including the jar files in my EJB jar file (instead of the top level EAR) or by referencing jibx-bind and xpp3 in the application.xml, the error goes away. This should have been obvious to me, but the error was misleading.

        It is odd that JBoss would report ClassDefNotFoundError for my class instead of reporting it for one of the classes in the JiBX jar files since that is what was really missing. But I guess this is how it works.

        Anyhow, its working now.

        Thanks

        Show
        Mark Lassiter added a comment - I apologize sincerely. I don't think this is a bug with JiBX. It was a problem with my EAR file. The included JiBX jar files were not referenced in the application.xml. By either including the jar files in my EJB jar file (instead of the top level EAR) or by referencing jibx-bind and xpp3 in the application.xml, the error goes away. This should have been obvious to me, but the error was misleading. It is odd that JBoss would report ClassDefNotFoundError for my class instead of reporting it for one of the classes in the JiBX jar files since that is what was really missing. But I guess this is how it works. Anyhow, its working now. Thanks
        Hide
        Dennis Sosnoski added a comment -

        Resolved per submitter comments.

        Show
        Dennis Sosnoski added a comment - Resolved per submitter comments.

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            Mark Lassiter
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: