wrkbrs

[JSP] 에러 심각: ContainerBase.addChild: start: 본문

JSP

[JSP] 에러 심각: ContainerBase.addChild: start:

zcarc 2018. 11. 22. 18:18

# 에러 메세지


심각: ContainerBase.addChild: start: 

org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/my_first_web_app]]

 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)

 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)

 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)

 at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:656)

 at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1635)

 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

 at java.util.concurrent.FutureTask.run(Unknown Source)

 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

 at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern> hello.do in servlet mapping

 at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3245)

 at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3220)

 at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1367)

 at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1351)

 at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)

 at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)

 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

 at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)

 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)

 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

 ... 10 more


5월 29, 2014 5:41:48 오후 org.apache.catalina.startup.HostConfig deployDescriptor

심각: Error deploying configuration descriptor C:\Program Files\Apache Software Foundation\Tomcat 7.0\conf\Catalina\localhost\my_first_web_app.xml

java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/my_first_web_app]]

 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)

 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)

 at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:656)

 at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1635)

 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

 at java.util.concurrent.FutureTask.run(Unknown Source)

 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

 at java.lang.Thread.run(Unknown Source)


 


# 해결 방법


소스의 WEB-INF 폴더에 있는 web.xml 내용중


<servlet-mapping>의 <url-pattern>에 "/"가 빠진경우 발생


 


  <servlet>

    <servlet-name>hello_servlet</servlet-name>

    <servlet-class>foo.HelloServlet</servlet-class>

  </servlet>

  <servlet-mapping>

    <servlet-name>hello_servlet</servlet-name>

    <url-pattern>hello.do</url-pattern>

  </servlet-mapping>


 



 


  <servlet>

    <servlet-name>hello_servlet</servlet-name>

    <servlet-class>foo.HelloServlet</servlet-class>

  </servlet>

  <servlet-mapping>

    <servlet-name>hello_servlet</servlet-name>

    <url-pattern>/hello.do</url-pattern>

  </servlet-mapping>


 


로 변경하면 된다.




출처: http://savour75.tistory.com/category/프로그래밍(WEB)/Apache Tomcat [얼렁뚱땅 만들다 보면 프로그램]