6 Replies Latest reply on Dec 18, 2007 9:08 AM by wedny

    exception occurs while deployingDB2JDBC driver jar

    wedny

      Hello All,

      Our application uses Jboss4.03 with 1.5 jdk. It works fine till now we updated the DB2 JDBC Driver jar from IBM.
      With the new DB2 JDBC Driver jar, the server gets "java.io.IOException: non class file" threw by "org.jboss.ejb3.EJB3Deployer.hasEjbAnnotation".
      The whole stacktrace:
      13:33:47,606 ERROR [MainDeployer] Could not initialise deployment: file:/C:/EMServer/server/all/deploy/6_ems.sar.ear/
      org.jboss.deployment.DeploymentException: exception in init of file:/C:/EMServer/server/all/tmp/deploy/tmp21386ems.sar-contents/lib/drivers/db2/
      ava.lang.RuntimeException: java.io.IOException: non class file)
      at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53)
      at org.jboss.deployment.MainDeployer.init(MainDeployer.java:887)
      at org.jboss.deployment.MainDeployer.init(MainDeployer.java:881)
      at org.jboss.deployment.MainDeployer.init(MainDeployer.java:881)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:798)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
      at sun.reflect.GeneratedMethodAccessor52.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:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.GeneratedMethodAccessor2.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:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.GeneratedMethodAccessor9.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:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:755)
      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:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
      at org.jboss.Main.boot(Main.java:200)
      at org.jboss.Main$1.run(Main.java:464)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.RuntimeException: java.io.IOException: non class file
      at org.jboss.ejb3.EJB3Deployer.hasEjbAnnotation(EJB3Deployer.java:219)
      at org.jboss.ejb3.EJB3Deployer.accepts(EJB3Deployer.java:251)
      at sun.reflect.GeneratedMethodAccessor13.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:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
      at org.jboss.deployment.SubDeployerInterceptor.invokeNext(SubDeployerInterceptor.java:124)
      at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:109)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy30.accepts(Unknown Source)
      at org.jboss.deployment.MainDeployer.findDeployer(MainDeployer.java:1060)
      at org.jboss.deployment.MainDeployer.init(MainDeployer.java:846)
      ... 68 more
      Caused by: java.io.IOException: non class file
      at javassist.bytecode.ClassFile.read(ClassFile.java:611)
      at javassist.bytecode.ClassFile.(ClassFile.java:52)
      at org.jboss.ejb3.EJB3Deployer.hasEjbAnnotation(EJB3Deployer.java:199)

      Does somebody know how to fix it?
      Thanks in advance

        • 1. Re: exception occurs while deployingDB2JDBC driver jar
          peterj

          I see that in this repost of your question that you are now identifying the version of the JVM you are using. Have you verified that the JDBC JAR file is not corrupted?

          • 2. Re: exception occurs while deployingDB2JDBC driver jar
            wedny

            The db2jcc.jar is from IBM new release DB2 Universal JDBC driver to the latest version (3.1.57).

            We didn't change it. And it works fine with other application.

            Is it possible to know what class causes this problem? I mean the class name that cannot be read?

            • 3. Re: exception occurs while deployingDB2JDBC driver jar
              wedny

              The jboss deploys fine with db2jcc.jar(V2.8.46) for DB2 Universal JDBC drive

              • 4. Re: exception occurs while deployingDB2JDBC driver jar
                peterj

                Which version of JBossASA are you using (as far as I know, there was never an EJB3 that went with 4.0.3)? Also, what version of EJB3 did you install?

                Also, looking at the code, I don't see how the JDBC JAR file could be affecting this (though, considering interdependencies, anything is possible). The code that blows up looks like it is scanning the EJB classes in an EJB jar file looking for annotations. Do this. Add the option "-verbose:class" to the JAVA_OPTS and run it again. This causes the JVM to print out the location of every class file loaded. Redirect stdout to a file because you will get a lot of output. Start by posting the last 20 or so class files loaded before this error occurs.

                Also, just to be sure, replace the older version of the JDBC JAR file and see if things still run.

                Finally, do a 'jar -tf jdbc.jar', where jdbc.jar is the name of the JDBC JAR file, and post the names of all classes that are not from IBM.

                • 5. Re: exception occurs while deployingDB2JDBC driver jar
                  peterj

                  I just now ran into this exact same error message using the latest JDBC4 compliant driver for PostgreSQL. Apparently, that driver was compiled using JDK 1.6 and I was attempting to run it with JDK 1.5. I find is strange that in this situation that the typical "bad version number" message does not show up, apparently one part of the code "ate" that message and forwarded the "non class file" message. You can verify if this is the case for you by looking at the manifest file in the jar, typically those are built using ant and ant will specify the JDK used to do the compile.

                  So the possible solutions to your problems are:

                  1) Try to get a copy of the driver compiled with 1.5
                  2) Run with the 1.6 JDK (others have tried it and it sometimes works but is not a qualified JDK for JBossAS at this time)
                  3) Continue to use your old driver.

                  • 6. Re: exception occurs while deployingDB2JDBC driver jar
                    wedny

                    Thanks! Peter.

                    Due to our Jan release, we decide to reverse back to use the old version DB2 JDBC driver.

                    I may continue work on it after the our release. If I got any result, I will post to let you know.