我在Windows 7系统上安装了Apache Tomcat 7.0.57。服务器已启动并正在运行,但每当我尝试运行Manager应用程序时,都会收到错误HTTP状态404.错误描述表明请求的资源不可用。 我修改了tomcat-users.xml文件,添加了一个角色为" manager-gui"的用户。此外,在设置Tomcat期间,我将路径变量CATALINA_HOME和CATALINA_BASE设置为D:/apache-tomcat-7.0.57/(因为我将只运行服务器的单个实例)。但这似乎还不行。
每当我使用eclipse启动服务器时,这就是控制台显示的内容:
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.57
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Nov 3 2014 08:39:16 UTC
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.57.0
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 7
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 6.1
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JAVA_HOME: C:\Program Files\Java\jre7
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.7.0_75-b13
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: D:\apache-tomcat-7.0.57
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument:-Dcatalina.base=D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=D:\apache-tomcat-7.0.57
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=D:\apache-tomcat-7.0.57\endorsed
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Feb 09, 2015 3:19:21 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;D:\Python\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Ixia\Tcl\8.5.12.0\bin;C:\Program Files (x86)\Ixia\Perl\site\bin;C:\Program Files (x86)\Ixia\Perl\bin;;C:\Program Files\Boot2Docker for Windows;C:\Program Files\Java\jre7\bin\;;.
Feb 09, 2015 3:19:21 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Feb 09, 2015 3:19:21 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8010"]
Feb 09, 2015 3:19:21 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 504 ms
Feb 09, 2015 3:19:21 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Feb 09, 2015 3:19:21 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.57
Feb 09, 2015 3:19:22 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [197] milliseconds.
Feb 09, 2015 3:19:22 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Feb 09, 2015 3:19:22 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8010"]
Feb 09, 2015 3:19:22 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 535 ms
这里提到的CATALINA_BASE不是我设定的。
答案 0 :(得分:0)
从Eclipse中调用Tomcat时,这并不简单。请阅读https://wiki.eclipse.org/WTP_Tomcat_FAQ
上的常见问题解答部分它解释了如果从Eclipse中启动Tomcat,如何使用Tomcat原始目录的二进制文件,但Web应用程序等是单独存储的。