Tomcat 9.0.8 Http状态404

时间:2018-05-30 16:15:59

标签: eclipse apache tomcat java-ee web-applications

我安装了tomcat 9.0.8。我将位置切换到localhost.server并且我更改了服务器位置以使用tomcat安装但我仍然无法打开tomcat.i的主页获取http状态404错误。当我在启动Web服务器后在控制台中看到我得到以下错误。我也在localhost上推送tomcat v9.0.8服务器遇到了问题。

SEVERE: Unable to create directory for deployment: [C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\Catalina\localhost]
May 30, 2018 9:29:21 PM org.apache.catalina.valves.AccessLogValve open
SEVERE: Failed to open access log file [C:\Program Files\Apache Software Foundation\Tomcat 9.0\logs\localhost_access_log.2018-05-30.txt]
java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\Tomcat 9.0\logs\localhost_access_log.2018-05-30.txt (Access is denied)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(Unknown Source)
    at java.io.FileOutputStream.<init>(Unknown Source)
    at org.apache.catalina.valves.AccessLogValve.open(AccessLogValve.java:651)
    at org.apache.catalina.valves.AccessLogValve.startInternal(AccessLogValve.java:685)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:179)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:963)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)

May 30, 2018 9:29:21 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\docs]
May 30, 2018 9:29:22 PM org.apache.catalina.core.StandardContext postWorkDirectory
WARNING: Failed to create work directory [C:\Program Files\Apache Software Foundation\Tomcat 9.0\work\Catalina\localhost\docs] for context [/docs]
May 30, 2018 9:29:28 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
May 30, 2018 9:29:28 PM org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified: [C:\Program Files\Apache Software Foundation\Tomcat 9.0\work\Catalina\localhost\docs] is unusable.
May 30, 2018 9:29:28 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\docs] has finished in [6,463] ms
May 30, 2018 9:29:28 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\manager]
May 30, 2018 9:29:28 PM org.apache.catalina.core.StandardContext postWorkDirectory
WARNING: Failed to create work directory [C:\Program Files\Apache Software Foundation\Tomcat 9.0\work\Catalina\localhost\manager] for context [/manager]
May 30, 2018 9:29:33 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
May 30, 2018 9:29:33 PM org.apache.jasper.EmbeddedServletOptions <init>
SEVERE: The scratchDir you specified: [C:\Program Files\Apache Software Foundation\Tomcat 9.0\work\Catalina\localhost\manager] is unusable.
May 30, 2018 9:29:33 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\manager] has finished in [5,186] ms
May 30, 2018 9:29:33 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\ROOT]
May 30, 2018 9:29:33 PM org.apache.catalina.core.StandardContext postWorkDirectory
WARNING: Failed to create work directory [C:\Program Files\Apache Software Foundation\Tomcat 9.0\work\Catalina\localhost\ROOT] for context []

1 个答案:

答案 0 :(得分:0)

错误:

java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\Tomcat 9.0\logs\localhost_access_log.2018-05-30.txt (Access is denied)

清楚地表明这是一个访问问题,很可能是您没有访问文件的权限(很可能是写权限)。

由于您使用的是Windows操作系统,如果您不是管理员,则可能必须联系管理员才能为您打开该权限。