我在tomcat-8上运行app时遇到以下错误。我使用的是Eclipse Luna-32位,tomcat-8 32位,Java-8 32位。
INFO: Starting Servlet Engine: Apache Tomcat/8.0.18
Dec 24, 2015 6:36:59 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor E:\PROJECTS\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\connect_afs_ui.xml
Dec 24, 2015 6:36:59 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:connect_afs_ui' did not find a matching property.
Dec 24, 2015 6:36:59 PM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/connect_afs_ui]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:581)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1683)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.StandardRoot@146cf9f]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4832)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4962)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.DirResourceSet@1679622]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.webresources.StandardRoot.initInternal(StandardRoot.java:657)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 14 more
Caused by: java.lang.IllegalArgumentException: The directory specified by base and internal path [C:\Users\ravi.suthar\git\FashionConnect\connect_afs_ui\target\test-classes]\[] does not exist.
at org.apache.catalina.webresources.DirResourceSet.checkType(DirResourceSet.java:247)
at org.apache.catalina.webresources.AbstractFileResourceSet.initInternal(AbstractFileResourceSet.java:134)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 16 more
Dec 24, 2015 6:36:59 PM org.apache.catalina.startup.HostConfig deployDescriptor
SEVERE: Error deploying configuration descriptor E:\PROJECTS\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\connect_afs_ui.xml
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/connect_afs_ui]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:728)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:581)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1683)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Dec 24, 2015 6:36:59 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deployment of configuration descriptor E:\PROJECTS\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\connect_afs_ui.xml has finished in 18 ms
Dec 24, 2015 6:36:59 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
Dec 24, 2015 6:36:59 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Dec 24, 2015 6:36:59 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 303 ms
答案 0 :(得分:8)
我执行了以下步骤并删除了错误。
1. Delete existing tomcat from the eclipse Server tab and remove existing tomcat directory
2. Provide new copy of tomcat in Server tab > add new server
3. Double click on tomcat from server tab
4. In tomcat overview tab, in Server Option
a. unselect > Select modules without publishing
b. unselect > Publish modules contexts to separate XML files
5. Save tomcat changes
6. Add project to tomcat
7. Publish
8. Start / Debug
答案 1 :(得分:0)
我也面临同样的例外。在我的情况下问题是,WEB-INF下的 lib文件夹被我错误地删除了,我开始在项目主文件夹中放置自定义jar并在构建路径中从那里引用。
花了很多时间后我才意识到这个错误,只是更正了目录结构并在WEB-INF下创建了lib文件夹,并在其中放置了自定义jar并从那里引用。它开始起作用了。
答案 2 :(得分:0)
请检查另一个包中是否存在相同的.java文件,如果存在,请删除此.java文件以解决此类型问题。 (Eclipse IDE)