Developer Developer - 3 months ago 37
Java Question

Context initialization failed due to org.springframework.core.ResolvableTypeProvider

I upgraded Spring from version 1.5.8 to version 4.2.3.RELEASE. Project compiles fine but when i start tomcat i get following error.

INFO: Initializing Spring root WebApplicationContext
02 Sep 2016 21:07:46,235 INFO ContextLoader:285 - Root WebApplicationContext: initialization started
02 Sep 2016 21:07:46,264 ERROR ContextLoader:336 - Context initialization failed
java.lang.NoClassDefFoundError: org/springframework/core/ResolvableTypeProvider
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:3116)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:1344)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1825)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1705)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)
at java.lang.Class.getConstructor0(Class.java:2885)
at java.lang.Class.getDeclaredConstructor(Class.java:2058)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:360)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5077)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5591)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
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:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1095)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1957)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.ResolvableTypeProvider
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1856)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1705)
... 28 more


Below is the pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.nationalpayment.cp20</groupId>
<artifactId>wsrv</artifactId>
<packaging>war</packaging>
<version>versionUpgrade-SNAPSHOT</version>
<name>wsrv Spring-WS Application</name>
<url>http://www.springframework.org/spring-ws</url>
<repositories>
<repository>
<id>Finxera</id>
<name>Finxera Repo</name>
<url>http://10.10.200.125:8081/nexus/content/groups/public</url>
<layout>default</layout>
</repository>
</repositories>


<reporting>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<stylesheetfile>${basedir}/../../src/main/javadoc/javadoc.css</stylesheetfile>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<!-- <version>2.5.1</version> -->
<version>3.0.0</version>
<configuration>
<findbugsXmlOutput>true</findbugsXmlOutput>
<findbugsXmlWithMessages>true</findbugsXmlWithMessages>
<xmlOutput>true</xmlOutput>
<!-- <excludeFilterFile>${project.basedir}/conf/findbugs-exclude.xml</excludeFilterFile> -->
<effort>Max</effort>
</configuration>
</plugin>
</plugins>
</reporting>
<pluginRepositories>
<pluginRepository>
<id>Finxera Repo</id>
<url>http://10.10.200.125:8081/nexus/content/groups/public/</url>
</pluginRepository>
</pluginRepositories>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>

<filtering>true</filtering>
</resource>
<!--<resource> <directory>src/main/resources</directory> <excludes> <exclude>**/*.properties</exclude>
</excludes> <filtering>false</filtering> </resource> -->
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<!-- <version>2.5.1</version> -->
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<configuration>
<file>pom.xml</file>
<replacements>
<replacement>
<token>${current.build.version}</token>
<value>${replacer.current.build.version}</value>
</replacement>
</replacements>
</configuration>
</plugin>
<plugin>
<groupId>com.google.code.maven-svn-revision-number-plugin</groupId>
<artifactId>maven-svn-revision-number-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<!-- put your configurations here -->
<configuration>
<entries>
<entry>
<prefix>CPIIWSRV-svn</prefix>
</entry>
</entries>
</configuration>
<dependencies>
<dependency>
<groupId>org.tmatesoft.svnkit</groupId>
<artifactId>svnkit</artifactId>
<version>1.8.0-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
<!-- <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId>
<version>1.2</version> <configuration> <source>1.6</source> <verbose>true</verbose>
<complianceLevel>1.6</complianceLevel> <showWeaveInfo>true</showWeaveInfo>
<aspectLibraries> <aspectLibrary> <groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId> </aspectLibrary> </aspectLibraries>
</configuration> <executions> <execution> <goals> <goal>compile</goal> </goals>
</execution> </executions> <dependencies> <dependency> <groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId> <version>1.6.6</version> </dependency>
<dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjtools</artifactId>
<version>1.6.6</version> </dependency> </dependencies> </plugin> -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<!-- <version>1.2</version> -->
<version>1.6</version>
<configuration>
<source>1.7</source>
<verbose>true</verbose>
<complianceLevel>1.7</complianceLevel>
<showWeaveInfo>true</showWeaveInfo>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>

<plugin>
<groupId>eviware</groupId>
<artifactId>maven-soapui-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<projectFile>src/test/soap-ui-tests/webservicetestsuite1.xml</projectFile>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>1.7</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<!-- <plugin> <groupId>com.sun.tools.xjc.maven2</groupId> <artifactId>maven-jaxb-plugin</artifactId>
<version>1.1.1</version> <executions> <execution> <phase>generate-sources</phase>
<goals> <goal>generate</goal> </goals> </execution> </executions> <configuration>
<generatePackage>net.nationalpayment.cp20.ws.schema</generatePackage> <schemaDirectory>src/main/webapp/</schemaDirectory>
</configuration> </plugin> -->

<!-- Added for Stack Upgrade starts -->
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.12.3</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<generatePackage>net.nationalpayment.cp20.ws.schema</generatePackage>
<schemaDirectory>src/main/webapp/</schemaDirectory>
<!-- <generateDirectory>${project.build.directory}/generated-sources/kyc</generateDirectory> -->
<generateDirectory>src/main/java/</generateDirectory>
<verbose>true</verbose>
</configuration>
</plugin>
<!-- Added for Stack Upgrade ends -->

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>
<dependencies>

<!-- Added for Stack Upgrade starts -->
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>javax.transaction-api</artifactId>
<version>1.2</version>
</dependency>

<!-- Added for Stack Upgrade ends -->


<!--dependencies of npn packages -->

<dependency>
<groupId>net.nationalpayment.cp20</groupId>
<artifactId>services</artifactId>
<version>${current.build.version}</version>
</dependency>

<!--end dependencies of npn packages -->

<!-- Spring-WS dependencies -->
<!-- <dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-xml</artifactId>
<version>2.2.0.RELEASE</version>
</dependency> -->

<!-- Added for Stack Upgrade starts -->

<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-xml</artifactId>
<version>${spring.ws.version}</version>
</dependency>

<!-- Added for Stack Upgrade ends -->

<!-- <dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
<version>2.2.4.RELEASE</version>
</dependency> -->

<!-- Added for Stack Upgrade starts -->

<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
<version>${spring.ws.version}</version>
</dependency>

<!-- Added for Stack Upgrade ends -->

<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core-tiger</artifactId>
<version>1.5.10</version>
</dependency>

<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-oxm</artifactId>
<version>1.5.10</version>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-oxm-tiger</artifactId>
<version>1.5.10</version>
<scope>runtime</scope>
</dependency>

<!-- <dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-support</artifactId>
<version>2.2.0.RELEASE</version>
<scope>runtime</scope>
</dependency> -->

<!-- Added for Stack Upgrade starts -->

<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-support</artifactId>
<version>${spring.ws.version}</version>
<scope>runtime</scope>
</dependency>

<!-- Added for Stack Upgrade ends -->

<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-security</artifactId>
<!-- <version>2.2.0.RELEASE</version> -->
<version>${spring.ws.version}</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>org.apache.ws.security</groupId>
<artifactId>wss4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-api</artifactId>
<version>${cxf.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.neethi</groupId>
<artifactId>neethi</artifactId>
<version>3.0.2</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.1.1</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- JEE dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
<version>1.3.25</version>
<scope>runtime</scope>

</dependency>

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>2.0.2</version>
<exclusions>
<exclusion>
<!-- declare the exclusion here -->
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core-tiger</artifactId>
<version>2.0.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.schema</groupId>
<artifactId>XmlSchema</artifactId>
<version>1.4.7</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>

<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>

<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>1.9.2</version>
<scope>compile</scope>
</dependency>


<!-- Test dependencies -->
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<scope>test</scope>
<version>2.2</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.2</version>
</dependency>
</dependencies>
<properties>
<!-- Database settings -->
<dbunit.dataTypeFactoryName>org.dbunit.ext.mysql.MySqlDataTypeFactory</dbunit.dataTypeFactoryName>
<hibernate.dialect>org.hibernate.dialect.MySQL5InnoDBDialect</hibernate.dialect>
<jdbc.groupId>mysql</jdbc.groupId>
<jdbc.artifactId>mysql-connector-java</jdbc.artifactId>
<cxf.version>2.6.0</cxf.version>
<jdbc.version>5.1.28</jdbc.version>
<jdbc.driverClassName>com.mysql.jdbc.Driver</jdbc.driverClassName>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<timestamp>${maven.build.timestamp}</timestamp>


<!-- Added for Stack Upgrade starts -->

<aspectj.version>1.7.4</aspectj.version>
<spring.version>4.2.3.RELEASE</spring.version>
<spring.ws.version>2.2.0.RELEASE</spring.ws.version>
<!-- <dao.framework>hibernate</dao.framework> <web.framework>spring</web.framework>
<commons.fileupload.version>1.2.1</commons.fileupload.version> <commons.io.version>1.3.2</commons.io.version>
<hibernate.version>4.0.1.Final</hibernate.version> <spring.version>4.2.3.RELEASE</spring.version> -->

<!-- Added for Stack Upgrade ends -->



<wsrv.timestamp>${timestamp}</wsrv.timestamp>
<maven.build.timestamp.format>yyyy-MM-dd_HH-mm-ss</maven.build.timestamp.format>
<current.build.version>versionUpgrade-SNAPSHOT</current.build.version>

</properties>

</project>


Below is web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>ws</servlet-name>
<servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ws</servlet-name>
<url-pattern>/services</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ws</servlet-name>
<url-pattern>/service</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ws</servlet-name>
<url-pattern>*.wsdl</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>mvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>

<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/cftRest/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/cftAuth/*</url-pattern>
</servlet-mapping>

<filter>
<filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
<filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<!--PBE encription configs-->
<servlet>
<servlet-name>webPBEConfigServlet</servlet-name>
<servlet-class>
org.jasypt.web.pbeconfig.WebPBEConfigServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>webPBEConfigServlet</servlet-name>
<url-pattern>/webPBEConfig.do</url-pattern>
</servlet-mapping>


<filter>
<filter-name>webPBEConfigFilter</filter-name>
<filter-class>org.jasypt.web.pbeconfig.WebPBEConfigFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>webPBEConfigFilter</filter-name>
<servlet-name>ws</servlet-name>
</filter-mapping>

<mime-mapping>
<extension>xsd</extension>
<mime-type>text/xml</mime-type>
</mime-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>file:${CONFIG_PATH}/log4j.properties</param-value>
</context-param>

<context-param>
<param-name>log4jRefreshInterval</param-name>
<param-value>1000</param-value>
</context-param>

<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>


</web-app>


Any help would be greatly appreciated.I am using Eclipse and Maven3.

Answer

You're missing this dependency:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
 </dependency>
Comments