아장아장코딩
182
2019-06-12 23:30:17
0
109

Spring setting 중 오류 ..


안녕하세요 현재 java로만 Spring을 셋팅하기에 도전하고 있습니다.


web.xml의 역할을 대신하는 클래스를 하나 만들었습니다.


이 클래스가 tomcat이 실행되면서 loading이 되려면


 ServletContainerInitializer를 상속받고 onStartup을 오버라이딩 하고


resources / META-INF / services / javax.servlet.ServletContainerInitializer라는 파일을 만들어


안에 ServletContainerInitializer를 상속받은 클래스의 이름을 적어주라고 들었습니다. 


이렇게 하고 실행을 하니 ..


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

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

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

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

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

at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1733)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)

at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)

at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)

at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:484)

at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:433)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)

at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)

at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)

at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)

at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)

at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)

at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)

at java.security.AccessController.doPrivileged(Native Method)

at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)

at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)

at sun.rmi.transport.Transport$1.run(Transport.java:200)

at sun.rmi.transport.Transport$1.run(Transport.java:197)

at java.security.AccessController.doPrivileged(Native Method)

at sun.rmi.transport.Transport.serviceCall(Transport.java:196)

at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)

at java.security.AccessController.doPrivileged(Native Method)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

Caused by: java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:348)

at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:186)

at org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:157)

at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1631)

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

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

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

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

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

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

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

... 44 more

Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.WebApplicationContext

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)

at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)

... 56 more


라는 에러가 뜹니다 .. 여기서 주목하고 있는 곳이 


Caused by: java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext


이거 인데 .. Spring-Web을 메이븐에 디펜더시를 추가해서 실제로 자바 파일에서는 저 경로를 인식을 하는데..


왜 못찾는다고 하는걸까요 .. ?


디펜던시를 리임폴트 해도 자꾸 같은 결과가 나옵니다 ㅠ.ㅠ 


제가 무엇을 먼저 확인해봐야 할까요 ? 참고로 현재 intellij를 사용중입니다.


0
0
  • 답변 0

  • 로그인을 하시면 답변을 등록할 수 있습니다.