2016-06-10 122 views
0

我目前正試圖將Tomcat掛接到Netbeans並在其上運行Web項目。我已經設置了一個使用用戶名和密碼的服務器,但不斷收到此錯誤消息。我還添加了下面的服務器日誌以獲取更多詳細信息。 :Netbeans Tomcat服務器問題

Starting Tomcat process... 
Waiting for Tomcat... 
Tomcat server started. 
In-place deployment at C:\Ryan Drive\Web Development\Java\NetBeans\Projects\WebApplication5\build\web 
deploy?config=file%3A%2FC%3A%2FUsers%2Frmhaa%2FAppData%2FLocal%2FTemp%2Fcontext8651336917198990861.xml&path=/WebApplication5 
FAIL - Failed to deploy application at context path /WebApplication5 
C:\Ryan Drive\Web Development\Java\NetBeans\Projects\WebApplication5\nbproject\build-impl.xml:1045: The module has not been deployed. 
See the server log for details. 
BUILD FAILED (total time: 4 seconds) 

以下是以下服務器日誌。它看起來像訪問被拒絕可能?但我不知道爲什麼會發生這種情況。每次運行服務器時,都會收到相同的服務器日誌錯誤,而與項目無關。

13-Jun-2016 18:14:22.419 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars 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. 
13-Jun-2016 18:14:22.422 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps\ROOT has finished in 124 ms 
13-Jun-2016 18:14:22.424 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"] 
13-Jun-2016 18:14:22.431 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"] 
13-Jun-2016 18:14:22.432 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 773 ms 
java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\Tomcat 8.0\conf\Catalina\localhost\ch07_ex2_download.xml (Access is denied) 
    at java.io.FileOutputStream.open0(Native Method) 
    at java.io.FileOutputStream.open(FileOutputStream.java:270) 
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213) 
    at java.io.FileOutputStream.<init>(FileOutputStream.java:162) 
    at org.apache.catalina.manager.ManagerServlet.copyInternal(ManagerServlet.java:1626) 
    at org.apache.catalina.manager.ManagerServlet.copy(ManagerServlet.java:1589) 
    at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:880) 
    at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:335) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) 
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) 
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) 
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) 
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) 
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099) 
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) 
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520) 
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) 
    at java.lang.Thread.run(Thread.java:745) 
+0

「請參閱服務器日誌以瞭解詳細信息。」服務器日誌中的詳細信息是什麼? –

+0

@JoachimRohde,我在上面添加了服務器日誌。謝謝。 – john23

+0

「訪問被拒絕」的哪部分你不明白嗎? – EJP

回答

0

嘗試關閉Tomcat服務器,然後再次嘗試清理建設項目。

Liron

+0

試過了,沒有工作。我在上面添加了Server日誌。 – john23

+0

1.嘗試停止tomcat。 2.刪除以下文件(或更改其擴展名):C:\ Program Files \ Apache Software Foundation \ Tomcat 8.0 \ conf \ Catalina \ localhost \ ch07_ex2_download.xml 3.嘗試清理並編譯 4.啓動tomcat再次服務器。 – Liron

1

我有同樣的失敗部署和訪問被拒絕的消息。

關閉netbeans並將其作爲管理員運行。它授予運行tomcat的所有必要權限。

如果它不起作用,可能是一些配置,請檢查下面的視頻。他們幫助了我很多 https://www.youtube.com/watch?v=pKMgr8uNvGMhttps://www.youtube.com/watch?v=psvuLBVeTzQ

+0

提到視頻作爲答案並不是非常有用,而是嘗試恢復解決方案的內容 - 如果它不起作用 - 這樣,如果鏈接消失,您的解決方案仍然足夠好。 – HDJEMAI

+0

嗨Djemai, 我明白你的意思,但我沒有寫下如何安裝和配置服務器(太過分了,而不是重點)。如果我已經在文檔中加入了關於如何操作的鏈接,那麼結果將與視頻鏈接相同。 –