1 - Post a link to the instructions you followed to install JBoss as a service.
2 - Describe the steps you went through to install JBoss as a service and show us the exact commands you issues. If you don't have this information available uninstall the current service so you can register it again.
I performed the following steps to install JBoss service:
1) Download and unpack the JavaService utility from http://forge.objectweb.org/projects/javaservice
2) Copy the JavaService.exe file to JBoss bin directory and rename it to JBossService.exe
3) After considerable trial and error, and lots of Googling, I came up with the following install batch to actually install the service
if "%JAVA_HOME%" == "" goto help
if "%JBOSS_HOME%" == "" goto help
net stop JBoss
JBossService -uninstall JBoss
JBossService -install JBoss %JAVA_HOME%\jre\bin\server\jvm.dll -Xms192m -Xmx256m -Djava.class.path=%JAVA_HOME%\lib\tools.jar;%JBOSS_HOME%\bin\run.jar;%JBOSS_HOME%\bin\shutdown.jar;%JBOSS_HOME%\lib\dom4j.jar -start org.jboss.Main -params -c Default -stop org.jboss.Main -method systemExit -out %JBOSS_HOME%\bin\out.log -err %JBOSS_HOME%\bin\err.log -current %JBOSS_HOME%\bin
net start JBoss
echo The environment variables %JAVA_HOME% and %JBOSS_HOME% have to be set,
echo JavaService.exe and this script have to be in %%JBOSS_HOME%%\bin.
echo The Service has NOT been installed
echo JAVA_HOME = %JAVA_HOME%
echo JBOSS_HOME = %JBOSS_HOME%
3) I also verified the values of JAVA_HOME and JBOSS_HOME environment variables, and rebooted just to be sure.
The service runs fine, but the error log contains the previously posted exception.
Here is the link to some instructions that I have tested in the past: -
The main differences I can see are the differences in the classpath and the arguments passed to the main method, if you are starting the default configuration you do not need to specify it is the default.
I have never tried the command with nested environment variables, I have always just entered the full paths. Also once the service is registered the environment variables are irrelevent.
Finally when I have seen people trying to use the JDK installed with another application server I have seen mixed results. I do not have the Sun application server installed at the moment so I can't see if there is anything conflicting within the installation. You should try just installing the JDK on its own.