8 Replies Latest reply on Feb 4, 2008 10:28 AM by javidjamae

    Can't start JBoss 5 Beta3 with a JRE

    javidjamae

      From what I understand JBoss 5 is supposed to be able to start with just a JRE and uses the Eclipse JDT library to do all its dynamic JSP compiling. However, when I try to start the default configuration on Windows using run.bat, or run.sh from Cygwin, I get the following error:

      $ ./run.sh
      =========================================================================
      
       JBoss Bootstrap Environment
      
       JBOSS_HOME: c:\jbia-src\binaries\jboss-5.0.0.Beta3
      
       JAVA: /cygdrive/c/jre1.5.0_07/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.gcI
      nterval=3600000
      
       CLASSPATH: c:\jbia-src\binaries\jboss-5.0.0.Beta3\bin\run.jar
      
      =========================================================================
      
      Error: no `server' JVM at `c:\jre1.5.0_07\bin\server\jvm.dll'.
      


      From this JIRA issue (http://jira.jboss.org/jira/browse/JBAS-4161), it seems like there should be no complaints when trying to start with a JRE since JBoss 5 Beta 2.

      When you comment out the following lines (putting rem in front of the second and third lines) in the run.bat script, the server starts:

      rem Add -server to the JVM options, if supported
      "%JAVA%" -version 2>&1 | findstr /I hotspot > nul
      if not errorlevel == 1 (set JAVA_OPTS=%JAVA_OPTS% -server)
      


      I'm guessing that this is a bug in the script?

        • 1. Re: Can't start JBoss 5 Beta3 with a JRE
          dimitris

          Have you confused the scripts? The comment you are making is about run.bat (to be used under a windows terminal), but your output shows a run.sh (under cygwin) ???

          • 2. Re: Can't start JBoss 5 Beta3 with a JRE
            javidjamae

            No.. neither run.bat nor run.sh works from cygwin or from a command prompt..

            • 3. Re: Can't start JBoss 5 Beta3 with a JRE
              jaikiran

              Seems to be working fine with JBoss-4.2.x, the server boots fine. (i havent tried with JBoss 5):

              ===============================================================================
              
               JBoss Bootstrap Environment
              
               JBOSS_HOME: D:\JBoss-4.2.2\jboss-4.2.2.GA
              
               JAVA: c:\jdk1.5.0_07\jre\bin\java
              
               JAVA_OPTS: -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
              
               CLASSPATH: D:\JBoss-4.2.2\jboss-4.2.2.GA\bin\run.jar
              
              ===============================================================================
              
              14:48:42,698 INFO [Server] Starting JBoss (MX MicroKernel)...
              14:48:42,698 INFO [Server] Release ID: JBoss [Trinity] 4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)
              14:48:42,698 INFO [Server] Home Dir: D:\JBoss-4.2.2\jboss-4.2.2.GA
              14:48:42,698 INFO [Server] Home URL: file:/D:/JBoss-4.2.2/jboss-4.2.2.GA/
              14:48:42,698 INFO [Server] Patch URL: null
              14:48:42,698 INFO [Server] Server Name: jaikiran
              14:48:42,698 INFO [Server] Server Home Dir: D:\JBoss-4.2.2\jboss-4.2.2.GA\server\jaikiran
              14:48:42,698 INFO [Server] Server Home URL: file:/D:/JBoss-4.2.2/jboss-4.2.2.GA/server/jaikiran/
              14:48:42,698 INFO [Server] Server Log Dir: D:\JBoss-4.2.2\jboss-4.2.2.GA\server\jaikiran\log
              14:48:42,698 INFO [Server] Server Temp Dir: D:\JBoss-4.2.2\jboss-4.2.2.GA\server\jaikiran\tmp
              14:48:42,698 INFO [Server] Root Deployment Filename: jboss-service.xml
              14:48:43,120 INFO [ServerInfo] Java version: 1.5.0_07,Sun Microsystems Inc.
              14:48:43,120 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_07-b03,Sun Microsystems Inc.
              14:48:43,120 INFO [ServerInfo] OS-System: Windows 2003 5.2,x86
              14:48:43,885 INFO [Server] Core system initialized
              
              


              From the command prompt, run the following command and post the output here:

              java -version


              Also, do you have a folder named 'server' under /cygdrive/c/jre1.5.0_07/bin folder?


              • 4. Re: Can't start JBoss 5 Beta3 with a JRE
                jaikiran

                Tried with JBoss-5.0 Beta3. Worked fine:

                D:\jboss-5.0.0.Beta3\bin>run -b 0.0.0.0
                ===============================================================================
                
                 JBoss Bootstrap Environment
                
                 JBOSS_HOME: D:\jboss-5.0.0.Beta3
                
                 JAVA: c:\jdk1.5.0_07\jre\bin\java
                
                 JAVA_OPTS: -Dprogram.name=run.bat -server -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
                
                 CLASSPATH: D:\jboss-5.0.0.Beta3\bin\run.jar
                
                ===============================================================================
                
                15:20:30,215 INFO [ServerImpl] Starting JBoss (Microcontainer)...
                15:20:30,215 INFO [ServerImpl] Release ID: JBoss [Morpheus] 5.0.0.Beta3 (build: SVNTag=JBoss_5_0_0_Beta3 date=200712210026)
                15:20:30,215 INFO [ServerImpl] Home Dir: D:\jboss-5.0.0.Beta3
                15:20:30,215 INFO [ServerImpl] Home URL: file:/D:/jboss-5.0.0.Beta3/
                15:20:30,215 INFO [ServerImpl] Library URL: file:/D:/jboss-5.0.0.Beta3/lib/
                15:20:30,215 INFO [ServerImpl] Patch URL: null
                15:20:30,215 INFO [ServerImpl] Server Name: default
                15:20:30,215 INFO [ServerImpl] Server Home Dir: D:\jboss-5.0.0.Beta3\server\default
                15:20:30,215 INFO [ServerImpl] Server Home URL: file:/D:/jboss-5.0.0.Beta3/server/default/
                15:20:30,215 INFO [ServerImpl] Server Data Dir: D:\jboss-5.0.0.Beta3\server\default\data
                15:20:30,215 INFO [ServerImpl] Server Temp Dir: D:\jboss-5.0.0.Beta3\server\default\tmp
                15:20:30,215 INFO [ServerImpl] Server Config URL: file:/D:/jboss-5.0.0.Beta3/server/default/conf/
                15:20:30,215 INFO [ServerImpl] Server Library URL: file:/D:/jboss-5.0.0.Beta3/server/default/lib/
                15:20:30,215 INFO [ServerImpl] Root Deployment Filename: jboss-service.xml
                15:20:30,872 INFO [ServerImpl] Starting Microcontainer, bootstrapURL=file:/D:/jboss-5.0.0.Beta3/server/default/conf/bootstrap-beans.xml
                15:20:32,544 INFO [ProfileImpl] Using profile root:D:\jboss-5.0.0.Beta3\server\default
                15:20:33,309 INFO [ServerInfo] Java version: 1.5.0_07,Sun Microsystems Inc.
                15:20:33,325 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 1.5.0_07-b03,Sun Microsystems Inc.
                15:20:33,325 INFO [ServerInfo] OS-System: Windows 2003 5.2,x86
                15:20:33,450 INFO [JMXKernel] Legacy JMX core initialized


                And here's the output of JAVA_HOME and java -version:
                D:\>echo %JAVA_HOME%
                c:\jdk1.5.0_07\jre
                
                D:\>%JAVA_HOME%\bin\java -version
                java version "1.5.0_07"
                Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
                Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing)






                • 5. Re: Can't start JBoss 5 Beta3 with a JRE
                  jaikiran

                  Hmmm... I am now able to reproduce this with both JBoss-4.2.2 and JBoss-5.0 Beta3. I have many installations of Java on my system. Most of them are the *JDK installations which also have a JRE*. This is how the folder structure of such installations look like:

                  C:
                  |
                  |--- jdk1.5.0_07
                  | |
                  | |--- bin
                  | | |
                  | | |---- <all other files>
                  | |
                  | |
                  | |--- jre
                  | | |
                  | | |--- bin
                  | | | |
                  | | | |--- client
                  | | | | |--- jvm.dll
                  | | | |
                  | | | |--- server
                  | | | | |
                  | | | | |--- jvm.dll
                  
                  
                  


                  Setting JAVA_HOME to c:\jdk1.5.0_07\jre and running JBoss works fine. The %JAVA_HOME% and java -version output is:

                  C:\>echo %JAVA_HOME%
                  c:\jdk1.5.0_07\jre
                  
                  C:\>%JAVA_HOME%\bin\java -version
                  java version "1.5.0_07"
                  Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
                  Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing)
                  
                  
                  


                  Then i also have installations which are *pure JRE installations* (most of the times installed through Windows Updates, but sometimes even manual installations) whose folder structure looks like:

                  C:
                  |
                  |--- jre1.5.0_14
                  | |
                  | |--- bin
                  | | |
                  | | |--- client
                  | | | |
                  | | | |--- jvm.dll
                  
                  
                  

                  No "server" under bin here.

                  Setting JAVA_HOME to c:\jre1.5.0_14 and running JBoss fails with an error (both in 4.2.2 and 5.0). The %JAVA_HOME% and java -version output is:


                  C:\>echo %JAVA_HOME%
                  c:\jre1.5.0_14
                  
                  C:\>%JAVA_HOME%\bin\java -version
                  java version "1.5.0_14"
                  Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
                  Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode, sharing)
                  


                  When i start JBoss, i get the same error as you:

                  D:\jboss-5.0.0.Beta3\bin>run -b 0.0.0.0
                  ===============================================================================
                  
                   JBoss Bootstrap Environment
                  
                   JBOSS_HOME: D:\jboss-5.0.0.Beta3
                  
                   JAVA: c:\jre1.5.0_14\bin\java
                  
                   JAVA_OPTS: -Dprogram.name=run.bat -server -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
                  
                   CLASSPATH: D:\jboss-5.0.0.Beta3\bin\run.jar
                  
                  ===============================================================================
                  
                  Error: no `server' JVM at `c:\jre1.5.0_14\bin\server\jvm.dll'.
                  Press any key to continue . . .
                  
                  


                  The run.bat/run.sh script relies on the string "hotspot" in the java -version output to pass the -server option to the java command while booting JBoss. Looks like this may not always be true.






                  • 6. Re: Can't start JBoss 5 Beta3 with a JRE
                    jaikiran

                    Maybe the run.bat/run.sh script could be changed from:


                    rem Add -server to the JVM options, if supported
                    "%JAVA%" -version 2>&1 | findstr /I hotspot > nul
                    if not errorlevel == 1 (set JAVA_OPTS=%JAVA_OPTS% -server)


                    to

                    rem Add -server to the JVM options, if supported
                    "%JAVA%" -server -version 2>&1 | findstr /I hotspot > nul
                    if not errorlevel == 1 (set JAVA_OPTS=%JAVA_OPTS% -server)


                    After changing this script, JBoss starts fine without problems. Here's the output of java -server -version for various possible combinations:

                    1) For those who have set JAVA_HOME to the JRE installation inside the JDK ( "server" is supported )

                    C:\>set JAVA_HOME=c:\jdk1.5.0_07\jre
                    
                    C:\>echo %JAVA_HOME%
                    c:\jdk1.5.0_07\jre
                    
                    C:\>%JAVA_HOME%\bin\java -server -version
                    java version "1.5.0_07"
                    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
                    Java HotSpot(TM) Server VM (build 1.5.0_07-b03, mixed mode)



                    2) For those who have set JAVA_HOME to a pure JRE installation ("server" not supported)

                    C:\>set JAVA_HOME=c:\jre1.5.0_14
                    
                    C:\>echo %JAVA_HOME%
                    c:\jre1.5.0_14
                    
                    C:\>%JAVA_HOME%\bin\java -server -version
                    Error: no `server' JVM at `c:\jre1.5.0_14\bin\server\jvm.dll'.
                    

                    The run.bat/run.sh will not set the -server option when this error occurs and moves ahead with starting JBoss.

                    3) For those who have set JAVA_HOME to a JDK installation ("server" is supported)

                    C:\>set JAVA_HOME=c:\jdk1.5.0_07
                    
                    C:\>echo %JAVA_HOME%
                    c:\jdk1.5.0_07
                    
                    C:\>%JAVA_HOME%\bin\java -server -version
                    java version "1.5.0_07"
                    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
                    Java HotSpot(TM) Server VM (build 1.5.0_07-b03, mixed mode)


                    Tested this change (just a possible option) in run.bat/run.sh with Sun JDK/JRE and JBoss starts up fine. Not tested with other JDKs/JREs.

                    • 7. Re: Can't start JBoss 5 Beta3 with a JRE
                      javidjamae

                      Yes, that's exactly the problem, if its a pure JRE installation, it doesn't have the server directory. Do we need to open up a JIRA issue for this?

                      • 8. Re: Can't start JBoss 5 Beta3 with a JRE
                        javidjamae