3 Replies Latest reply on Oct 21, 2008 4:57 AM by robert.geisler

    boot JBoss from Java

    robert.geisler

       

      "Peter" wrote:
      Hello Guys
      I have a problem with the JBoss startup. I wrote an application in Java to start the JBoss Server but it doesn't work. :-( (The server starts without problems if I execute the run.bat file.)

      Thats my source:

      Main jbossMain = new Main();
      try {
       jbossMain.boot(new String[] {});
      }catch (Exception e) {
       e.printStackTrace();
      }


      If I execute this I got the following error:

      java.lang.SecurityException: class "org.jboss.system.server.NoAnnotationURLClassLoader"'s signer information does not match signer information of other classes in the same package
       at java.lang.ClassLoader.checkCerts(Unknown Source)
       at java.lang.ClassLoader.preDefineClass(Unknown Source)
       at java.lang.ClassLoader.defineClass(Unknown Source)
       at java.security.SecureClassLoader.defineClass(Unknown Source)
       at java.net.URLClassLoader.defineClass(Unknown Source)
       at java.net.URLClassLoader.access$000(Unknown Source)
       at java.net.URLClassLoader$1.run(Unknown Source)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at java.lang.ClassLoader.loadClassInternal(Unknown Source)
       at org.jboss.Main.boot(Main.java:134)


      Do you know what the solution for my problem is or do you know an other pattern to start the Server from a Java application? But I don't want to start it with
      Runtime.getRuntime().exec()


      With kind regards
      Peter


        • 1. Re: boot JBoss from Java
          robert.geisler

          -push-

          • 2. Re: boot JBoss from Java
            jaikiran

            I don't think anyone understood what the question was :-)

            Are you trying to start JBoss from a Java program? If yes, then have a look at the run.bat file which sets up the Classpath to be used while calling the org.jboss.Main:

            "%JAVA%" %JAVA_OPTS% ^
             -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" ^
             -classpath "%JBOSS_CLASSPATH%" ^
             org.jboss.Main %*
            


            I haven't tried it myself so don't know what issues you might run into. Try it out and if you have any specific errors/questions, do post here.


            • 3. Re: boot JBoss from Java
              robert.geisler

              hi, jaikiran,

              thank you for your reply. we tried it the way you suggested it and it turned out to be just a classpath issue.
              nevertheless we stepped back from starting JBoss from Java and now we are using run.bat again. thanks anyway.

              regards
              robert