A small JBoss 5.1 issue

jbosscorp_logo

I don’t know whether I should call it an issue. But for me it was an issue. Recently I switched to JBoss 5.1.0 GA. But when I tried to run it, it was throwing the following exception:

[ClassLoaderManager] Unexpected error during load of:org.jboss.resource.metadata.repository.DefaultJCAMetaDataRepository
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 org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:63)
        at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:572)
        at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:532)
        at java.security.AccessController.doPrivileged(Native Method)

You will have this problem if you are working with JDK 1.5.x. You can switch to JDK 1.6.x and you can get it working fine. But my entire work setup required me to run my Eclipse Ganymede on 1.5 but JBoss on 1.6. So I wrote a batch file which look like this:

@echo off
echo Overriding the Jboss home and Java home ...
set JBOSS_HOME=D:\jboss-5.1.0.GA
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0
echo Jboss home: %JBOSS_HOME%
echo Java home: %JAVA_HOME%
call %JBOSS_HOME%\bin\run.bat -b 192.168.x.y

So I can have my Eclipse running on 1.5 with JBOSS_HOME set to JDK 1.5 and JBoss on 1.6. Hope this will be helpful for you in some way.

Advertisements