5 Replies Latest reply on Nov 5, 2007 12:02 PM by Peter Johnson

    Jboss 5 Beta 2 won't even run with Java 5?

    Timo Roessner Newbie

      Hey ho,

      i hope somebody can help me out here:

      The symptoms:

      -> Jboss 5 Beta 1 runs with both Java 5 and Java 6.

      -> Jboss 5 Beta 2 doesn't run with both Java 5 and Java 6?


      Now i know that the Beta does NOT run with Java 6, but everything i read said it should run with Java 5?


      According to this Jboss-Bug entry:

      http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassNotFoundJava.lang.StringInJDK6



      Problem:

      You get the below exception when running JBoss with JDK 6:

      java.lang.IllegalStateException: Class not found: [Ljava.lang.String;



      Cause:

      This exception is caused because of the improper use of classloaders in JBoss code. Look at this forum thread for more details.

      Solution:

      Use JDK5




      Yeah exactly, use Java 5


      But regardless of the java version i use (meaning 5 or 6), i always get the exact same error message:


      07:56:33,596 INFO [ProfileImpl] Using profile root:/opt/jboss-5.0.0.Beta2/server/default
      07:56:34,763 ERROR [AbstractKernelController] Error installing to Instantiated: name=DeploymentFilter state=Described
      java.lang.IllegalStateException: Class not found: [Ljava.lang.String;
       at org.jboss.metadata.spi.signature.Signature.stringsToClasses(Signature.java:174)
       at org.jboss.metadata.spi.signature.Signature.stringsToClasses(Signature.java:125)
       at org.jboss.metadata.spi.signature.Signature.getParametersTypes(Signature.java:292)
       at org.jboss.metadata.plugins.loader.reflection.AnnotatedElementMetaDataLoader.getComponentMetaDataRetrieval(AnnotatedElementMetaDataLoader.java:138)
       at org.jboss.metadata.plugins.context.AbstractMetaDataContext.getComponentMetaDataRetrieval(AbstractMetaDataContext.java:280)
       at org.jboss.metadata.spi.retrieval.MetaDataRetrievalToMetaDataBridge.getComponentMetaData(MetaDataRetrievalToMetaDataBridge.java:159)
       at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.methodHasAnnotations(AOPConstructorJoinpoint.java:202)
       at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.hasMethodMetaData(AOPConstructorJoinpoint.java:172)
       at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.hasInstanceOrJoinpointMetaData(AOPConstructorJoinpoint.java:152)
      


      This is exactly the error message which is described in the bug report.

      So in a nutshell:

      Why won't Jboss 5 Beta 2 run with Java 5 although this is the "official" bug solution?

      Can somebody confirm that?


        • 1. Re: Jboss 5 Beta 2 won't even run with Java 5?
          jaikiran pai Master

          How are you switching the JDK? When JBoss starts it prints out the version of Java being used. Something like:

          19:16:33,193 INFO [ServerInfo] Java version: 1.5.0_13,Sun Microsystems Inc.
          19:16:33,193 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.5.0_13-b05,Sun Microsystems Inc.
          19:16:33,193 INFO [ServerInfo] OS-System: Windows XP 5.1,x86


          What does your logs show?

          And by the way, the link that you posted is an Wiki entry and not a bug entry. JBoss tracks its bugs through JIRA.


          • 2. Re: Jboss 5 Beta 2 won't even run with Java 5?
            Timo Roessner Newbie

            Sorry,

            the information i provided was way to unspecific.

            Let me clarify that:

            Jboss 5 Beta 2 with Java 5:

            cd ../../jboss-5.0.0.Beta2/bin/


            java -version
            java version "1.5.0_13"
            Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05)
            Java HotSpot(TM) Client VM (build 1.5.0_13-b05, mixed mode, sharing)


            ./run.sh
            =========================================================================
            
             JBoss Bootstrap Environment
            
             JBOSS_HOME: /opt/jboss-5.0.0.Beta2
            
             JAVA: /usr/lib/jvm/java-6-sun-1.6.0.03/bin/java
            
             JAVA_OPTS: -Dprogram.name=run.sh -server -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
            
             CLASSPATH: /opt/jboss-5.0.0.Beta2/bin/run.jar:/usr/lib/jvm/java-6-sun-1.6.0.03/lib/tools.jar
            
            =========================================================================
            
            12:50:13,429 INFO [ServerImpl] Starting JBoss (Microcontainer)...
            12:50:13,430 INFO [ServerImpl] Release ID: JBoss [Morpheus] 5.0.0.Beta2 (build: SVNTag=JBoss_5_0_0_Beta2 date=200704060017)
            12:50:13,430 INFO [ServerImpl] Home Dir: /opt/jboss-5.0.0.Beta2
            12:50:13,430 INFO [ServerImpl] Home URL: file:/opt/jboss-5.0.0.Beta2/
            12:50:13,430 INFO [ServerImpl] Library URL: file:/opt/jboss-5.0.0.Beta2/lib/
            12:50:13,431 INFO [ServerImpl] Patch URL: null
            12:50:13,431 INFO [ServerImpl] Server Name: default
            12:50:13,431 INFO [ServerImpl] Server Home Dir: /opt/jboss-5.0.0.Beta2/server/default
            12:50:13,431 INFO [ServerImpl] Server Home URL: file:/opt/jboss-5.0.0.Beta2/server/default/
            12:50:13,432 INFO [ServerImpl] Server Data Dir: /opt/jboss-5.0.0.Beta2/server/default/data
            12:50:13,432 INFO [ServerImpl] Server Temp Dir: /opt/jboss-5.0.0.Beta2/server/default/tmp
            12:50:13,432 INFO [ServerImpl] Server Config URL: file:/opt/jboss-5.0.0.Beta2/server/default/conf/
            12:50:13,432 INFO [ServerImpl] Server Library URL: file:/opt/jboss-5.0.0.Beta2/server/default/lib/
            12:50:13,432 INFO [ServerImpl] Root Deployment Filename: jboss-service.xml
            12:50:13,456 INFO [ServerImpl] Starting Microcontainer, bootstrapURL=file:/opt/jboss-5.0.0.Beta2/server/default/conf/bootstrap-beans.xml
            12:50:14,217 INFO [ProfileImpl] Using profile root:/opt/jboss-5.0.0.Beta2/server/default
            12:50:15,288 ERROR [AbstractKernelController] Error installing to Instantiated: name=DeploymentFilter state=Described
            java.lang.IllegalStateException: Class not found: [Ljava.lang.String;
             at org.jboss.metadata.spi.signature.Signature.stringsToClasses(Signature.java:174)
             at org.jboss.metadata.spi.signature.Signature.stringsToClasses(Signature.java:125)
             at org.jboss.metadata.spi.signature.Signature.getParametersTypes(Signature.java:292)
             at org.jboss.metadata.plugins.loader.reflection.AnnotatedElementMetaDataLoader.getComponentMetaDataRetrieval(AnnotatedElementMetaDataLoader.java:138)
             at org.jboss.metadata.plugins.context.AbstractMetaDataContext.getComponentMetaDataRetrieval(AbstractMetaDataContext.java:280)
             at org.jboss.metadata.spi.retrieval.MetaDataRetrievalToMetaDataBridge.getComponentMetaData(MetaDataRetrievalToMetaDataBridge.java:159)
             at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.methodHasAnnotations(AOPConstructorJoinpoint.java:202)
             at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.hasMethodMetaData(AOPConstructorJoinpoint.java:172)
             at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.hasInstanceOrJoinpointMetaData(AOPConstructorJoinpoint.java:152)
             at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.dispatch(AOPConstructorJoinpoint.java:99)
             at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:103)
             at org.jboss.kernel.plugins.dependency.InstantiateAction.installActionInternal(InstantiateAction.java:52)
             at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:197)
             at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.install(KernelControllerContextAction.java:136)
             at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
             at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:233)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:724)
             at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:445)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:555)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:489)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:289)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:192)
             at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:302)
             at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:272)
             at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:119)
             at org.jboss.kernel.plugins.deployment.BasicKernelDeployer.deploy(BasicKernelDeployer.java:64)
             at org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer.deploy(BasicXMLDeployer.java:76)
             at org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer.deploy(BasicXMLDeployer.java:146)
             at org.jboss.system.server.profileservice.ProfileServiceBootstrap.deploy(ProfileServiceBootstrap.java:295)
             at org.jboss.system.server.profileservice.ProfileServiceBootstrap.bootstrap(ProfileServiceBootstrap.java:222)
             at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:89)
             at org.jboss.system.server.profileservice.ServerImpl.doStart(ServerImpl.java:403)
             at org.jboss.system.server.profileservice.ServerImpl.start(ServerImpl.java:342)
             at org.jboss.Main.boot(Main.java:210)
             at org.jboss.Main$1.run(Main.java:522)
             at java.lang.Thread.run(Thread.java:619)
            Caused by: java.lang.ClassNotFoundException: [Ljava.lang.String;
             at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
             at java.security.AccessController.doPrivileged(Native Method)
             at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
             at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
             at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
             at org.jboss.metadata.spi.signature.Signature.stringsToClasses(Signature.java:170)
             ... 35 more
            


            Jboss 5 Beta 2 with Java 5:

            update-alternatives --config java
            
            There are 5 alternatives which provide `java'.
            
             Selection Alternative
            -----------------------------------------------
             1 /usr/lib/jvm/java-6-sun/jre/bin/java
            * 2 /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
             3 /usr/bin/gij-4.1
             4 /usr/bin/gij-4.2
             + 5 /usr/lib/jvm/java-gcj/jre/bin/java
            
            Press enter to keep the default, or type selection number: 1
            Using `/usr/lib/jvm/java-6-sun/jre/bin/java' to provide `java'.
            
            


            [code java -version
            java version "1.6.0_03"
            Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
            Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)
            ]

            ./run.sh
            =========================================================================
            
             JBoss Bootstrap Environment
            
             JBOSS_HOME: /opt/jboss-5.0.0.Beta2
            
             JAVA: /usr/lib/jvm/java-6-sun-1.6.0.03/bin/java
            
             JAVA_OPTS: -Dprogram.name=run.sh -server -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
            
             CLASSPATH: /opt/jboss-5.0.0.Beta2/bin/run.jar:/usr/lib/jvm/java-6-sun-1.6.0.03/lib/tools.jar
            
            =========================================================================
            
            12:51:03,235 INFO [ServerImpl] Starting JBoss (Microcontainer)...
            12:51:03,235 INFO [ServerImpl] Release ID: JBoss [Morpheus] 5.0.0.Beta2 (build: SVNTag=JBoss_5_0_0_Beta2 date=200704060017)
            12:51:03,236 INFO [ServerImpl] Home Dir: /opt/jboss-5.0.0.Beta2
            12:51:03,236 INFO [ServerImpl] Home URL: file:/opt/jboss-5.0.0.Beta2/
            12:51:03,236 INFO [ServerImpl] Library URL: file:/opt/jboss-5.0.0.Beta2/lib/
            12:51:03,237 INFO [ServerImpl] Patch URL: null
            12:51:03,237 INFO [ServerImpl] Server Name: default
            12:51:03,237 INFO [ServerImpl] Server Home Dir: /opt/jboss-5.0.0.Beta2/server/default
            12:51:03,237 INFO [ServerImpl] Server Home URL: file:/opt/jboss-5.0.0.Beta2/server/default/
            12:51:03,237 INFO [ServerImpl] Server Data Dir: /opt/jboss-5.0.0.Beta2/server/default/data
            12:51:03,237 INFO [ServerImpl] Server Temp Dir: /opt/jboss-5.0.0.Beta2/server/default/tmp
            12:51:03,237 INFO [ServerImpl] Server Config URL: file:/opt/jboss-5.0.0.Beta2/server/default/conf/
            12:51:03,238 INFO [ServerImpl] Server Library URL: file:/opt/jboss-5.0.0.Beta2/server/default/lib/
            12:51:03,238 INFO [ServerImpl] Root Deployment Filename: jboss-service.xml
            12:51:03,262 INFO [ServerImpl] Starting Microcontainer, bootstrapURL=file:/opt/jboss-5.0.0.Beta2/server/default/conf/bootstrap-beans.xml
            12:51:04,007 INFO [ProfileImpl] Using profile root:/opt/jboss-5.0.0.Beta2/server/default
            12:51:05,019 ERROR [AbstractKernelController] Error installing to Instantiated: name=DeploymentFilter state=Described
            java.lang.IllegalStateException: Class not found: [Ljava.lang.String;
             at org.jboss.metadata.spi.signature.Signature.stringsToClasses(Signature.java:174)
             at org.jboss.metadata.spi.signature.Signature.stringsToClasses(Signature.java:125)
             at org.jboss.metadata.spi.signature.Signature.getParametersTypes(Signature.java:292)
             at org.jboss.metadata.plugins.loader.reflection.AnnotatedElementMetaDataLoader.getComponentMetaDataRetrieval(AnnotatedElementMetaDataLoader.java:138)
             at org.jboss.metadata.plugins.context.AbstractMetaDataContext.getComponentMetaDataRetrieval(AbstractMetaDataContext.java:280)
             at org.jboss.metadata.spi.retrieval.MetaDataRetrievalToMetaDataBridge.getComponentMetaData(MetaDataRetrievalToMetaDataBridge.java:159)
             at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.methodHasAnnotations(AOPConstructorJoinpoint.java:202)
             at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.hasMethodMetaData(AOPConstructorJoinpoint.java:172)
             at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.hasInstanceOrJoinpointMetaData(AOPConstructorJoinpoint.java:152)
             at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.dispatch(AOPConstructorJoinpoint.java:99)
             at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:103)
             at org.jboss.kernel.plugins.dependency.InstantiateAction.installActionInternal(InstantiateAction.java:52)
             at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:197)
             at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.install(KernelControllerContextAction.java:136)
             at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
             at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:233)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:724)
             at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:445)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:555)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:489)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:289)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:192)
             at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:302)
             at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:272)
             at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:119)
             at org.jboss.kernel.plugins.deployment.BasicKernelDeployer.deploy(BasicKernelDeployer.java:64)
             at org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer.deploy(BasicXMLDeployer.java:76)
             at org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer.deploy(BasicXMLDeployer.java:146)
             at org.jboss.system.server.profileservice.ProfileServiceBootstrap.deploy(ProfileServiceBootstrap.java:295)
             at org.jboss.system.server.profileservice.ProfileServiceBootstrap.bootstrap(ProfileServiceBootstrap.java:222)
             at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:89)
             at org.jboss.system.server.profileservice.ServerImpl.doStart(ServerImpl.java:403)
             at org.jboss.system.server.profileservice.ServerImpl.start(ServerImpl.java:342)
             at org.jboss.Main.boot(Main.java:210)
             at org.jboss.Main$1.run(Main.java:522)
             at java.lang.Thread.run(Thread.java:619)
            Caused by: java.lang.ClassNotFoundException: [Ljava.lang.String;
             at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
             at java.security.AccessController.doPrivileged(Native Method)
             at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
             at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
             at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
             at org.jboss.metadata.spi.signature.Signature.stringsToClasses(Signature.java:170)
             ... 35 more
            


            • 3. Re: Jboss 5 Beta 2 won't even run with Java 5?
              Timo Roessner Newbie

              Arrggghhh,

              no "edit" button here: Don't get confused with the nicknames, when i wrote the first posting i was under windows and accidentially used some account i had already forgotten about. (damn those cookies..:-)

              • 4. Re: Jboss 5 Beta 2 won't even run with Java 5?
                Timo Roessner Newbie

                Hey ho,

                i accidentally stumbled across a patch for this described here: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=111930

                I just submitted a patch (only one line was changed in the original file), please see here:

                http://jira.jboss.org/jira/browse/JBAS-4491

                I've compiled it and tested on my machine, seems working well. For anyone who has the same problem: You just need to download the Signature.java, compile it (it has no other dependency so can be compiled using your jdk 1.6 anyhow) and get the Signature.class. Then swap the Signature.class file in jboss-embedded-all.jar with the patched class file. That's it. The Signature.class lies in package: org.jboss.metadata.spi.signature .

                This solved the regression problem and now I do not need to install jdk 1.5 just for this. :-)


                Regards,
                Ellen


                Ok, so i downloaded it and tried to compile it via:

                javac Signature.java


                But this gives me a whole bunch of errors like:

                ----------
                30. ERROR in Signature.java (at line 205)
                 public Signature(String... parameters)
                 ^^^^^^^^^^^^^^^^^^^^
                Syntax error, varargs are only available if source level is 5.0
                ----------
                31. ERROR in Signature.java (at line 215)
                 public Signature(Class... parameters)
                 ^^^^^^^^^^^^^^^^^^^
                Syntax error, varargs are only available if source level is 5.0
                ----------
                32. ERROR in Signature.java (at line 226)
                 public Signature(String name, Class... parameters)
                 ^^^^^^^^^^^^^^^^^^^
                Syntax error, varargs are only available if source level is 5.0
                ----------
                33. ERROR in Signature.java (at line 237)
                 public Signature(String name, String... parameters)
                 ^^^^^^^^^^^^^^^^^^^^
                Syntax error, varargs are only available if source level is 5.0
                ----------
                33 problems (33 errors)


                But the java-Version is (from the same console):

                java -version
                java version "1.5.0_13"
                Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05)
                Java HotSpot(TM) Client VM (build 1.5.0_13-b05, mixed mode, sharing)


                What the hack is going wrong here?

                • 5. Re: Jboss 5 Beta 2 won't even run with Java 5?
                  Peter Johnson Master

                  Look at your output again. The output you posted for the supposed 1.5 JDK run shows:

                  JAVA: /usr/lib/jvm/java-6-sun-1.6.0.03/bin/java

                  You are using the 1.6 JDK even though you think you are using 1.5.