I'm starting to learn Spring framework and almost from start faced with an issue: as I'm developing in IntellijIDEA, i didn't found it easy to configure spring mvc project. Having been deployed to Glassfish, the project constantly gives me an error
java.io.IOException: com.sun.enterprise.admin.remote.RemoteFailureException: Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener. Please see server.log for more details.
Also, watching Glassfish log all I see is:
org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/springframework/core/io/Resource
and a bunch of similar thrown exceptions.
Here is my context-param configuration made in web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config/spring/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
What can be done with this? Here's the github project: https://github.com/vaano94/Project
This should have nothing to do with your dependencies resolution at compile time since you can compile your project and the configuration seems quite fine in your project descriptor.
However, as you are receiving a set of ClassNotFoundException
, that means that the application server is not able to find some classes at runtime, those basically related to Spring, so you have to review your project artifact dependencies.
Within Intellij IDEA: