Servlet-Apache Tomcat

时间:2015-07-21 11:13:19

标签: java apache tomcat

需要帮助。
我正在使用JDK 1.7& Tomcat 7
我正在尝试启动tomcat服务器,但无法看到apache tomcat的主页 我已经查看了日志文件&得到这个日志:

Jul 21, 2015 4:24:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version:        Apache Tomcat/7.0.63  
Jul 21, 2015 4:24:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Jun 30 2015 08:08:33 UTC  
Jul 21, 2015 4:24:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number:         7.0.63.0  
Jul 21, 2015 4:24:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Windows 7  
Jul 21, 2015 4:24:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            6.1  
Jul 21, 2015 4:24:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64  
Jul 21, 2015 4:24:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home:             C:\Program Files\Java\jdk1.7.0_79\jre  
Jul 21, 2015 4:24:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.7.0_79-b15  
Jul 21, 2015 4:24:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation  
Jul 21, 2015 4:24:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         C:\apache-tomcat-7.0.63\apache-tomcat-7.0.63
Jul 21, 2015 4:24:30 PM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         C:\apache-tomcat-7.0.63\apache-tomcat-7.0.63  

SEVERE: ContainerBase.addChild: start:   
org.apache.catalina.LifecycleException: Failed to start component   [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/docs]]  

Jul 21, 2015 4:24:31 PM org.apache.catalina.startup.HostConfig deployDirectory  
SEVERE: Error deploying web application directory C:\apache-tomcat-7.0.63\apache-tomcat-7.0.63\webapps\docs  
java.lang.IllegalStateException: ContainerBase.addChild: start:   org.apache.catalina.LifecycleException: Failed to start component   [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/docs]]  

3 个答案:

答案 0 :(得分:0)

我最初的想法是您使用的Tomcat安装不是全新安装。请尝试并按照以下步骤操作:

  1. http://tomcat.apache.org/download-70.cgi
  2. 下载您的优惠副本
  3. 将其解压缩到指定文件夹
  4. 使用启动脚本启动服务。

答案 1 :(得分:0)

您必须为Apache Tomcat设置路径:

CATALINA_HOME ="您保存了tomcat目录"

然后重启服务器。打开浏览器类型 http://localhost:8080

答案 2 :(得分:0)

要启动Tomcat,请设置两个环境变量:

  • JAVA_HOME:这是指存在java和javac的目录 例如:C:\ jdk1.8.0_181
  • CATALINA_HOME:这是指bin上方的目录 例如:C:\ apache-tomcat-5.5.29

然后打开命令提示符并运行以下命令: %CATALINA_HOME%\ bin \ startup.bat

如果您未设置CATALINA_HOME,则 C:\ apache-tomcat-5.5.29 \ bin \ statup.bat

然后打开您的Web浏览器并输入: 本地主机:8080

重新检查已完成的设置。

有关更多详细信息,请参阅: https://www.tutorialspoint.com/jsp/jsp_environment_setup.htm