8 Replies Latest reply: Nov 3, 2010 2:10 AM by Muralidhar S RSS

    JBOSS 5.1 with -d64 option

    Muralidhar S Newbie

      Hi All,

       

      We have an issue in running JBOSS 5.1 with 64 bit JVM.

       

      1) If I run jboss with -d64 option, I get a java.lang.NoClassDefFoundError

      2) If I run jboss without -d64 option, it works fine.

       

      With -d64:

       

      /export/home/ems/jre/bin/java -d64 -cp /export/home/jboss/bin/run.jar:/export/home/ems/jre/lib/tools.jar org.jboss.Main
      Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/Main
      Could not find the main class: org.jboss.Main.  Program will exit.

      /export/home/ems/jre/bin/java -d64 -cp /export/home/jboss/bin/run.jar:/export/home/ems/jre/lib/tools.jar org.jboss.Main

      Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/Main

      Could not find the main class: org.jboss.Main.  Program will exit.

       

       

      Without -d64:

      /export/home/ems/jre/bin/java  -cp /export/home/jboss/bin/run.jar:/export/home/ems/jre/lib/tools.jar org.jboss.Main

      10:56:13,170 INFO  [ServerImpl] Starting JBoss (Microcontainer)...

      10:56:13,174 INFO  [ServerImpl] Release ID: JBoss [The Oracle] 5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221053)

      10:56:13,176 INFO  [ServerImpl] Bootstrap URL: null

      10:56:13,176 INFO  [ServerImpl] Home Dir: /export/home/jboss

      10:56:13,177 INFO  [ServerImpl] Home URL: file:/export/home/jboss/

      10:56:13,177 INFO  [ServerImpl] Library URL: file:/export/home/jboss/lib/

       

      Java version:

      /export/home/ems/jre/bin/java -d64 -version

      java version "1.6.0_17"

      Java(TM) SE Runtime Environment (build 1.6.0_17-b04)

      Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)

       

      Anything I am missing here?

       

      Regards

      -murali

        • 1. Re: JBOSS 5.1 with -d64 option
          Wolf-Dieter Fink Master

          Do you start jboss without run.sh? It doesn't look like.

          • 2. Re: JBOSS 5.1 with -d64 option
            Peter Johnson Master

            What OS are you running? The -d64 option is for Solairs only, if I recall corrctly, You don't need thast option on Linux - if you have the 64-bit JVM it always runs in 64-bit.

            • 3. Re: JBOSS 5.1 with -d64 option
              Muralidhar S Newbie

              Yes, the OS is Solaris 10 on T5220 machine.

              • 4. Re: JBOSS 5.1 with -d64 option
                Muralidhar S Newbie

                We use run.sh. I used to get the same error there also. For posting, I tried to capture it from command line.

                • 5. Re: JBOSS 5.1 with -d64 option
                  jaikiran pai Master

                  Post the exact changes that you did to your run.sh/run.conf and also post the exact output (including the exception) that you see when you run the run.sh

                  • 6. Re: JBOSS 5.1 with -d64 option
                    Muralidhar S Newbie

                    Changes to run.sh (in bold):


                    ----------------------------------------- 8< ---------------------------------------------

                     

                    # For Cygwin, switch paths to Windows format before running java
                    if $cygwin; then
                        JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"`
                        JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
                        JBOSS_CLASSPATH=`cygpath --path --windows "$JBOSS_CLASSPATH"`
                        JBOSS_ENDORSED_DIRS=`cygpath --path --windows "$JBOSS_ENDORSED_DIRS"`
                    fi
                    JAVA_OPTS="-d64 $JAVA_OPTS"
                    # Display our environment
                    echo "========================================================================="
                    echo ""
                    echo "  JBoss Bootstrap Environment"
                    echo ""
                    echo "  JBOSS_HOME: $JBOSS_HOME"
                    echo ""
                    echo "  JAVA: $JAVA"
                    echo ""
                    echo "  JAVA_OPTS: $JAVA_OPTS"
                    echo ""
                    echo "  CLASSPATH: $JBOSS_CLASSPATH"
                    echo ""
                    echo "========================================================================="
                    echo ""
                    while true; do
                       if [ "x$LAUNCH_JBOSS_IN_BACKGROUND" = "x" ]; then
                          # Execute the JVM in the foreground
                          exec "$JAVA" $JAVA_OPTS \
                             -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
                             -classpath "$JBOSS_CLASSPATH" \
                             org.jboss.Main "$@"
                          JBOSS_STATUS=$?
                       else
                          # Execute the JVM in the background
                          exec "$JAVA" $JAVA_OPTS \
                             -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
                             -classpath "$JBOSS_CLASSPATH" \
                             org.jboss.Main "$@" &
                          JBOSS_PID=$!

                    # For Cygwin, switch paths to Windows format before running java

                    if $cygwin; then

                        JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"`

                        JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`

                        JBOSS_CLASSPATH=`cygpath --path --windows "$JBOSS_CLASSPATH"`

                        JBOSS_ENDORSED_DIRS=`cygpath --path --windows "$JBOSS_ENDORSED_DIRS"`

                    fi

                     

                    JAVA_OPTS="-d64 $JAVA_OPTS"

                     

                    # Display our environment

                    echo "========================================================================="

                    echo ""

                    echo "  JBoss Bootstrap Environment"

                    echo ""

                    echo "  JBOSS_HOME: $JBOSS_HOME"

                    echo ""

                    echo "  JAVA: $JAVA"

                    echo ""

                    echo "  JAVA_OPTS: $JAVA_OPTS"

                    echo ""

                    echo "  CLASSPATH: $JBOSS_CLASSPATH"

                    echo ""

                    echo "========================================================================="

                    echo ""

                     

                    while true; do

                       if [ "x$LAUNCH_JBOSS_IN_BACKGROUND" = "x" ]; then

                          # Execute the JVM in the foreground

                          exec "$JAVA" $JAVA_OPTS \

                             -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \

                             -classpath "$JBOSS_CLASSPATH" \

                             org.jboss.Main "$@"

                          JBOSS_STATUS=$?

                       else

                          # Execute the JVM in the background

                          exec "$JAVA" $JAVA_OPTS \

                             -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \

                             -classpath "$JBOSS_CLASSPATH" \

                             org.jboss.Main "$@" &

                          JBOSS_PID=$!

                          # Trap common signals and relay them to the jboss process

                          trap "kill -HUP  $JBOSS_PID" HUP

                     

                    ----------------------------------------- >8 ---------------------------------------------

                     

                    Output while running:

                     

                    =========================================================================

                     

                      JBoss Bootstrap Environment

                     

                      JBOSS_HOME: /export/home/jboss

                     

                      JAVA: /export/home/ems/jre/bin/java

                     

                      JAVA_OPTS: -d64 -Dprogram.name=run.sh  -server -Xms3072m -Xmx3072m  -XX:+UseParallelOldGC -XX:ParallelGCThreads=8 -XX:PermSize=96m -XX:MaxPermSize=352m -Djava.security.manager -Djava.security.policy==/export/home/jboss/server/insight/conf/server.policy -DinstallRoot=/export/home/ems -Dprod.prodems.dir=/export/home/ems/weblogic/prodEms -DsystemFile=/export/home/ems/weblogic/prodEms/data/sys/Insight.init -DsystemConfigFile=/export/home/ems/weblogic/prodEms/data/sys/SystemConfig.txt -Dprod.configFile.dir=/export/home/ems/weblogic/prodEms/data/sys -Djava.io.tmpdir=/export/home/jboss/server/insight/tmp -Dprod.jboss.home.dir=/export/home/jboss -Dprod.jboss.server.home.dir=/export/home/jboss/server/insight -Dorg.jboss.logging.Log4jService.catchSystemOut=false -Dorg.jboss.logging.Log4jService.catchSystemErr=false -Dsun.rmi.dgc.server.gcInterval=1800000 -Dsun.rmi.dgc.client.gcInterval=1800000 -Dinsight.haMode=standalone -Dinsight.logicalIp= -Dinsight.drMode=standalone -Dinsight.drAddr= -Dinsight.host=85042b82 -Dprod.config.servername.key=localhost -Dprod.system.oracleBase=/export/home/oracle -Dprod.system.databaseSID=SIDB -Dremoting.bind_by_host=false -Djava.rmi.server.hostname=10.54.16.13 -Djboss.vfs.forceVfsJar=true

                     

                      CLASSPATH: /export/home/jboss/bin/run.jar:/export/home/ems/jre/lib/tools.jar

                     

                    =========================================================================

                     

                    Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/Main

                    Could not find the main class: org.jboss.Main.  Program will exit.

                    2010-11-02 09:24:56 EDT

                    • 7. Re: JBOSS 5.1 with -d64 option
                      Peter Johnson Master

                      org.jboss.Main is in run.jar, which is in the classpath.You might have to get a Solaris expert to look at this, my gut feeling is that it is somehow related to security: the 64-bit JVM is either being loaded uder a different account, or whetever account it is using doesn't have access to the run.jar file.

                       

                      Some things you can try. Set the _JAVA_LOADER_DEBUG env var, it will print out extra information as the JVM gets loaded. Also try setting -verbose:class, that will tell you which classes are being loaded and from where.

                       

                      Anyway, this is really a Java on Solaris issue, not a JBoss AS issue.

                      • 8. Re: JBOSS 5.1 with -d64 option
                        Muralidhar S Newbie

                        It works now. I was mixing the 64 bit jvm component from jre6u22 with jre6u17. After installing jre 64 bit component from jre6u17, it is working fine now.