Tomcat 7 getting CreateJavaVM Failed Error

16,259

After spending hours trying to figure this out, I finally found it. I had an extra space at the end of VM command.

 '+HeapDumpOnOutOfMemoryError ' 

which was giving me the Unrecognized VM option.....

Thanks for reading, hopefully when you get this error, you can take extra precautions to verify the syntax.

Share:
16,259

Related videos on Youtube

Myy
Author by

Myy

I'm a Software developer that is barely scratching the surface of the Programing environment. I'm a very nice person and expect the same respect and niceness towards me. I'm mostly posting questions on here, but hopefuly one day I can help more people, just like the people here are helping me out. =)

Updated on October 10, 2022

Comments

  • Myy
    Myy over 1 year

    I have an Apache tomcat 7.0.5 Server on a Windows R2 Server and I've deployed a webApp ( java JSF) on it, everything was working fine, but it suddenly stopped and won't run again. when I try to run it, it tells me "Error 1067: The Process terminated unexpectedly" and In the logs I get these files:

    tomcat7-stdout.2012-08-08.log

    2012-08-08 18:00:06 Commons Daemon procrun stdout initialized
    

    commons-daemon.2012-08-08.log

    [2012-08-08 19:02:30] [info]  Commons Daemon procrun finished
    [2012-08-08 19:13:02] [info]  Commons Daemon procrun (1.0.4.0 64-bit) started
    [2012-08-08 19:13:02] [info]  Running 'Tomcat7' Service...
    [2012-08-08 19:13:02] [info]  Starting service...
    [2012-08-08 19:13:02] [error] CreateJavaVM Failed
    [2012-08-08 19:13:03] [info]  Service started in 1000 ms.
    [2012-08-08 19:13:03] [info]  Run service finished.
    [2012-08-08 19:13:03] [info]  Commons Daemon procrun finished
    

    tomcat7-stderr.2012-08-08.log

    2012-08-08 18:00:06 Commons Daemon procrun stderr initialized
    Please use CMSClassUnloadingEnabled in place of CMSPermGenSweepingEnabled in the future
    Unrecognized VM option '+HeapDumpOnOutOfMemoryError '
    

    since I was having some 'perm gen' memory error I added some stuff to my apache Tomcat properties, folowing this link how to handle Perm Gen

    so my Java Options look like this:

    -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 7.0
    -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 7.0
    -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 7.0\endorsed
    -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 7.0\temp
    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
    -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 7.0\conf\logging.properties
    -XX:+CMSClassUnloadingEnabled
    -XX:+CMSPermGenSweepingEnabled
    -XX:PermSize=256m
    -XX:MaxPermSize=256m
    -XX:+HeapDumpOnOutOfMemoryError 
    

    Any ideas as to why the server won't start anymore? THANKS!

    ~Myy

  • PatrickE
    PatrickE about 2 years
    This answer combined with a tip from another site suggesting running Tomcat from the command prompt instead of as a Windows service just fixed a similar issue for me when we went from Java 11 to 16. The tomcat logs were not showing any clue as to why the Java VM couldn't be created, but running from the cmd prompt threw "Unrecognized VM Option 'AggressiveOpts'. That was the issue.