2012-11-05 263 views
1

當我在eclipse indigo中運行servlet Web應用程序時tomcat apache服務器未啓動,它將在控制檯中顯示以下錯誤。在Eclipse中運行Web應用程序時出現錯誤

Nov 5, 2012 10:51:11 AM org.apache.catalina.core.AprLifecycleListener init 
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\jre1.7.0\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.7.0/bin/client;C:/Program Files/Java/jre1.7.0/bin;C:/Program Files/Java/jre1.7.0/lib/i386;C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.7.0\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Common Files\Nero\Lib\;D:\eclipseIndigo; 
Nov 5, 2012 10:51:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin 
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ServletDemo' did not find a matching property. 
Nov 5, 2012 10:51:11 AM org.apache.tomcat.util.digester.SetPropertiesRule begin 
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:DemoPro' did not find a matching property. 
Nov 5, 2012 10:51:12 AM org.apache.coyote.AbstractProtocol init 
INFO: Initializing ProtocolHandler ["http-bio-8085"] 
Nov 5, 2012 10:51:12 AM org.apache.coyote.AbstractProtocol init 
INFO: Initializing ProtocolHandler ["ajp-bio-8009"] 
Nov 5, 2012 10:51:12 AM org.apache.catalina.startup.Catalina load 
INFO: Initialization processed in 2253 ms 
Nov 5, 2012 10:51:12 AM org.apache.catalina.core.StandardService startInternal 
INFO: Starting service Catalina 
Nov 5, 2012 10:51:12 AM org.apache.catalina.core.StandardEngine startInternal 
INFO: Starting Servlet Engine: Apache Tomcat/7.0.21 
Nov 5, 2012 10:51:13 AM org.apache.catalina.startup.Catalina start 
SEVERE: Catalina.start: 
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152) 
    at org.apache.catalina.startup.Catalina.start(Catalina.java:621) 
    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:322) 
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450) 
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152) 
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148) 
    ... 7 more 
+0

你可以直接啓動嗎?我的意思是沒有部署你的Web應用程序? –

+0

編寫程序後,我去項目和運行運行在服務器選項到Web應用程序 – user1794368

+0

嘗試啓動沒有您的應用程序的Tomcat。如果這是可能的。請發佈您的代碼,包括web.xml –

回答

1

您剪切/粘貼了大量的錯誤信息......但我想你忽略的事項:)

看看這個鏈接的部分:

1)他們使用的是NetBeans(您正在使用Eclipse--但可能並不重要)

2)他們得到了完全相同的回溯,你上面顯示:

... 
16 Νοε 2011 4:02:16 μμ org.apache.catalina.core.ContainerBase addChildInternal 
SEVERE: ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152) 
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812) 
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787) 
    .... 

3),但他們也表現出了追溯的重要組成部分:

Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getSessionCookieConfig()Ljavax/servlet/SessionCookieConfig; 
    at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1308) 
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1343) 
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:896) 

4)本例中的根本原因是代碼使用了在Java 6中引入的getSessionCookieConfig(),但他們無意中部署了一個早期的Java6版本的servlet.jar。解決方案是仔細檢查他們的所有部署,確保部署正確的.jar。

'希望可以幫到..

相關問題