10 Replies Latest reply on Apr 11, 2011 4:50 AM by Leif Mortenson

    JBoss 5.1 and Java Service Wrapper

    Francesco Sordillo Newbie

      Hello to all.

       

      I installed JBoss EAP 5.1 and I would like to use Jave Service Wrapper (3.5.7). Following this guide all worksfine, but I need to use "method integration 2" with "WrapperStartStopApp" main class.

       

      So, my wrapper.conf looks like this

      ---------

      # Java Classpath (include wrapper.jar)  Add class path elements as

      #  needed starting from 1

      wrapper.java.classpath.1=/usr/share/java/java-service-wrapper.jar

      wrapper.java.classpath.2=%JBOSS_HOME%/bin/run.jar

      wrapper.java.classpath.3=%JBOSS_HOME%/bin/shutdown.jar

      wrapper.java.classpath.4=%JBOSS_HOME%/client/jbossall-client.jar

      wrapper.java.classpath.5=%JBOSS_HOME%/client/getopt.jar

      wrapper.java.classpath.6=%JBOSS_HOME%/lib/tools.jar

      wrapper.java.classpath.7=%JBOSS_HOME%/lib/jboss-jmx.jar

       

      [...]

       

      # Application parameters.  Add parameters as needed starting from 1

      wrapper.app.parameter.1=org.jboss.Main

      wrapper.app.parameter.2=2

      wrapper.app.parameter.3=-c

      wrapper.app.parameter.4=myInstance

      wrapper.app.parameter.5=org.jboss.Shutdown

      wrapper.app.parameter.6=true

      wrapper.app.parameter.7=6

      wrapper.app.parameter.8=-s

      wrapper.app.parameter.9=jnp://<my-ip-address>:1099

      wrapper.app.parameter.10=-u

      wrapper.app.parameter.11=admin

      wrapper.app.parameter.12=-p

      wrapper.app.parameter.13=admin

      ----------

       

      When I start JBoss instance I get this error.

       

      ------------

      STATUS | wrapper  | 2011/04/01 11:06:07 | Launching a JVM...

      INFO   | jvm 1    | 2011/04/01 11:06:07 | WrapperManager: Initializing...

      INFO   | jvm 1    | 2011/04/01 11:06:07 | Exception in thread "main" java.lang.SecurityException: class "org.jboss.Shutdown"'s signer information does not match signer information of other classes in the same package

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at java.lang.ClassLoader.checkCerts(ClassLoader.java:807)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at java.lang.ClassLoader.preDefineClass(ClassLoader.java:488)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at java.lang.ClassLoader.defineClassCond(ClassLoader.java:626)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at java.lang.ClassLoader.defineClass(ClassLoader.java:616)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at java.security.AccessController.doPrivileged(Native Method)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at java.lang.Class.forName0(Native Method)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at java.lang.Class.forName(Class.java:169)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at org.tanukisoftware.wrapper.WrapperStartStopApp.getMainMethod(WrapperStartStopApp.java:629)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at org.tanukisoftware.wrapper.WrapperStartStopApp.<init>(WrapperStartStopApp.java:194)

      INFO   | jvm 1    | 2011/04/01 11:06:07 |       at org.tanukisoftware.wrapper.WrapperStartStopApp.main(WrapperStartStopApp.java:810)

      ERROR  | wrapper  | 2011/04/01 11:06:36 | Startup failed: Timed out waiting for a signal from the JVM.

      ERROR  | wrapper  | 2011/04/01 11:06:36 | JVM did not exit on request, terminated

      -----------

       

      I don't know where the error could be. Is there anyone that can help me or that has tryied JSW with this method?

      Thanks in advance.

       

      Francesco.

        • 1. JBoss 5.1 and Java Service Wrapper
          Peter Johnson Master

          This seems to be something related to the Java security. Have you changes the jre/lib/security/java.policy file?

           

          Also, you are using EAP 5. As far as I know the JARs provided by it are not signed - could it be that someone signed those JARs? The shutdown class is in a different JAR that the startup classes, so perhaps that JAR wasn't signed.

           

          Have you tried starting (and stopping) EAP from the command line?

           

          Also, what OS is this?

          • 2. JBoss 5.1 and Java Service Wrapper
            Leif Mortenson Newbie

            Francesco,

            Two possibilities off the top of my head.

             

            1) Try setting the wrapper.java.command.loglevel=INFO property to see the Java command line generated by the Wrapper.   Depending on the value of wrapper.java.command, the Wrapper may be finding the java binary on the PATH and you may not be running the one you expect.

             

            2) The direct problem is security related.  One difference between running your Java application standalone and with the Wrapper is that the Wrapper's classes will be launching your main method.  Because of this, it is necessary to give the wrapper.jar full privileges when running with a security manager.   Make sure there is something like the following in your policy file:

             

            // Give Wrapper classes full permissions

            grant codeBase "file:../lib/wrapper.jar" {

                    permission java.security.AllPermission;

            };

             

            See the following for more details:

            http://wrapper.tanukisoftware.com/doc/english/security-model.html

             

            Cheers,

            Leif

            • 3. Re: JBoss 5.1 and Java Service Wrapper
              Francesco Sordillo Newbie

              Hi Peter, thanks for your reply.

               

              I didn't changed java.policy file and I'm not usign java security manager...

              The JBoss version that I'm using is EAP 5.1 and I don't think that someone signed those jar because... the server is used just from me.

               

              From command line, without JSW all works fine, without problem.

              This is my server:

              - O.S. RHEL 5.5 (64 bit)

              - Oracle (Sun) JDK 1.6.0.18 (64 bit)

              - JBoss EAP 5.1

               

              Thanks.

              • 4. JBoss 5.1 and Java Service Wrapper
                jaikiran pai Master

                From what I know EAP 5.1 jars are signed by default.

                • 5. Re: JBoss 5.1 and Java Service Wrapper
                  Francesco Sordillo Newbie

                  Hello Leif, thank you for the reply.

                   

                  Following you suggestions I did some tests.

                   

                  Test #1

                  I configured wrapper.java.command.loglevel=INFO to show java properties at startup and this is what I get:

                  ----------------------

                  STATUS | wrapper  | 2011/04/05 10:10:52 | --> Wrapper Started as Daemon

                  STATUS | wrapper  | 2011/04/05 10:10:52 | Java Service Wrapper Community Edition 64-bit 3.5.7

                  STATUS | wrapper  | 2011/04/05 10:10:52 |   Copyright (C) 1999-2010 Tanuki Software, Ltd. All Rights Reserved.

                  STATUS | wrapper  | 2011/04/05 10:10:52 |     http://wrapper.tanukisoftware.com

                  STATUS | wrapper  | 2011/04/05 10:10:52 |

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[0] : /usr/java/jdk1.6.0_18/bin/java

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[1] : -Dfile.encoding=UTF-8

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[2] : -server

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[3] : -XX:MaxPermSize=512m

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[4] : -Dprogram.name=run.sh

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[5] : -Djava.endorsed.dirs=/ugov/jboss/jboss-eap-5.1/jboss-as/lib/endorsed

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[6] : -Dorg.jboss.resolver.warning=true

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[7] : -Dsun.rmi.dgc.client.gcInterval=3600000

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[8] : -Dsun.rmi.dgc.server.gcInterval=3600000

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[9] : -Djava.net.preferIPv4Stack=true

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[10] : -DjvmRoute=jvm_ugov_dsetlab04

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[11] : -Dhostname=dsetlab04

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[12] : -Djboss.port.offset=0

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[13] : -Djboss.bind.address=XXX.XXX.XXX.XXX

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[14] : -Xms512m

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[15] : -Xmx1024m

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[16] : -Djava.library.path=/usr/lib64/java-service-wrapper

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[17] : -classpath

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[18] : /usr/share/java/java-service-wrapper.jar:/ugov/jboss/jboss-eap-5.1/jboss-as/bin/run.jar:/ugov/jboss/jboss-eap-5.1/jboss-as/bin/shutdown.jar:/ugov/jboss/jboss-eap-5.1/jboss-as/client/jbossall-client.jar:/ugov/jboss/jboss-eap-5.1/jboss-as/client/getopt.jar:/ugov/jboss/jboss-eap-5.1/jboss-as/lib/tools.jar:/ugov/jboss/jboss-eap-5.1/jboss-as/lib/jboss-jmx.jar

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[19] : -Dwrapper.key=98Kj4Yq-MQmI7OUt

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[20] : -Dwrapper.port=32000

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[21] : -Dwrapper.jvm.port.min=31000

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[22] : -Dwrapper.jvm.port.max=31999

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[23] : -Dwrapper.disable_console_input=TRUE

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[24] : -Dwrapper.pid=27494

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[25] : -Dwrapper.version=3.5.7

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[26] : -Dwrapper.native_library=wrapper

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[27] : -Dwrapper.service=TRUE

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[28] : -Dwrapper.cpu.timeout=10

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[29] : -Dwrapper.jvmid=1

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[30] : org.tanukisoftware.wrapper.WrapperStartStopApp

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[31] : org.jboss.Main

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[32] : 2

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[33] : -c

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[34] : ugov

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[35] : org.jboss.Shutdown

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[36] : true

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[37] : 6

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[38] : -s

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[39] : jnp://XXX.XXX.XXX.XXX:1099

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[40] : -u

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[41] : <user>

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[42] : -p

                  INFO   | wrapper  | 2011/04/05 10:10:52 | Command[43] : <password>

                  STATUS | wrapper  | 2011/04/05 10:10:52 | Launching a JVM...

                  INFO   | jvm 1    | 2011/04/05 10:10:52 | WrapperManager: Initializing...

                  INFO   | jvm 1    | 2011/04/05 10:10:52 | Exception in thread "main" java.lang.SecurityException: class "org.jboss.Shutdown"'s signer information does not match signer information of other classes in the same package

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at java.lang.ClassLoader.checkCerts(ClassLoader.java:807)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at java.lang.ClassLoader.preDefineClass(ClassLoader.java:488)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at java.lang.ClassLoader.defineClassCond(ClassLoader.java:626)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at java.lang.ClassLoader.defineClass(ClassLoader.java:616)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at java.security.AccessController.doPrivileged(Native Method)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at java.lang.Class.forName0(Native Method)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at java.lang.Class.forName(Class.java:169)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at org.tanukisoftware.wrapper.WrapperStartStopApp.getMainMethod(WrapperStartStopApp.java:629)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at org.tanukisoftware.wrapper.WrapperStartStopApp.<init>(WrapperStartStopApp.java:194)

                  INFO   | jvm 1    | 2011/04/05 10:10:52 |       at org.tanukisoftware.wrapper.WrapperStartStopApp.main(WrapperStartStopApp.java:810)

                  ERROR  | wrapper  | 2011/04/05 10:11:22 | Startup failed: Timed out waiting for a signal from the JVM.

                  ERROR  | wrapper  | 2011/04/05 10:11:22 | JVM did not exit on request, terminated

                  -----------------

                   

                  As you can see, I'm not usign a Security Manger, so.. no changes.

                   

                  Test #2

                  I configured this JSW properties:

                  - wrapper.java.additional.15=-Djava.security.manager

                  - wrapper.java.additional.16=-Djava.security.policy=%JAVA_HOME%/jre/lib/security/java.policy

                  and added this to java.policy

                   

                  -----

                  // Java Service Wrapper permission

                  grant codeBase "file:/usr/share/java/java-service-wrapper.jar" {

                          permission java.security.AllPermission;

                  };

                  ---

                   

                  This is what I get.

                   

                  -----

                  STATUS | wrapper  | 2011/04/05 10:23:21 | --> Wrapper Started as Daemon

                  STATUS | wrapper  | 2011/04/05 10:23:21 | Java Service Wrapper Community Edition 64-bit 3.5.7

                  STATUS | wrapper  | 2011/04/05 10:23:21 |   Copyright (C) 1999-2010 Tanuki Software, Ltd. All Rights Reserved.

                  STATUS | wrapper  | 2011/04/05 10:23:21 |     http://wrapper.tanukisoftware.com

                  STATUS | wrapper  | 2011/04/05 10:23:21 |

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[0] : /usr/java/jdk1.6.0_18/bin/java

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[1] : -Dfile.encoding=UTF-8

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[2] : -server

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[3] : -XX:MaxPermSize=512m

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[4] : -Dprogram.name=run.sh

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[5] : -Djava.endorsed.dirs=/ugov/jboss/jboss-eap-5.1/jboss-as/lib/endorsed

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[6] : -Dorg.jboss.resolver.warning=true

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[7] : -Dsun.rmi.dgc.client.gcInterval=3600000

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[8] : -Dsun.rmi.dgc.server.gcInterval=3600000

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[9] : -Djava.net.preferIPv4Stack=true

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[10] : -DjvmRoute=jvm_ugov_dsetlab04

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[11] : -Dhostname=dsetlab04

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[12] : -Djboss.port.offset=0

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[13] : -Djboss.bind.address=XXX.XXX.XXX.XXX

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[14] : -Djava.security.manager

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[15] : -Djava.security.policy=/usr/java/jdk1.6.0_18/jre/lib/security/java.policy

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[16] : -Xms512m

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[17] : -Xmx1024m

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[18] : -Djava.library.path=/usr/lib64/java-service-wrapper

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[19] : -classpath

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[20] : /usr/share/java/java-service-wrapper.jar:/ugov/jboss/jboss-eap-5.1/jboss-as/bin/run.jar:/ugov/jboss/jboss-eap-5.1/jboss-as/bin/shutdown.jar:/ugov/jboss/jboss-eap-5.1/jboss-as/client/jbossall-client.jar:/ugov/jboss/jboss-eap-5.1/jboss-as/client/getopt.jar:/ugov/jboss/jboss-eap-5.1/jboss-as/lib/tools.jar:/ugov/jboss/jboss-eap-5.1/jboss-as/lib/jboss-jmx.jar

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[21] : -Dwrapper.key=XYJo63bholY7CECJ

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[22] : -Dwrapper.port=32000

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[23] : -Dwrapper.jvm.port.min=31000

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[24] : -Dwrapper.jvm.port.max=31999

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[25] : -Dwrapper.disable_console_input=TRUE

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[26] : -Dwrapper.pid=29543

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[27] : -Dwrapper.version=3.5.7

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[28] : -Dwrapper.native_library=wrapper

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[29] : -Dwrapper.service=TRUE

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[30] : -Dwrapper.cpu.timeout=10

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[31] : -Dwrapper.jvmid=1

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[32] : org.tanukisoftware.wrapper.WrapperStartStopApp

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[33] : org.jboss.Main

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[34] : 2

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[35] : -c

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[36] : ugov

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[37] : org.jboss.Shutdown

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[38] : true

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[39] : 6

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[40] : -s

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[41] : jnp://XXX.XXX.XXX.XXX:1099

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[42] : -u

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[43] : admin

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[44] : -p

                  INFO   | wrapper  | 2011/04/05 10:23:22 | Command[45] : admin

                  STATUS | wrapper  | 2011/04/05 10:23:22 | Launching a JVM...

                  INFO   | jvm 1    | 2011/04/05 10:23:22 | WrapperManager: Initializing...

                  INFO   | jvm 1    | 2011/04/05 10:23:22 | Exception in thread "main" java.lang.SecurityException: class "org.jboss.Shutdown"'s signer information does not match signer information of other classes in the same package

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at java.lang.ClassLoader.checkCerts(ClassLoader.java:807)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at java.lang.ClassLoader.preDefineClass(ClassLoader.java:488)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:626)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at java.lang.ClassLoader.defineClass(ClassLoader.java:616)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at java.security.AccessController.doPrivileged(Native Method)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at java.lang.Class.forName0(Native Method)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at java.lang.Class.forName(Class.java:169)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at org.tanukisoftware.wrapper.WrapperStartStopApp.getMainMethod(WrapperStartStopApp.java:629)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at org.tanukisoftware.wrapper.WrapperStartStopApp.<init>(WrapperStartStopApp.java:194)

                  INFO   | jvm 1    | 2011/04/05 10:23:22 |     at org.tanukisoftware.wrapper.WrapperStartStopApp.main(WrapperStartStopApp.java:810)

                  ERROR  | wrapper  | 2011/04/05 10:23:51 | Startup failed: Timed out waiting for a signal from the JVM.

                  ERROR  | wrapper  | 2011/04/05 10:23:51 | JVM did not exit on request, terminated

                  ----

                   

                  Same error... no changes...

                  If I don't use security manager I don't think that it could be a security related, am I wrong?

                  • 6. JBoss 5.1 and Java Service Wrapper
                    Peter Johnson Master

                    Try adding "-verbose:class" to the JVM options. This option causes the JVM to print out each class loaded and the JAR from where it was loaded. That should tell you where org.jboss.Shutdown was loaded from, which might give a clue as to the problem.

                    • 7. Re: JBoss 5.1 and Java Service Wrapper
                      Francesco Sordillo Newbie

                      Thanks Peter.

                       

                      I did it, log file is attached. As you can see, there are not information about which jar contains org.jboss.Shutdown.

                      But if I grep this class through jboss file system hierarchy....

                       

                      ---------------------------------------------

                      [jboss@dsetlab04 jboss-as]$ grep org.jboss.Shutdown * -R | grep -v log

                      bin/shutdown.sh:    org.jboss.Shutdown "$@"

                      bin/shutdown.bat:set MAIN_CLASS=org.jboss.Shutdown

                      Binary file bin/shutdown.jar matches

                      bin/jboss_init_redhat.sh:JBOSS_CMD_STOP=${JBOSS_CMD_STOP:-"java -classpath $JBOSSCP org.jboss.Shutdown --shutdown"}

                      bin/jboss_init_suse.sh:CMD_STOP="java -classpath $JBOSSCP org.jboss.Shutdown --shutdown"

                      --------------------------------------------

                       

                      bin/shutdown.jar.... which is loaded by wrapper.conf

                       

                      --------------------------------------------

                      wrapper.java.classpath.1=/usr/share/java/java-service-wrapper.jar

                      wrapper.java.classpath.2=%JBOSS_HOME%/bin/run.jar

                      wrapper.java.classpath.3=%JBOSS_HOME%/bin/shutdown.jar

                      wrapper.java.classpath.4=%JBOSS_HOME%/client/jbossall-client.jar

                      wrapper.java.classpath.5=%JBOSS_HOME%/client/getopt.jar

                      wrapper.java.classpath.6=%JBOSS_HOME%/lib/tools.jar

                      wrapper.java.classpath.7=%JBOSS_HOME%/lib/jboss-jmx.jar

                      --------------------------------------------

                       

                      Do you have any other suggestions?

                      • 8. Re: JBoss 5.1 and Java Service Wrapper
                        Leif Mortenson Newbie

                        Francesco,

                        The error is that it is saying that org.jboss.Shutdown was being loaded in a different security context than other classes in the same jar.

                         

                        The Wrapper integration method that you are using, WrapperStartStopApp, is a method that makes it possible to shutdown applications cleanly that normally use a second JVM instance to sthutdown.  It does this by loading in both the startup class and the shutdown class in the same JVM and then calling their respective main methods at the appropriate time.

                         

                        I am wondering if JBoss's security is getting confused by the Shutdown class being loaded in at the same time.

                         

                        As an experiment, could you try changing the following properties and see what you get?

                        ---

                        wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp

                        wrapper.app.parameter.1=org.jboss.Main

                        wrapper.app.parameter.2=2

                        wrapper.app.parameter.3=-c

                        wrapper.app.parameter.4=myInstance

                        ---

                        Then comment out the rest of the wrapper.app.parameter.n properties?

                         

                        On our site, we normally suggest using WrapperSimpleApp with JBoss.

                        http://wrapper.tanukisoftware.com/doc/english/integrate-simple-nix.html

                         

                        I look forward to hearing how it works.

                        Cheers,

                        Leif

                         

                         

                        • 9. Re: JBoss 5.1 and Java Service Wrapper
                          Francesco Sordillo Newbie

                          Hello Leif.

                           

                          Sorry for the delay...

                          With SimpleApp it works fine, but I would like to know what happen if the application doesn't use a "Shutdown hook". I don't know what contains the application, so I don't know if the application registers a "Shutdown hook".

                           

                          "There are some things to be aware of when using this method however.  When the Wrapper shuts down the JVM, there is no direct call to an application requesting that it shutdown cleanly. Rather, the Wrapper will exit the JVM by calling System.exit() from within the JVM. If the application has registered its own Shutdown Hook, it will be invoked, giving the application a chance to shutdown cleanly. If on the other hand, a Shutdown Hook is not registered, then the application will suddenly exit like pressing CTRL-C in the console (command window). Both cases, with and without a Shutdown Hook, provide the exact same behavior as if the application was running without the Wrapper."

                           

                          Suppose the worst case: the application has not registered is "Shutdown hook", then the application exit like pressing CTRL-C. What this means? it may be that some data remain "dirty"? What happens if just before pressing CTRL-C the application is writing data on database?

                           

                          Sorry, maybe my questions are trivials, but I am not a developer.

                          Thanks a lot.

                           

                          Francesco.

                          • 10. Re: JBoss 5.1 and Java Service Wrapper
                            Leif Mortenson Newbie

                            Francesco,

                            When you hit CTRL-C in the console of a Java application that does NOT use a shutdown hook then the JVM will just exit almost immediately.  If you see any shutting down messages after hitting CTRL-C then that work is being done in a Shutdown Hook.  Most servlet containers have a shutdown hook to make sure that all of their web apps shutdown cleanly and complete any outstanding requests.

                             

                            I haven't tested the latest versions, but the versions I have used of JBoss all implement shutdown hooks.

                             

                            Cheers,

                            Leif