Be Yourself ..
Be Yourself ..

Reputation: 21

spring 4.1.6 Release build issue

I am trying to set up a project using spring 4.1.6. I have tried AbstractAnnotationConfigDispatcherServletInitializer with servlet 3.0 but without any luck. I am using websphere version 8.5.5.

After a lot of search I found out the below post for a similar issue and I was bound to use web.xml based configuration.

Cannot deploy Spring App to Websphere

As per the valuable suggestions I have updated the class loader property of websphere and removed the entries from web.xml after which I am facing the below error.

[4/26/15 22:44:09:390 GST] 00000047 AppManagement W   ADMA0116W: Unable to start: SpringSiteEAR using: WebSphere:name=ApplicationManager,process=server1,platform=proxy,node=OICTCSPRJ15Node01,version=8.5.5.0,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=OICTCSPRJ15Node01Cell,spec=1.0 exception is: javax.management.MBeanException: Exception thrown in RequiredModelMBean while trying to invoke operation startApplication
    at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1299)
    at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1088)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:831)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:804)
    at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)
    at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
    at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
    at com.ibm.ws.management.application.AppManagementImpl._startApplication(AppManagementImpl.java:1482)
    at com.ibm.ws.management.application.AppManagementImpl.startApplication(AppManagementImpl.java:1371)
    at com.ibm.ws.management.application.AppManagementImpl.startApplication(AppManagementImpl.java:1320)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:613)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:804)
    at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)
    at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
    at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
    at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:613)
    at com.ibm.ws.management.connector.soap.SOAPConnector.invoke(SOAPConnector.java:478)
    at com.ibm.ws.management.connector.soap.SOAPConnector.service(SOAPConnector.java:312)
    at com.ibm.ws.management.connector.soap.SOAPConnection.handleRequest(SOAPConnection.java:65)
    at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:733)
    at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:532)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)
Caused by: com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: javax.servlet.ServletContainerInitializer: Provider org.springframework.web.SpringServletContainerInitializer could not be instantiated: java.lang.VerifyError: JVMVRFY013 class loading constraint violated&#59&#59; class=org/springframework/web/SpringServletContainerInitializer, method=onStartup&#40&#59;Ljava/util/Set&#59&#59;Ljavax/servlet/ServletContext&#59&#59;&#41&#59;V, pc=0
    at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:432)
    at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1175)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1266)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:613)
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:68)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:613)
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:287)
    at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1256)
    at java.security.AccessController.doPrivileged(AccessController.java:252)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1250)
    ... 40 more
Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: javax.servlet.ServletContainerInitializer: Provider org.springframework.web.SpringServletContainerInitializer could not be instantiated: java.lang.VerifyError: JVMVRFY013 class loading constraint violated&#59&#59; class=org/springframework/web/SpringServletContainerInitializer, method=onStartup&#40&#59;Ljava/util/Set&#59&#59;Ljavax/servlet/ServletContext&#59&#59;&#41&#59;V, pc=0
    at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:759)
    at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
    at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)
    ... 73 more
Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: javax.servlet.ServletContainerInitializer: Provider org.springframework.web.SpringServletContainerInitializer could not be instantiated: java.lang.VerifyError: JVMVRFY013 class loading constraint violated&#59; class=org/springframework/web/SpringServletContainerInitializer, method=onStartup(Ljava/util/Set&#59;Ljavax/servlet/ServletContext&#59;)V, pc=0
    at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:176)
    at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:749)
    ... 75 more
Caused by: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.springframework.web.SpringServletContainerInitializer could not be instantiated: java.lang.VerifyError: JVMVRFY013 class loading constraint violated; class=org/springframework/web/SpringServletContainerInitializer, method=onStartup(Ljava/util/Set;Ljavax/servlet/ServletContext;)V, pc=0
    at java.util.ServiceLoader.fail(ServiceLoader.java:235)
    at java.util.ServiceLoader.access$100(ServiceLoader.java:192)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:388)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:456)
    at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:535)
    at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:409)
    at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
    at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
    ... 76 more
Caused by: java.lang.VerifyError: JVMVRFY013 class loading constraint violated; class=org/springframework/web/SpringServletContainerInitializer, method=onStartup(Ljava/util/Set;Ljavax/servlet/ServletContext;)V, pc=0
    at java.lang.J9VMInternals.verifyImpl(Native Method)
    at java.lang.J9VMInternals.verify(J9VMInternals.java:93)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:170)
    at java.lang.J9VMInternals.newInstanceImpl(Native Method)
    at java.lang.Class.newInstance(Class.java:1600)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:384)
    ... 81 more

web.xml contents after enabling the class loader property and removing the servlet configs.

  <?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="3.0"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    metadata-complete="false">
    <servlet>
        <display-name>SpringSite</display-name>
        <display-name>SpringSiteStartup</display-name>
        <servlet-name>SpringSiteStartup</servlet-name>
        <servlet-class>main.java.springsite.startup.SpringSiteStartup</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <security-role>
        <role-name>User</role-name>
    </security-role>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>secure connection</web-resource-name>
            <url-pattern>/*</url-pattern>
            <http-method>DELETE</http-method>
            <http-method>GET</http-method>
            <http-method>POST</http-method>
            <http-method>PUT</http-method>
            <http-method>HEAD</http-method>
        </web-resource-collection>
        <user-data-constraint>
            <description>SSL or MSSL not required</description>
            <transport-guarantee>NONE</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

Please find the below pom.xml I am using

    <repositories>
    <repository>
        <id>spring-snasphot</id>
        <url>https://repo.spring.io/snapshot</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-jpa</artifactId>
        <version>1.8.0.RELEASE</version>
        <scope>compile</scope>
        <exclusions>
            <exclusion>
                <artifactId>aspectjrt</artifactId>
                <groupId>org.aspectj</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aspects</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-expression</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-instrument</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jms</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-oxm</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.thymeleaf.extras</groupId>
        <artifactId>thymeleaf-extras-tiles2-spring4</artifactId>
        <version>2.1.1.RELEASE</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf-spring4</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <scope>compile</scope>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-taglibs</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>servlet-api</artifactId>
        <version>3.0.20100224</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp.jstl</groupId>
        <artifactId>jstl-api</artifactId>
        <version>1.2</version>
        <exclusions>
            <exclusion>
                <artifactId>servlet-api</artifactId>
                <groupId>javax.servlet</groupId>
            </exclusion>
        </exclusions>
        <scope>provided</scope>
    </dependency>       
    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
        <version>${cglib.version}</version>
    </dependency>
    <dependency>
        <groupId>aopalliance</groupId>
        <artifactId>aopalliance</artifactId>
        <version>1.0</version>
    </dependency>
</dependencies>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.spring.platform</groupId>
            <artifactId>platform-bom</artifactId>
            <version>1.1.2.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

Find the below mvn dependency:tree output for my project

[INFO] +- org.springframework.data:spring-data-jpa:jar:1.8.0.RELEASE:compile
[INFO] |  +- org.springframework.data:spring-data-commons:jar:1.9.2.RELEASE:compile (version managed from 1.10.0.RELEASE)
[INFO] |  |  +- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 4.0.9.RELEASE; omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-beans:jar:4.1.6.RELEASE:compile - version managed from 4.0.9.RELEASE; omitted for duplicate)
[INFO] |  |  +- (org.slf4j:slf4j-api:jar:1.7.11:compile - version managed from 1.7.10; omitted for duplicate)
[INFO] |  |  \- (org.slf4j:jcl-over-slf4j:jar:1.7.11:runtime - version managed from 1.7.10; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-orm:jar:4.1.6.RELEASE:compile - version managed from 4.0.9.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-context:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-aop:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-tx:jar:4.1.6.RELEASE:compile - version managed from 4.0.9.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-beans:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.11:compile
[INFO] |  \- (org.slf4j:jcl-over-slf4j:jar:1.7.11:compile - version managed from 1.7.6; scope updated from runtime; omitted for duplicate)
[INFO] +- org.springframework.security:spring-security-config:jar:3.2.7.RELEASE:compile
[INFO] |  +- (aopalliance:aopalliance:jar:1.0:compile - omitted for duplicate)
[INFO] |  +- org.springframework.security:spring-security-core:jar:3.2.7.RELEASE:compile
[INFO] |  |  +- (aopalliance:aopalliance:jar:1.0:compile - omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-aop:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-beans:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-context:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  |  \- (org.springframework:spring-expression:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-aop:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-beans:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-context:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  \- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] +- org.springframework.security:spring-security-web:jar:3.2.7.RELEASE:compile
[INFO] |  +- (aopalliance:aopalliance:jar:1.0:compile - omitted for duplicate)
[INFO] |  +- (org.springframework.security:spring-security-core:jar:3.2.7.RELEASE:compile - omitted for duplicate)
[INFO] |  +- (org.springframework:spring-beans:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-context:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-expression:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  \- (org.springframework:spring-web:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] +- org.springframework:spring-aop:jar:4.1.6.RELEASE:compile
[INFO] |  +- (aopalliance:aopalliance:jar:1.0:compile - omitted for duplicate)
[INFO] |  +- (org.springframework:spring-beans:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  \- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] +- org.springframework:spring-aspects:jar:4.1.6.RELEASE:compile
[INFO] |  \- org.aspectj:aspectjweaver:jar:1.8.5:compile
[INFO] +- org.springframework:spring-beans:jar:4.1.6.RELEASE:compile
[INFO] |  \- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] +- org.springframework:spring-context:jar:4.1.6.RELEASE:compile
[INFO] |  +- (org.springframework:spring-aop:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-beans:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  \- (org.springframework:spring-expression:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] +- org.springframework:spring-context-support:jar:4.1.6.RELEASE:compile
[INFO] |  +- (org.springframework:spring-beans:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-context:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  \- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] +- org.springframework:spring-core:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework:spring-expression:jar:4.1.6.RELEASE:compile
[INFO] |  \- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] +- org.springframework:spring-instrument:jar:4.1.6.RELEASE:compile
[INFO] +- org.springframework:spring-jdbc:jar:4.1.6.RELEASE:compile
[INFO] |  +- (org.springframework:spring-beans:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  \- (org.springframework:spring-tx:jar:4.1.6.RELEASE:compile - version managed from 4.0.9.RELEASE; omitted for duplicate)
[INFO] +- org.springframework:spring-jms:jar:4.1.6.RELEASE:compile
[INFO] |  +- (org.springframework:spring-aop:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-beans:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-context:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- org.springframework:spring-messaging:jar:4.1.6.RELEASE:compile
[INFO] |  |  +- (org.springframework:spring-beans:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-context:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  |  \- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  \- (org.springframework:spring-tx:jar:4.1.6.RELEASE:compile - version managed from 4.0.9.RELEASE; omitted for duplicate)
[INFO] +- org.springframework:spring-orm:jar:4.1.6.RELEASE:compile
[INFO] |  +- (org.springframework:spring-beans:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-jdbc:jar:4.1.6.RELEASE:compile - omitted for duplicate)
[INFO] |  \- (org.springframework:spring-tx:jar:4.1.6.RELEASE:compile - version managed from 4.0.9.RELEASE; omitted for duplicate)
[INFO] +- org.springframework:spring-oxm:jar:4.1.6.RELEASE:compile
[INFO] |  +- (org.springframework:spring-beans:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  \- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] +- org.springframework:spring-test:jar:4.1.6.RELEASE:compile
[INFO] |  \- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] +- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.1.3:test
[INFO] |  +- ch.qos.logback:logback-core:jar:1.1.3:test
[INFO] |  \- (org.slf4j:slf4j-api:jar:1.7.11:test - version managed from 1.7.7; omitted for duplicate)
[INFO] +- junit:junit:jar:4.11:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.springframework.security:spring-security-taglibs:jar:3.2.7.RELEASE:compile
[INFO] |  +- org.springframework.security:spring-security-acl:jar:3.2.7.RELEASE:compile
[INFO] |  |  +- (aopalliance:aopalliance:jar:1.0:compile - omitted for duplicate)
[INFO] |  |  +- (org.springframework.security:spring-security-core:jar:3.2.7.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-aop:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-context:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-jdbc:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  |  \- (org.springframework:spring-tx:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework.security:spring-security-core:jar:3.2.7.RELEASE:compile - omitted for duplicate)
[INFO] |  +- (org.springframework.security:spring-security-web:jar:3.2.7.RELEASE:compile - omitted for duplicate)
[INFO] |  +- (org.springframework:spring-aop:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-beans:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-context:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-core:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  +- (org.springframework:spring-expression:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] |  \- (org.springframework:spring-web:jar:4.1.6.RELEASE:compile - version managed from 3.2.13.RELEASE; omitted for duplicate)
[INFO] +- org.mortbay.jetty:servlet-api:jar:3.0.20100224:provided
[INFO] +- javax.servlet.jsp:jsp-api:jar:2.1:provided
[INFO] +- javax.servlet:jstl:jar:1.2:provided
[INFO] +- javax.servlet.jsp.jstl:jstl-api:jar:1.2:provided
[INFO] |  \- (javax.servlet.jsp:jsp-api:jar:2.1:provided - omitted for duplicate)
[INFO] +- cglib:cglib:jar:3.1:compile
[INFO] |  \- org.ow2.asm:asm:jar:4.2:compile
[INFO] \- aopalliance:aopalliance:jar:1.0:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

I am stuck with this for the last few days without any luck.

Upvotes: 1

Views: 3951

Answers (1)

Be Yourself ..
Be Yourself ..

Reputation: 21

Hey guys for me the issue was with the default websphere servlet container. As I was using the class loader policy of parent last websphere was loading the servlet classes after the spring webmvc classes are loaded. Hence spring while loading the starter classes was failing during the verify stage (Details Here).

I have changed the "servlet" and "servlet jsp" jars scope to be "compiled" instead of "provided" for the solution to work. Find my modified dependencies below:

    <repositories>
        <repository>
            <id>spring-snasphot</id>
            <url>https://repo.spring.io/snapshot</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jpa</artifactId>
            <version>1.8.0.RELEASE</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <artifactId>aspectjrt</artifactId>
                    <groupId>org.aspectj</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-expression</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-instrument</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-oxm</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.thymeleaf.extras</groupId>
            <artifactId>thymeleaf-extras-tiles2-spring4</artifactId>
            <version>2.1.1.RELEASE</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.thymeleaf.extras</groupId>
            <artifactId>thymeleaf-extras-springsecurity4</artifactId>
            <version>2.1.2.RELEASE</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.thymeleaf</groupId>
            <artifactId>thymeleaf-spring4</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <scope>compile</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>servlet-api</artifactId>
            <version>3.0.20100224</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp.jstl</groupId>
            <artifactId>jstl-api</artifactId>
            <version>1.2</version>
            <exclusions>
                <exclusion>
                    <artifactId>servlet-api</artifactId>
                    <groupId>javax.servlet</groupId>
                </exclusion>
            </exclusions>
            <scope>compile</scope>
        </dependency>       
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
            <version>${cglib.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>aopalliance</groupId>
            <artifactId>aopalliance</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-api</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-core</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-jsp</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-servlet</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-template</artifactId>
            <version>3.0.5</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.webflow</groupId>
            <artifactId>spring-js</artifactId>
            <scope>compile</scope>
        </dependency>       
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.spring.platform</groupId>
                <artifactId>platform-bom</artifactId>
                <version>1.1.2.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

You can also install the fix pack for known websphere issue in case you have AOP functionality included.

Thank you friends for helping me resolve this. The suggestions provided were really helpful.

Upvotes: 1

Related Questions