2017-05-31 52 views
0

有一個小型的web程序源代碼,沒有問題,因爲在我的同學測試過的機器上可以運行起來,但是我自己的環境Tomcat服務器運行出錯後只能訪問localhost8080,無法訪問項目頁面,顯示404。還試圖編譯項目手冊發佈到webapps啓動,但仍無法訪問該項目。然後我重新配置了Myeclipse + tomcat的整個環境。幾次都沒用,就是myeclispe已經被重新加載了,Tomcat改變了一些。那麼可能是什麼問題?以下是啓動後的服務器日誌:「關於JavaWeb項目服務器正常啓動,但不能正常訪問項目

五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: Server version: Apache Tomcat/7.0.78 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: Server built: May 10 2017 15:02:19 UTC 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: Server number: 7.0.78.0 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: OS Name: Windows 7 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: OS Version: 6.1 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: Architecture: amd64 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: Java Home: D:Javajdk1.8jre 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: JVM Version: 1.8.0_102-b14 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: JVM Vendor: Oracle Corporation 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: CATALINA_BASE: D:apache-tomcat-7.0.78 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: CATALINA_HOME: D:apache-tomcat-7.0.78 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: Command line argument: -Dcatalina.home=D:apache-tomcat-7.0.78 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: Command line argument: -Dcatalina.base=D:apache-tomcat-7.0.78 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: Command line argument: -Djava.endorsed.dirs=D:apache-tomcat-7.0.78/common/endorsed 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: Command line argument: -Djava.io.tmpdir=D:apache-tomcat-7.0.78temp 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: Command line argument: -Djava.library.path=D:Javajdk1.8bin;D:apache-tomcat-7.0.78bin 
五月 31, 2017 9:28:03 上午 org.apache.catalina.startup.VersionLoggerListener log 
信息: Command line argument: -Dsun.io.useCanonCaches=false 
五月 31, 2017 9:28:03 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 
信息: Loaded APR based Apache Tomcat Native library 1.2.12 using APR version 1.5.2. 
五月 31, 2017 9:28:03 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 
信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 
五月 31, 2017 9:28:04 上午 org.apache.catalina.core.AprLifecycleListener initializeSSL 
信息: OpenSSL successfully initialized (OpenSSL 1.0.2k 26 Jan 2017) 
五月 31, 2017 9:28:07 上午 org.apache.coyote.AbstractProtocol init 
信息: Initializing ProtocolHandler ["http-apr-8080"] 
五月 31, 2017 9:28:07 上午 org.apache.coyote.AbstractProtocol init 
信息: Initializing ProtocolHandler ["ajp-apr-8009"] 
五月 31, 2017 9:28:07 上午 org.apache.catalina.startup.Catalina load 
信息: Initialization processed in 6195 ms 
五月 31, 2017 9:28:07 上午 org.apache.catalina.core.StandardService startInternal 
信息: Starting service Catalina 
五月 31, 2017 9:28:07 上午 org.apache.catalina.core.StandardEngine startInternal 
信息: Starting Servlet Engine: Apache Tomcat/7.0.78 
五月 31, 2017 9:28:07 上午 org.apache.catalina.startup.HostConfig deployDirectory 
信息: Deploying web application directory D:apache-tomcat-7.0.78webappsdocs 
五月 31, 2017 9:28:08 上午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom 
信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [765] milliseconds. 
五月 31, 2017 9:28:08 上午 org.apache.catalina.startup.HostConfig deployDirectory 
信息: Deployment of web application directory D:apache-tomcat-7.0.78webappsdocs has finished in 1,310 ms 
五月 31, 2017 9:28:08 上午 org.apache.catalina.startup.HostConfig deployDirectory 
信息: Deploying web application directory D:apache-tomcat-7.0.78webappsexamples 
五月 31, 2017 9:28:09 上午 org.apache.catalina.core.ApplicationContext log 
信息: ContextListener: contextInitialized() 
五月 31, 2017 9:28:09 上午 org.apache.catalina.core.ApplicationContext log 
信息: SessionListener: contextInitialized() 
五月 31, 2017 9:28:09 上午 org.apache.catalina.core.ApplicationContext log 
信息: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', '[email protected]') 
五月 31, 2017 9:28:09 上午 org.apache.catalina.startup.HostConfig deployDirectory 
信息: Deployment of web application directory D:apache-tomcat-7.0.78webappsexamples has finished in 781 ms 
五月 31, 2017 9:28:09 上午 org.apache.catalina.startup.HostConfig deployDirectory 
信息: Deploying web application directory D:apache-tomcat-7.0.78webappshost-manager 
五月 31, 2017 9:28:09 上午 org.apache.catalina.startup.HostConfig deployDirectory 
信息: Deployment of web application directory D:apache-tomcat-7.0.78webappshost-manager has finished in 93 ms 
五月 31, 2017 9:28:09 上午 org.apache.catalina.startup.HostConfig deployDirectory 
信息: Deploying web application directory D:apache-tomcat-7.0.78webappsmanager 
五月 31, 2017 9:28:09 上午 org.apache.catalina.startup.HostConfig deployDirectory 
信息: Deployment of web application directory D:apache-tomcat-7.0.78webappsmanager has finished in 78 ms 
五月 31, 2017 9:28:09 上午 org.apache.catalina.startup.HostConfig deployDirectory 
信息: Deploying web application directory D:apache-tomcat-7.0.78webappsROOT 
五月 31, 2017 9:28:09 上午 org.apache.catalina.startup.HostConfig deployDirectory 
信息: Deployment of web application directory D:apache-tomcat-7.0.78webappsROOT has finished in 94 ms 
五月 31, 2017 9:28:09 上午 org.apache.catalina.startup.HostConfig deployDirectory 
信息: Deploying web application directory D:apache-tomcat-7.0.78webappsTax 
五月 31, 2017 9:28:11 上午 org.apache.catalina.startup.TldConfig execute 
信息: 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. 
五月 31, 2017 9:28:11 上午 org.apache.catalina.core.ApplicationContext log 
信息: Initializing Spring root WebApplicationContext 
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). 

log4j:WARN Please initialize the log4j system properly. 
五月 31, 2017 9:28:14 上午 org.apache.catalina.startup.HostConfig deployDirectory 
信息: Deployment of web application directory D:apache-tomcat-7.0.78webappsTax has finished in 4,543 ms 
五月 31, 2017 9:28:14 上午 org.apache.coyote.AbstractProtocol start 
信息: Starting ProtocolHandler ["http-apr-8080"] 
五月 31, 2017 9:28:14 上午 org.apache.coyote.AbstractProtocol start 
信息: Starting ProtocolHandler ["ajp-apr-8009"] 
五月 31, 2017 9:28:14 上午 org.apache.catalina.startup.Catalina start 
信息: Server startup in 7174 ms 
+0

如果完全是英文,這將有所幫助。 –

+0

對不起,但我可以確保tomcat服務器正常 – fcoolish

+0

如何訪問您的項目? –

回答

0

檢查項目的上下文根。右鍵單擊該項目並選擇「屬性」。然後,如果使用MyEclipse 2017,請查看Project Facets-> Web以查找Web上下文根。或者,如果直到2016年使用MyEclipse 2013,請查看項目屬性中的MyEclipse-> Project Facets-> Web。通過輸入http://localhost:8080,然後輸入項目的上下文根,確保訪問項目(假設它已正確部署)。例如,如果您的上下文根是「my-app」,則輸入「http://localhost:8080/my-app」。如果這不起作用,那麼您的項目可能尚未部署,您必須在部署過程中提供任何錯誤的詳細信息。

+0

謝謝。我已經解決了我的問題 – fcoolish

+0

太棒了!如果我的解決方案有幫助,請考慮接受它作爲解決方案或提升它。 –

相關問題