Tomcat5 windows服务不能启动的终极解决方法.docx

上传人:scccc 文档编号:14030184 上传时间:2022-01-31 格式:DOCX 页数:10 大小:96.26KB
返回 下载 相关 举报
Tomcat5 windows服务不能启动的终极解决方法.docx_第1页
第1页 / 共10页
Tomcat5 windows服务不能启动的终极解决方法.docx_第2页
第2页 / 共10页
Tomcat5 windows服务不能启动的终极解决方法.docx_第3页
第3页 / 共10页
Tomcat5 windows服务不能启动的终极解决方法.docx_第4页
第4页 / 共10页
Tomcat5 windows服务不能启动的终极解决方法.docx_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《Tomcat5 windows服务不能启动的终极解决方法.docx》由会员分享,可在线阅读,更多相关《Tomcat5 windows服务不能启动的终极解决方法.docx(10页珍藏版)》请在三一文库上搜索。

1、本人多次碰到这个问题,在网上搜索很久,一直没有找到真正的解决方法。今天下午一次偶然的机会发现了问题所在,根据问题,提出以下解决方案。问题所在:现在很多人都在使用jdk的压缩版,使得tomcat服务不能正确设置java VM,导致tomcat服务不能正常配置和启动。如果你是安装版jdk也出现启动问题,请参照以下方法解决。假设 jdk 安装目录为 d:j2sdktomcat5 安装目录为 D:Program FilesApache Software FoundationTomcat 5.01. 配置环境变量:JAVA_HOME = d:j2sdkCLASSPATH = %JAVA_HOME%bin

2、;.;%JAVA_HOME%lib;%JAVA_HOME%libdt.jar;%JAVA_HOME%libtools.jarCATALINA_HOME = D:Program FilesApache Software FoundationTomcat 5.02. 配置 Tomcat 服务这里有两种情况,一是tomcat5为安装版,二是解压版,针对这两种情况分别解决。(1)安装版 tomcat5在安装时选择安装tomcat服务,如图安装完成后,打开注册表regedit.exe, 找到HKEY_LOCAL_MACHINESOFTWAREApache Software FoundationTomca

3、t Service ManagerTomcat5Parameters,你可以看到里面有很多参数值,主要是修改Java项的值为 d:j2sdkjrebinserverjvm.dll, 修改正确后,你就可以通过开始-程序-Apache Tomcat 5.0-start tomcat启动服务了。若没有若没有此项,可以依照以下方法设置参数。(2)解压版 tomcat5这时你要先配置服务所用的参数,启动命令是 tomcat5的bin目录下的tomcatw.exe(后面附上tomcatw.exe命令参数)。如果不存在HKEY_LOCAL_MACHINESOFTWAREApache Software Fou

4、ndationTomcat Service ManagerTomcat5Parameters,请先创建,这一步是关键。使用命令 tomcatw.exe /ES/Tomcat5 打开配置窗口,如下 设置参数如下:Service栏 Description = Apache Tomcat 5.0 (这个可以随便写) Image Path = d:Program FilesApache Software FoundationTomcat 5.0binbootstrap.jar Work Path = d:Program FilesApache Software FoundationTomcat 5.0

5、 Auto Start 这个参数允许设置服务为自动启动Java VM栏: Auto 不要打勾 Java VM = D:j2sdkjrebinserverjvm.dll Java Options = -Dcatalina.home=d:Program FilesApache Software FoundationTomcat 5.0-Djava.endorsed.dirs=d:Program FilesApache Software FoundationTomcat 5.0commonendorsed -Xrs Start Class = org/apache/catalina/startup/

6、Bootstrap;main;start Stop Class = org/apache/catalina/startup/Bootstrap;main;stopStandard Streams: 只要设置两项 Output = d:Program FilesApache Software FoundationTomcat 5.0logsstdout.log Error = d:Program FilesApache Software FoundationTomcat 5.0logsstderr.log根据以上设置,接下来可以使用 tomcatw.exe /GT/Tomcat5 启动服务了。若

7、有问题可以给我留言或者加我QQ: 4034348TOMCAT5在WINDOWS下的一些命令行Tomcatw monitor applicationTomcatw is a GUI application for monitoring and configuring Tomcat services.The available command line options are:/ES/Edit service configurationThis is the default operation. It is called if the no option is provided but the e

8、xecutable is renamed to servicenameW.exe/MS/Monitor servicePut the icon in the system tryCommand line argumentsEach command line directive is in the form of /XX/ServiceNameThe available command line options are:/TS/Run the service as console applicationThis is the default operation. It is called if

9、the no option is provided. The ServiceName is the name of the executable without exe sufix, meaning Tomcat5/RS/Run the serviceCalled only from ServiceManager/SS/Stop the service/US/Update service parameters/IS/Install service/DS/Delete serviceStops the service if runningCommand line parametersEach c

10、ommand parameter is prefixed with -. If the command line is prefixed with + then its value will be appended to the existing option. If the environment variable with the same name as command line parameter but prefixed with PR_ exists it will take precedence. For example:set PR_CLASSPATH=xx.jaris equ

11、ivalent to providing-Classpath=xx.jaras command line parameter.ParameterNameDefaultDescription-DescriptionService name description (maximum 1024 characters)-DisplayNameServiceNameService display name-Installprocrun.exe /RS/ServiceNameInstall image-StartupmanualService startup mode can be either auto

12、 or manual-DependsOnList of services that this service depend on. Dependent services are separated using either # or ; characters-EnvironmentList of environment variables that will be provided to the service in the form key=value. They are separated using either # or ; characters-UserUser account us

13、ed for running executable. It is used only for StartMode java or exe and enables running applications as service under account without LogonAsService privilege.-PasswordPassword for user account set by -User parameter-JavaHomeJAVA_HOMESet a different JAVA_HOME then defined by JAVA_HOME environment v

14、ariable-JvmautoUse either auto or specify the full path to the jvm.dll. You can use the environment variable expansion here.-JvmOptions-XrsList of options in the form of -D or -X that will be passed to the JVM. The options are separated using either # or ; characters.-ClasspathSet the Java classpath

15、-JvmMsInitial memory pool size in MB-JvmMxMaximum memory pool size in MB-JvmSsThread stack size in KB-StartImageExecutable that will be run.-StartPathWorking path for the start image executable.-StartClassClass that will be used for startup.-StartParamsList of parameters that will be passed to eithe

16、r StartImage or StartClass. Parameters are separated using either # or ; character.-StartMethodMainMethod name if differs then main-StartModeexecutableCan one of jvm java or exe-StopImageExecutable that will be run on Stop service signal.-StopPathWorking path for the stop image executable.-StopClass

17、Class that will be used on Stop service signal.-StopParamsList of parameters that will be passed to either StopImage or StopClass. Parameters are separated using either # or ; character.-StopMethodMainMethod name if differs then main-StopModeexecutableCan one of jvm java or exe-StopTimeoutNo Timeout

18、Defines the timeout in seconds that procrun waits for service to exit gracefully.-LogPathworking pathDefines the path for logging-LogPrefixjakarta_serviceDefines the service log filename-LogLevelINFODefines the logging level and can be either error, info, warn or debug-StdOutputRedirected stdout fil

19、ename-StdErrorRedirected stderr filenameInstalling servicesThe safest way to manually install the service is to use the provided service.bat script.Install the service named Tomcat5C: service.bat installIf using tomcat.exe, you need to use the /IS/ parameter.Install the service named Tomcat5C: tomca

20、t5 /IS/Tomcat5 -DisplayName=Apache Tomcat 5 C: -Install=C:Program FilesTomcatbintomcat5.exe -Jvm=auto C: -StartMode=jvm -StopMode=jvm C: -StartClass=org.apache.catalina.startup.Bootstrap -StartParams=start C: -StopClass=org.apache.catalina.startup.Bootstrap -StopParams=stopUpdating servicesTo update

21、 the service parameters, you need to use the /US/ parameter.Update the service named Tomcat5C: tomcat /US/Tomcat5 -Description=Apache Tomcat Server - http:/jakarta.apache.org/tomcat C: -Startup=auto -Classpath=%JAVA_HOME%libtools.jar;%CATALINA_HOME%binbootstrap.jarRemoving servicesTo remove the serv

22、ice, you need to use the /DS/ parameter.If the service is running it will be stopped and then deleted.Remove the service named Tomcat5C: tomcat /DS/Tomcat5Debugging servicesTo run the service in console mode, you need to use the /TS/ parameter. The service shutdown can be initiated by pressing CTRL+

23、C or CTRL+BREAK. If you rename the tomcat5.exe to testservice.exe then you can just execute the testservice.exe and this command mode will be executed by default.Run the service named Tomcat5 in console modeC: tomcat /TS/Tomcat5 additional argumentsOr simply execute:C: tomcat安装Tomcat服务的方法a)%CATALINA

24、_HOME%bintomcat.exe -install Tomcat5 %JAVA_HOME%jrebinserverjvm.dll -Djava.class.path=%CATALINA_HOME%binbootstrap.jar;%JAVA_HOME%libtools.jar -Dcatalina.home=%CATALINA_HOME% -Xrs -start org.apache.catalina.startup.Bootstrap -params start -stop org.apache.catalina.startup.Bootstrap -params stop -out %CATALINA_HOME%logsstderr.log b)%CATALINA_HOME%bintomcat.exe -uninstall -Tomcat5

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1