NoClassDefFoundError: org/apache/catalina/startup/Bootstrap when running tomcat from exe/as service

≡放荡痞女 提交于 2019-12-10 12:43:23

问题


I have been running a Tomcat 6.0.37 server for quite some time via the startup.bat.Now I want to run tomcat as a service that starts automatically when the machine starts up.

I created the service with the bat : service.bat install.This created the service succesfully.When trying to start it however I get the error in the title.I then tried running just the exe(tomcat6.exe).This gave me the exact same error.

I have checked that CATALINA_HOME,JAVA_HOME and JRE_HOME is set correctly.bootstrap.jar does exist in tomcat/bin.Path to the jvm is correct.jvm.dll does exist in jre6/bin/server.

I also found a thread with a different class missing where they said rt.jar was missing from the jre,I checked this and mine exists in jre6/lib/.I really don't have anymore ideas as to what can be wrong.


回答1:


try to update the service by executing (adapt to your path):

  C:\> tomcat6 //US//Tomcat6 --Description="Apache Tomcat Server - http://tomcat.apache.org/ " \
  C:\> --Startup=auto --Classpath=%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\bin\bootstrap.jar

US means: update service.
This should fix the classpath.

All the necessary information are in the official website:
http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html




回答2:


Recommend using one of the "Java as a Windows Service" frameworks as they handle adding JARs to the classpath, etc. This can be done manually however via the "java -cp {set your classpath here...}" options as well.



来源:https://stackoverflow.com/questions/18271481/noclassdeffounderror-org-apache-catalina-startup-bootstrap-when-running-tomcat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!