tomcat5 windows服务不能启动的终极解决方法docx.docx
- 文档编号:3186080
- 上传时间:2023-05-05
- 格式:DOCX
- 页数:12
- 大小:71.69KB
tomcat5 windows服务不能启动的终极解决方法docx.docx
《tomcat5 windows服务不能启动的终极解决方法docx.docx》由会员分享,可在线阅读,更多相关《tomcat5 windows服务不能启动的终极解决方法docx.docx(12页珍藏版)》请在冰点文库上搜索。
tomcat5windows服务不能启动的终极解决方法docx
本人多次碰到这个问题,在网上搜索很久,一直没有找到真正的解决方法。
今天下午一次偶然的机会发现了问题所在,根据问题,提出以下解决方案。
问题所在:
现在很多人都在使用jdk的压缩版,使得tomcat服务不能正确设置javaVM,导致tomcat服务不能正常配置和启动。
如果你是安装版jdk也出现启动问题,请参照以下方法解决。
假设
jdk安装目录为d:
\j2sdk
tomcat5安装目录为D:
\ProgramFiles\ApacheSoftwareFoundation\Tomcat5.0
1.配置环境变量:
JAVA_HOME=d:
\j2sdk
CLASSPATH=%JAVA_HOME%\bin;.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
CATALINA_HOME=D:
\ProgramFiles\ApacheSoftwareFoundation\Tomcat5.0
2.配置Tomcat服务
这里有两种情况,一是tomcat5为安装版,二是解压版,针对这两种情况分别解决。
(1)安装版tomcat5
在安装时选择安装tomcat服务,如图
安装完成后,打开注册表regedit.exe,找到HKEY_LOCAL_MACHINE\SOFTWARE\ApacheSoftwareFoundation\TomcatServiceManager\Tomcat5\Parameters,你可以看到里面有很多参数值,主要是修改Java项的值为d:
\j2sdk\jre\bin\server\jvm.dll,修改正确后,你就可以通过开始->程序->ApacheTomcat5.0->starttomcat启动服务了。
若没有若没有此项,可以依照以下方法设置参数。
(2)解压版tomcat5
这时你要先配置服务所用的参数,启动命令是tomcat5的bin目录下的tomcatw.exe(后面附上tomcatw.exe命令参数)。
如果不存在HKEY_LOCAL_MACHINE\SOFTWARE\ApacheSoftwareFoundation\TomcatServiceManager\Tomcat5\Parameters,请先创建,这一步是关键。
使用命令tomcatw.exe//ES//Tomcat5打开配置窗口,如下
设置参数如下:
Service栏
Description=ApacheTomcat5.0(这个可以随便写)
ImagePath=d:
\ProgramFiles\ApacheSoftwareFoundation\Tomcat5.0\bin\bootstrap.jar
WorkPath=d:
\ProgramFiles\ApacheSoftwareFoundation\Tomcat5.0
AutoStart这个参数允许设置服务为自动启动
JavaVM栏:
Auto不要打勾
JavaVM=D:
\j2sdk\jre\bin\server\jvm.dll
JavaOptions=-Dcatalina.home="d:
\ProgramFiles\ApacheSoftwareFoundation\Tomcat5.0"
-Djava.endorsed.dirs="d:
\ProgramFiles\ApacheSoftwareFoundation\Tomcat5.0\common\endorsed"-Xrs
StartClass=org/apache/catalina/startup/Bootstrap;main;start
StopClass=org/apache/catalina/startup/Bootstrap;main;stop
StandardStreams:
只要设置两项
Output=d:
\ProgramFiles\ApacheSoftwareFoundation\Tomcat5.0\logs\stdout.log
Error=d:
\ProgramFiles\ApacheSoftwareFoundation\Tomcat5.0\logs\stderr.log
根据以上设置,接下来可以使用tomcatw.exe//GT//Tomcat5启动服务了。
若有问题可以给我留言或者加我QQ:
4034348
TOMCAT5在WINDOWS下的一些命令行
Tomcatwmonitorapplication
TomcatwisaGUIapplicationformonitoringandconfiguringTomcatservices.
Theavailablecommandlineoptionsare:
//ES//
Editserviceconfiguration
Thisisthedefaultoperation.ItiscalledifthenooptionisprovidedbuttheexecutableisrenamedtoservicenameW.exe
//MS//
Monitorservice
Puttheiconinthesystemtry
Commandlinearguments
Eachcommandlinedirectiveisintheformof//XX//ServiceName
Theavailablecommandlineoptionsare:
//TS//
Runtheserviceasconsoleapplication
Thisisthedefaultoperation.Itiscalledifthenooptionisprovided.TheServiceNameisthenameoftheexecutablewithoutexesufix,meaningTomcat5
//RS//
Runtheservice
CalledonlyfromServiceManager
//SS//
Stoptheservice
//US//
Updateserviceparameters
//IS//
Installservice
//DS//
Deleteservice
Stopstheserviceifrunning
Commandlineparameters
Eachcommandparameterisprefixedwith--.Ifthecommandlineisprefixedwith++thenit'svaluewillbeappendedtotheexistingoption.IftheenvironmentvariablewiththesamenameascommandlineparameterbutprefixedwithPR_existsitwilltakeprecedence.Forexample:
setPR_CLASSPATH=xx.jar
isequivalenttoproviding
--Classpath=xx.jar
ascommandlineparameter.
ParameterName
Default
Description
--Description
Servicenamedescription(maximum1024characters)
--DisplayName
ServiceName
Servicedisplayname
--Install
procrun.exe//RS//ServiceName
Installimage
--Startup
manual
Servicestartupmodecanbeeitherautoormanual
--DependsOn
Listofservicesthatthisservicedependon.Dependentservicesareseparatedusingeither#or;characters
--Environment
Listofenvironmentvariablesthatwillbeprovidedtotheserviceintheformkey=value.Theyareseparatedusingeither#or;characters
--User
Useraccountusedforrunningexecutable.ItisusedonlyforStartModejavaorexeandenablesrunningapplicationsasserviceunderaccountwithoutLogonAsServiceprivilege.
--Password
Passwordforuseraccountsetby--Userparameter
--JavaHome
JAVA_HOME
SetadifferentJAVA_HOMEthendefinedbyJAVA_HOMEenvironmentvariable
--Jvm
auto
Useeitherautoorspecifythefullpathtothejvm.dll.Youcanusetheenvironmentvariableexpansionhere.
--JvmOptions
-Xrs
Listofoptionsintheformof-Dor-XthatwillbepassedtotheJVM.Theoptionsareseparatedusingeither#or;characters.
--Classpath
SettheJavaclasspath
--JvmMs
InitialmemorypoolsizeinMB
--JvmMx
MaximummemorypoolsizeinMB
--JvmSs
ThreadstacksizeinKB
--StartImage
Executablethatwillberun.
--StartPath
Workingpathforthestartimageexecutable.
--StartClass
Classthatwillbeusedforstartup.
--StartParams
ListofparametersthatwillbepassedtoeitherStartImageorStartClass.Parametersareseparatedusingeither#or;character.
--StartMethod
Main
Methodnameifdiffersthenmain
--StartMode
executable
Canoneofjvmjavaorexe
--StopImage
ExecutablethatwillberunonStopservicesignal.
--StopPath
Workingpathforthestopimageexecutable.
--StopClass
ClassthatwillbeusedonStopservicesignal.
--StopParams
ListofparametersthatwillbepassedtoeitherStopImageorStopClass.Parametersareseparatedusingeither#or;character.
--StopMethod
Main
Methodnameifdiffersthenmain
--StopMode
executable
Canoneofjvmjavaorexe
--StopTimeout
NoTimeout
Definesthetimeoutinsecondsthatprocrunwaitsforservicetoexitgracefully.
--LogPath
workingpath
Definesthepathforlogging
--LogPrefix
jakarta_service
Definestheservicelogfilename
--LogLevel
INFO
Definesthelogginglevelandcanbeeithererror,info,warnordebug
--StdOutput
Redirectedstdoutfilename
--StdError
Redirectedstderrfilename
Installingservices
Thesafestwaytomanuallyinstalltheserviceistousetheprovidedservice.batscript.
Installtheservicenamed'Tomcat5'
C:
\>service.batinstall
Ifusingtomcat.exe,youneedtousethe//IS//parameter.
Installtheservicenamed'Tomcat5'
C:
\>tomcat5//IS//Tomcat5--DisplayName="ApacheTomcat5"\
C:
\>--Install="C:
\ProgramFiles\Tomcat\bin\tomcat5.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=stop
Updatingservices
Toupdatetheserviceparameters,youneedtousethe//US//parameter.
Updatetheservicenamed'Tomcat5
C:
\>tomcat//US//Tomcat5--Description="ApacheTomcatServer-http:
//jakarta.apache.org/tomcat"\
C:
\>--Startup=auto--Classpath=%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\bin\bootstrap.jar
Removingservices
Toremovetheservice,youneedtousethe//DS//parameter.
Iftheserviceisrunningitwillbestoppedandthendeleted.
Removetheservicenamed'Tomcat5'
C:
\>tomcat//DS//Tomcat5
Debuggingservices
Toruntheserviceinconsolemode,youneedtousethe//TS//parameter.TheserviceshutdowncanbeinitiatedbypressingCTRL+CorCTRL+BREAK.Ifyourenamethetomcat5.exetotestservice.exethenyoucanjustexecutethetestservice.exeandthiscommandmodewillbeexecutedbydefault.
Runtheservicenamed'Tomcat5'inconsolemode
C:
\>tomcat//TS//Tomcat5[additionalarguments]
Orsimplyexecute:
C:
\>tomcat
安装Tomcat服务的方法
a)
%CATALINA_HOME%\bin\tomcat.exe-install"Tomcat5""%JAVA_HOME%\jre\bin\server\jvm.dll"-Djava.class.path="%CATALINA_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar"-Dcatalina.home="%CATALINA_HOME%"-Xrs-startorg.apache.catalina.startup.Bootstrap-paramsstart-stoporg.apache.catalina.startup.Bootstrap-paramsstop-out"%CATALINA_HOME%\logs\stderr.log"
b)
%CATALINA_HOME%\bin\tomcat.exe-uninstall-Tomcat5
品味人生
1、很多时候,看的太透反而不快乐,还不如幼稚的没心没肺。
2、睡吧,合上双眼,世界就与我无关。
——顾城《生命幻想曲》
3、你来人间一趟,你要看看太阳,和你的心上人,一起走在街上。
4、我不唱声嘶力竭的情歌,不表示没有心碎的时刻。
我不曾摊开伤口任宰割,愈合就无人晓得我内心挫折。
5、永远不要隔着屏幕说分手,最大的遗憾是连离开都不能当面说清。
6、最先道歉的人最勇敢,最先原谅的人最坚强,最先释怀的人最幸福。
7、好像每次都是这样,没有例外。
在我们最需要有一个人去依靠的时候,往往到最后都是自己一个人挺过去。
8、对我不满意,请直接来给我说,别到别人那里去宣泄你无处安放的情绪。
9、有些事,你把它藏到心里,也许还更好,等时间长了,也就变成了故事。
10、不要对自己太过苛刻,对自己太苛刻的人只会消耗掉更多让自己幸福的能力。
11、人,相互帮扶才感到温暖;事,共同努力才知道简单;路,有人同行才不觉漫长;爱情,要相互记挂才体味情深。
12、只有当痛苦在可以承受的时候,我们会自怨自艾。
当痛苦无法承受,我们就只会一笑置之。
13、爱情是一颗心找到另一颗心,而不是一张脸找到另一张脸。
为了找到那颗心,我们要学会不要脸。
14、比失去你更令我伤心的事是,你都没有为了和我在一起而努力过。
15、这世上有一条路无论如何也不能走,那就是歧途,只要走错一步结果都会是粉身碎骨。
——《千与千寻》
16、保持一份自信,做最好的自己,宁可高傲地发霉,不要低调地恋爱。
17、亲爱的,我在这座陌生的城市,流浪流浪。
灯火阑珊或是烟火灿烂,我总是愣在某个角落,静静的等你走来。
18、其实爱情里处得好不好,标准就两个字:
不累。
因为,对的人,不会让你觉得累。
19、明知是错的,也要去坚持,因为不甘心;有些人,明知是爱的,也要去放弃,因为没结局;有时候,明知没路了,却还在前行,因为习惯了。
20、如果曾有那么一个人,跟我说只要心里想一想我,就会铺天盖地地难受。
那么不管是拿前程作赌也好,还是拿幸福下注也好,我都会心甘情愿。
做学问要花功夫,持之以恒,日积月累。
21、我们最大的弱点在于放弃。
成功的必然之路就是不断的重来一次。
——托马斯·爱迪生
22、点点滴滴的藏,集成了一大仓。
——德国谚语
23、成大事不在于力量的大小,而在于能坚持多久。
24、喷泉的高度不会超过它的源头;一个人的成就不会超过他的信念。
——美国
25、生活真象这杯浓酒,不经三番五次的提炼呵,就不会这样可口!
——郭小川
26、一个在奋斗途径上努力的人,要是不把步骤分清楚,等于你旅行一个地方,不先规定睡眠和行程一般。
分清步骤,是十分重要的。
——戴尔·卡耐基
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- tomcat5 windows服务不能启动的终极解决方法docx windows 服务 不能 启动 终极 解决方法 docx
![提示](https://static.bingdoc.com/images/bang_tan.gif)