aspose file tools*
The moose likes JBoss/WildFly and the fly likes Jdk version problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Jdk version problem" Watch "Jdk version problem" New topic
Author

Jdk version problem

Sergio Barreros
Greenhorn

Joined: Sep 09, 2003
Posts: 21
Hello all,
I am using jboss 4.2 and eclipse Europa, and they are both running on the same machine with the same jdk (1.5_11)
I have created a basic Enterprise project which has a simple Session EJB and a War file.
When I deploy my ear file to jboss I get the following error:

17:56:46,265 INFO [TomcatDeployer] undeploy, ctxPath=/webxnetWEB, warUrl=.../tmp/deploy/tmp13789webxnet.ear-contents/webxnetWEB-exp.war/
17:56:46,359 INFO [EARDeployer] Undeploying J2EE application, destroy step: file:/C:/jboss/server/default/deploy/webxnet.ear
17:56:46,359 INFO [EARDeployer] Undeployed J2EE application: file:/C:/jboss/server/default/deploy/webxnet.ear
17:56:46,375 INFO [EARDeployer] Init J2EE application: file:/C:/jboss/server/default/deploy/webxnet.ear
17:56:46,578 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=webxnetEJB.jar
java.lang.ClassNotFoundException: Unexpected error during load of: webxnet.logic.LogicBean, msg=Bad version number in .class file
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:560)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.jboss.ejb3.Ejb3AnnotationHandler.populateBaseInfo(Ejb3AnnotationHandler.java:293)
at org.jboss.ejb3.Ejb3AnnotationHandler.getContainers(Ejb3AnnotationHandler.java:138)
at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:486)
at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:442)
at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:423)
at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:384)
at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:327)
at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:77)
at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:243)
at sun.reflect.GeneratedMethodAccessor3.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.create(Unknown Source)
at org.jboss.system.ServiceController.create(ServiceController.java:330)
at org.jboss.system.ServiceController.create(ServiceController.java:273)
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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy33.create(Unknown Source)
at org.jboss.ejb3.EJB3Deployer.create(EJB3Deployer.java:492)
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.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
at org.jboss.wsf.container.jboss42.DeployerInterceptor.create(DeployerInterceptor.java:76)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
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 $Proxy34.create(Unknown Source)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:959)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor20.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 $Proxy9.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:682)
at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:662)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:200)
at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:131)
at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:399)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:527)
... 76 more
Duc Vo
Ranch Hand

Joined: Nov 20, 2008
Posts: 254
Providing this class is built by you "webxnet.logic.LogicBean". What JDK version that you used to compile the class?


“Everything should be as simple as it is, but not simpler.” Albert Einstein
Sergio Barreros
Greenhorn

Joined: Sep 09, 2003
Posts: 21
I used the only jdk (1.5_11) that is installed in my computer. That's why I am confused why it is throwing the version error, since I know without a doubt that this is the only jdk installed in my computer.

I am starting to think that it has to do with the jboss client jar files that eclipse adds to the project, or something to that nature.
Duc Vo
Ranch Hand

Joined: Nov 20, 2008
Posts: 254
Yes, you are right. I didn't read the exception properly. The information you need is in the "... 76 more" lines.

Anyway, check the manifest files in all the jar libraries that you deployed with the application to see if any of them are from JDK version later than 1.5 that you are using.
Sergio Barreros
Greenhorn

Joined: Sep 09, 2003
Posts: 21
Thanks for your help, how can I see the 76 lines the error mentions? also, I untared the ear file and I can see that there are no other files included, only my ejb and war files.

Thanks
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

The information you need is in the "... 76 more" lines.


Those 76 lines are already in the stack trace. What the JVM is telling you is the the last 76 lines of this "caused by" clause match the last 76 lines of the prior exception in this exception stack trace.

The error message still points to the fact that the webxnet.logic.LogicBean class was compiled with a 6.0 compiler. (This particular exception used to state the version number, which made things clearer, not sure why the Sun JVM team felt that not telling us the version number somehow benefits us.) To verify this, run this (where xxx.jar is the jar file containing the LogicBean class):

javap -verbose -classpath xxx.jar webxnet.logic.LogicBean

Near the beginning of the output you will see the major and minor version numbers. Here are the numbers for a class compiled with the 6.0 compiler:

minor version: 0
major version: 50

Here are some recent major version numbers and their JDK version equivalents:



JBoss In Action
Sergio Barreros
Greenhorn

Joined: Sep 09, 2003
Posts: 21
I ran the above and it came back as
minor version: 0
major version: 50

However, I can't understand this, as I only have 1.5 jdk installed in my machine, which I am using to run jboss as well.
Sergio Barreros
Greenhorn

Joined: Sep 09, 2003
Posts: 21
Got it !
I was looking around on the Project settings, and I guess by default Eclipse sets the project to be 6.0 compliant. I changed that setting to 5.0 rebuilt the project and the errors went away..

Thanks
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

The only way that Eclipse would set the project to be 6.0 compliant would be if Eclipse is running with a 6.0 JRE or JDK. So you must have one on your system somewhere. Look at the JRE Runtimes in the Eclipse preferences - that should tell you what the default JRE is.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jdk version problem