Tomcat5 windows服務(wù)不能啟動(dòng)的終極解決方法_第1頁
Tomcat5 windows服務(wù)不能啟動(dòng)的終極解決方法_第2頁
Tomcat5 windows服務(wù)不能啟動(dòng)的終極解決方法_第3頁
Tomcat5 windows服務(wù)不能啟動(dòng)的終極解決方法_第4頁
Tomcat5 windows服務(wù)不能啟動(dòng)的終極解決方法_第5頁
已閱讀5頁,還剩9頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、本人多次碰到這個(gè)問題,在網(wǎng)上搜索很久,一直沒有找到真正的解決方法。今天下午一次偶然的機(jī)會(huì)發(fā)現(xiàn)了問題所在,根據(jù)問題,提出以下解決方案。問題所在:現(xiàn)在很多人都在使用jdk的壓縮版,使得tomcat服務(wù)不能正確設(shè)置java VM,導(dǎo)致tomcat服務(wù)不能正常配置和啟動(dòng)。如果你是安裝版jdk也出現(xiàn)啟動(dòng)問題,請參照以下方法解決。假設(shè) jdk 安裝目錄為 d:j2sdktomcat5 安裝目錄為 D:Program FilesApache Software FoundationTomcat 5.01. 配置環(huán)境變量: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 服務(wù)這里有兩種情況,一是tomcat5為安裝版,二是解壓版,針對(duì)這兩種情況分別解決。(1)安裝版 tomcat5在安裝時(shí)選擇安裝tomcat服務(wù),如圖安裝完成后,打開注冊表regedit.exe, 找到HKEY_LOCAL_MACHINESOFTWAREApache Software FoundationTomca

3、t Service ManagerTomcat5Parameters,你可以看到里面有很多參數(shù)值,主要是修改Java項(xiàng)的值為 d:j2sdkjrebinserverjvm.dll, 修改正確后,你就可以通過開始-程序-Apache Tomcat 5.0-start tomcat啟動(dòng)服務(wù)了。若沒有若沒有此項(xiàng),可以依照以下方法設(shè)置參數(shù)。(2)解壓版 tomcat5這時(shí)你要先配置服務(wù)所用的參數(shù),啟動(dòng)命令是 tomcat5的bin目錄下的tomcatw.exe(后面附上tomcatw.exe命令參數(shù))。如果不存在HKEY_LOCAL_MACHINESOFTWAREApache Software Fou

4、ndationTomcat Service ManagerTomcat5Parameters,請先創(chuàng)建,這一步是關(guān)鍵。使用命令 tomcatw.exe /ES/Tomcat5 打開配置窗口,如下 設(shè)置參數(shù)如下:Service欄 Description = Apache Tomcat 5.0 (這個(gè)可以隨便寫) Image Path = d:Program FilesApache Software FoundationTomcat 5.0binbootstrap.jar Work Path = d:Program FilesApache Software FoundationTomcat 5.0

5、 Auto Start 這個(gè)參數(shù)允許設(shè)置服務(wù)為自動(dòng)啟動(dòng)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: 只要設(shè)置兩項(xiàng) Output = d:Program FilesApache Software FoundationTomcat 5.0logsstdout.log Error = d:Program FilesApache Software FoundationTomcat 5.0logsstderr.log根據(jù)以上設(shè)置,接下來可以使用 tomcatw.exe /GT/Tomcat5 啟動(dòng)服務(wù)了。若

7、有問題可以給我留言或者加我QQ: 4034348 HYPERLINK /dankes/archive/2005/08/10/450043.aspx TOMCAT5在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. I

8、t is called if the no option is provided but the executable 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 applicat

9、ionThis is the default operation. It is called if 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 t

10、he service if runningCommand line parametersEach command 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 pre

11、cedence. For example:set PR_CLASSPATH=xx.jaris equivalent to providing-Classpath=xx.jaras command line parameter.ParameterNameDefaultDescription-DescriptionService name description (maximum 1024 characters)-DisplayNameServiceNameService display name-Installprocrun.exe /RS/ServiceNameInstall image-St

12、artupmanualService startup mode can be either auto 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

13、using either # or ; characters-UserUser account used 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

14、 JAVA_HOME then defined by JAVA_HOME environment variable-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

15、# or ; characters.-ClasspathSet the Java classpath-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.-StartPar

16、amsList of parameters that will be passed to either StartImage or StartClass. Parameters are separated using either # or ; character.-StartMethodMainMethod name if differs then main-StartModeexecutableCan one of jvmjava or exe-StopImageExecutable that will be run on Stop service signal.-StopPathWork

17、ing path for the stop image executable.-StopClassClass 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-StopModeexecutabl

18、eCan one of jvmjava or exe-StopTimeoutNo TimeoutDefines 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, in

19、fo, warn or debug-StdOutputRedirected stdout filename-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/ par

20、ameter.Install the service named Tomcat5C: tomcat5 /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.Boot

21、strap -StopParams=stopUpdating servicesTo update the service parameters, you need to use the /US/ parameter.Update the service named Tomcat5C: tomcat /US/Tomcat5 -Description=Apache Tomcat Server - /tomcat C: -Startup=auto -Classpath=%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 Tomcat5C: tomcat /DS/Tomcat5Debugging servicesTo run the service in console mode, you need to use the /TS/ parameter. The

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論