


版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、本人多次碰到这个问题,在网上搜索很久,一直没有找到真正的解决方 法。今天下午一次偶然的机会发现了问题所在,根据问题,提出以下解决方 案。问题所在:现在很多人都在使用 jdk 的压缩版,使得 tomcat 服务不能正确设置 java VM,导致tomcat服务不能正常配置和启动。如果你是安装版jdk也出现启动问题,请参照以下方法解决。假设jdk 安装目录为 d:j2sdktomcat5 安装目录为 D:Program FilesApache Software FoundationTomcat5.01. 配置环境变量:JAVA_HOME = d:j2sdkCLASSPATH= %JAVA_HOME
2、%bin;.;%JAVA_HOME%lib;%JAVA_HOME%libdt.jar;%JAVA_H OME%libtools.jarCATALINA_HOME = D:Program FilesApache Software FoundationTomcat 5.02. 配置Tomcat服务这里有两种情况,一是 tomcat5 为安装版,二是解压版,针对这两种情况 分别解决。( 1)安装版 tomcat5在安装时选择安装 tomcat 服务,如图安装完成后,打开注册表regedit.exe,找到HKEY_LOCAL_MACHINESOFTWAREApache Software Foundat
3、ionTomcat ServiceManager'Tomcat5Parameters,你可以看到里面有很多参数值,主要是修 改Java项的值为d:j2sdkjrebinserverjvm.dll,修改正确后,你就可以通过开始 ->程序->Apache Tomcat 5.0->start tomcat启动服务了。若没有若没有此项,可以 依照以下方法设置参数。( 2)解压版 tomcat5这时你要先配置服务所用的参数,启动命令是 tomcat5 的 bin 目录下的 tomcatw.exe(后面附上 tomcatw.exe 命令参数)。如果不存在 HKEY_LOCAL_M
4、ACHINESOFTWAREApache SoftwareFoun dati on TomcatServiceMa nagerTomcat5Parameters,请先仓 U建,这一步 是关键。使用命令 tomcatw.exe /ES/Tomcat5 打开配置窗口,如下设置参数如下:Service 栏Description = Apache Tomcat 5.0(这个可以随便写)Image Path = d:Program FilesApache Software FoundationTomcat5.0binbootstrap.jarWork Path = d:Program FilesApac
5、he Software FoundationTomcat 5.0AutoStart 这个参数允许设置服务为自动启动Java VM 栏:Auto 不要打勾Java VM = D:j2sdkjrebinserverjvm.dllJava Options = -Dcatalina.home="d:Program FilesApache SoftwareFoundationTomcat 5.0"-Djava.endorsed.dirs="d:Program FilesApache SoftwareFoundationTomcat 5.0commonendorsed&quo
6、t; -XrsStart Class = org/apache/catalina/startup/Bootstrap;main;startStop Class = org/apache/catalina/startup/Bootstrap;main;stopStandard Streams:只要设置两项Output = d:Program FilesApache Software FoundationTomcat5.0logsstdout.logError = d:Program FilesApache Software FoundationTomcat5.0logsstderr.log根据以
7、上设置,接下来可以使用 tomcatw.exe /GT/Tomcat5 启动服务了。 若有问题可以给我留言或者加我 QQ: 4034348T0MCAT5在 WINDOWS下的一些命令行Tomcatw monitor applicationTomcatwis a GUI application for monitoring and configuring Tomcatservices.The available command line options are:Edit service/ES/configurationThis is the default operation. It is ca
8、lled ifthe no option is provided but the executable isrenamed toservicenameW.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:This is the default operation. It is called ifRunt
9、heserviceasthenooptionisprovided.TheServiceNameisthe/TS/consolename of the executable without exe sufix,applicationmeaning Tomcat5/RS/Run the serviceCalled only from ServiceManager/SS/Stop the serviceUpdate service/US/parameters/IS/Install service/DS/Delete serviceStops the service if runningCommand
10、 line parametersEachcommandparameterisprefixedwith- -.Ifthecommandlineisprefixedwith+then it's value will be appended to the existing option. If theenvironment variable with the same name as command line parameter butprefixed withPR_exists it will take precedence. For example:set PR_CLASSPATH=xx
11、.jaris equivalent to providing-Classpath=xx.jaras command line parameter.ParameterNameDefault-Description-DisplayNameServiceName-Installprocrun.exe/RS/ServiceName-Startupmanual-DependsOn-Environment-User-Password-JavaHomeJAVA_HOME-JvmautoDescriptionServicenamedescription(maximum1024characters)Servic
12、e display nameInstall imageServicestartupmodecanbeeitherautoormanualList of services that this servicedepend on. Dependent services areseparated using either#or;charactersList of environment variables thatwillbeprovidedtotheserviceintheformkey=value. They are separatedusing either#or;charactersUser
13、account used for runningexecutable. It is used only forStartModejavaorexeand enablesrunning applications as service underaccount without LogonAsServiceprivilege.Passwordforuseraccountsetby-UserparameterSetadifferentJAVA_HOMEthendefinedby JAVA_HOME environment variableUse eitherautoor specify the ful
14、lpath to thejvm.dll. You can use theenvironment variable expansion here.-JvmOptions-Xrs-Classpath-JvmMs-JvmMx-JvmSs-StartImage-StartPath-StartClass-StartParams-StartMethodMain-StartModeexecutable-StopImage-StopPath-StopClass-StopParams-StopMethodMain-StopModeexecutable-StopTimeoutNo Timeout-LogPathw
15、orking path-LogPrefixjakarta_service-LogLevelINFO-StdOutput-StdErrorListofoptionsintheformof-Dor-Xthat will be passed to the JVM. Theoptions are separated using either#or;characters.Set the Java classpathInitial memory pool size in MBMaximum memory pool size in MBThread stack size in KBExecutable th
16、at will be run.Working path for the start imageexecutable.Class that will be used for startup.Listofparametersthatwillbepassedto either StartImage or StartClass.Parameters are separated using either#or;character.Method name if differs then mainCan one ofjvmjavaorexeExecutable that will be run on Sto
17、pservice signal.Working path for the stop imageexecutable.ClassthatwillbeusedonStopservicesignal.Listofparametersthatwillbepassedto either StopImage or StopClass.Parameters are separated using either#or;character.Method name if differs then mainCan one ofjvmjavaorexeDefines the timeout in seconds th
18、atprocrun waits for service to exitgracefully.Defines the path for loggingDefines the service log filenameDefines the logging level and can beeithererror,info,warnordebugRedirected stdout filenameRedirected stderr filenameInstalling servicesThe safest way to manually install the service is to use th
19、e providedservice.batscript.Install the service named 'Tomcat5'C:> service.bat installIf using tomcat.exe, you need to use the/IS/parameter.Install the service named 'Tomcat5'C:> tomcat5 /IS/Tomcat5 -DisplayName="Apache Tomcat 5" C:> - Install="C:Program Files
20、Tomcatbintomcat5.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 the service parameters, you need to use the/US/parame
21、ter.Update the service named 'Tomcat5C:> tomcat /US/Tomcat5 -Description="Apache Tomcat Server - /tomcat " C:> -Startup=autoClasspath=%JAVA_HOME%libtools.jar;%CATALINA_HOME%binbootstrap.jarRemoving servicesTo remove the service, you need to use the/DS/parameter.If the service is running it will be stopped and then deleted.Remove the service named 'Tomcat5'C:> tomcat /DS/Tomcat5Debugging servicesToruntheserviceinconsolemode,youneedtousethe/TS/parameter.Theservicesh utdowncanbeinitiatedbypressingCTRL+CorCTRL+BRE
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025维修设备的技术合同
- 2025年LED控制与驱动产品项目建议书
- 2025企业劳动合同书样本
- 2025新鲜果品购销合同
- 2025聘请短期工合同模板
- 2025标准股权质押借款合同范本
- 2025年橡胶型密封胶项目建议书
- 2025年劳动合同 住房公积金合同书参考模板
- 2025中天国际酒店公寓精装修监理合同附件合同条款与监理要求
- 2025年的我合同审查大作战:来看这份劳动合同
- 教研项目合同协议
- 委托设计框架合同协议
- 风险化学品事故应急预案
- SL631水利水电工程单元工程施工质量验收标准第4部分:堤防与河道整治工程
- 【浙江卷地理试题+答案】浙江省高考科目考试2025年4月绍兴市适应性试卷(绍兴二模)
- 人工智能在情绪调节与积极心理学中的应用-全面剖析
- 汽车冷却系统课件
- 防脱洗发水培训课件
- 2025春季学期国开电大专科《管理学基础》一平台在线形考(形考任务一至四)试题及答案
- 舟山西堠门大桥mmm课件
- 2024年四川省绵阳市中考化学试题(含答案解析)
评论
0/150
提交评论