XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 6.0.0.M1
    • None
    • Compatibility/Configuration
    • Low
    • Workaround Exists
    • Hide

      Edit service.bat in the bin directory as follows:
      ...
      REM Suppress killing service on logoff event

      set JAVA_OPTS=-Xrs

      rem # I added this:

      rem # JVM memory allocation pool parameters - modify as appropriate.

      set "JAVA_OPTS=%JAVA_OPTS% -Xms128M -Xmx512M -XX:MaxPermSize=256M"

      rem # Reduce the RMI GCs to once per hour for Sun JVMs.

      set "JAVA_OPTS=%JAVA_OPTS% -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"

      rem # Warn when resolving remote XML DTDs or schemas.

      set "JAVA_OPTS=%JAVA_OPTS% -Dorg.jboss.resolver.warning=true"

      rem # this option entered by me

      set "JAVA_OPTS=%JAVA_OPTS% -Djboss.bind.address=<MY SERVER IP/URL>"

      echo Options provided by me were set

      rem # End of my addition to this file

      Show
      Edit service.bat in the bin directory as follows: ... REM Suppress killing service on logoff event set JAVA_OPTS=-Xrs rem # I added this: rem # JVM memory allocation pool parameters - modify as appropriate. set "JAVA_OPTS=%JAVA_OPTS% -Xms128M -Xmx512M -XX:MaxPermSize=256M" rem # Reduce the RMI GCs to once per hour for Sun JVMs. set "JAVA_OPTS=%JAVA_OPTS% -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000" rem # Warn when resolving remote XML DTDs or schemas. set "JAVA_OPTS=%JAVA_OPTS% -Dorg.jboss.resolver.warning=true" rem # this option entered by me set "JAVA_OPTS=%JAVA_OPTS% -Djboss.bind.address=<MY SERVER IP/URL>" echo Options provided by me were set rem # End of my addition to this file

      Most of %JAVA_OPTS% are skipped when AS is invoked through the windows service interface .
      See:
      Starting JBoss Application Server 5.1 [2009-12-16 11:54:13]
      ===============================================================================
      JBoss Bootstrap Environment
      JBOSS_HOME: C:\jboss-6.0.0.M1
      JAVA: C:\java\SDK\jdk\bin\java
      JAVA_OPTS: -Dprogram.name=run.bat -Xrs -server
      CLASSPATH: C:\java\SDK\jdk\lib\tools.jar;C:\jboss-6.0.0.M1\bin\run.jar
      ===============================================================================
      11:54:14,352 INFO [AbstractJBossASServerBase] Server Configuration:
      JBOSS_HOME URL: file:/C:/jboss-6.0.0.M1/
      Bootstrap: $JBOSS_HOME\server/all/conf/bootstrap.xml
      Common Base: $JBOSS_HOME\common/
      Common Library: $JBOSS_HOME\common/lib/
      Server Name: all
      Server Base: $JBOSS_HOME\server/
      Server Library: $JBOSS_HOME\server/all/lib/
      Server Config: $JBOSS_HOME\server/all/conf/
      Server Home: $JBOSS_HOME\server/all/
      Server Data: $JBOSS_HOME\server/all/data/
      Server Log: $JBOSS_HOME\server/all/log/
      Server Temp: $JBOSS_HOME\server/all/tmp/

      Then somewhere during my JBoss boot up I get this error:
      Unexpected error during load of:javax.faces.application.Application
      java.lang.OutOfMemoryError: PermGen space
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
      at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:64)
      at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:577)
      at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:537)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:535)
      at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:512)
      at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:134)
      at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131)
      at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:455)
      at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:267)
      at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:166)
      at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:265)
      at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1124)
      at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:805)
      at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:445)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
      at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:64)
      at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:577)
      at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:537)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:535)
      at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:512)
      at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:134)
      at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131)
      at org.jboss.classloader.spi.base.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:455)
      at org.jboss.classloader.spi.base.ClassLoaderManager.nextTask(ClassLoaderManager.java:267)
      at org.jboss.classloader.spi.base.ClassLoaderManager.process(ClassLoaderManager.java:166)

      Now since the stack trace says that the JVM is out of memory, and considering the memory parameters were not set.
      I edited the service.bat to include the JAVA_OPTS parameters otherwise set in run.conf.bat (which were skipped otherwise.)
      After that the service ran fine!

      This service should be run easily out of the box by default, when everything is enabled i.e. with server configuration "all".

      Also, is there an easy to set the "-c all -b <my server url>" when running JBossAS as a windows service?
      Thanks in advance,
      // Ali

              Unassigned Unassigned
              alihamza7 Ali Aga (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: