日期:2014-05-20  浏览次数:20972 次

命令行启动tomcat的问题
我想用
  -Dcatalina.home= "F:\work\tomcatService\output "   -Djava.endorsed.dirs= "F:\work\tomcatService\output\common\endorsed "   -Dcatalina.base= "F:\work\tomcatService\output "   -Djava.io.tmpdir= "F:\work\tomcatService\output\temp "   -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager   -Djava.util.logging.config.file= "F:\work\tomcatService\output\conf\logging.properties "   -classpath   "D:\jdk1.5\lib\tools.jar;F:\work\tomcatService\output\tomcatService.jar; "   org.apache.catalina.startup.Bootstrap   start

来启动tomcat,其中tomcat的源码在tomcatService.jar包内,启动时出错:

2007-5-31   16:11:11   org.apache.catalina.core.AprLifecycleListener   init
信息:   The   Apache   Tomcat   Native   library   which   allows   optimal   performance   in   production   environments   was   not   found   on   the  
2007-5-31   16:11:11   org.apache.coyote.http11.Http11Protocol   init
信息:   Initializing   Coyote   HTTP/1.1   on   http-8080
bootstrap.java   start()
2007-5-31   16:11:11   org.apache.catalina.startup.Catalina   load
信息:   Initialization   processed   in   2015   ms
2007-5-31   16:11:11   org.apache.catalina.core.StandardService   start
信息:   Starting   service   Catalina
2007-5-31   16:11:11   org.apache.catalina.core.StandardEngine   start
信息:   Starting   Servlet   Engine:   Apache   Tomcat/@VERSION@
2007-5-31   16:12:24   org.apache.coyote.http11.Http11Protocol   start
信息:   Starting   Coyote   HTTP/1.1   on   http-8080
2007-5-31   16:12:24   org.apache.jk.common.ChannelSocket   init
信息:   JK:   ajp13   listening   on   /0.0.0.0:8009
2007-5-31   16:12:24   org.apache.jk.server.JkMain   start
信息:   Jk   running   ID=0   time=0/109     config=null
java.lang.reflect.InvocationTargetException
at   sun.reflect.NativeMethodAccessorImpl.invoke0(Native   Method)
at   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at   java.lang.reflect.Method.invoke(Method.java:585)
at   org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:291)
at   org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:416)
Caused   by:   java.lang.NoSuchMethodError:   org.apache.catalina.mbeans.MBeanUtils.createRegistry()Lorg/apache/commons/modeler/Registry;
at   org.apache.catalina.storeconfig.StoreConfigLifecycleListener.createMBean(StoreConfigLifecycleListener.java:91)
at   org.apache.catalina.storeconfig.StoreConfigLifecycleListener.lifecycleEvent(StoreConfigLifecycleListener.java:57)
at   org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at   org.apache.catalina.core.StandardServer.start(StandardServer.java:715)
at   org.apache.catalina.startup.Catalina.start(Catalina.java:554)
...   6   more

有哪位朋友有这方面的经验,请告之我错在哪里?

------解决方案--------------------
配置好java的运行环境,然后用命令行 java -jar tomcatService.jar去启动试试
------解决方案--------------------
环境变量没有设全吧,把common/lib里面的jar包加进去看看