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