Announcement Announcement Module
Collapse
No announcement yet.
JBoss and its deployment structure Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JBoss and its deployment structure

    Hi,

    I want to switch from including all the needes (spring) JAR files in the WEB-INF/lib directory in my WAR file to the JBoss deployment structure below modules/.

    I'm gut quite far here but now I'm getting the following error which makes no sense to me:

    Code:
    13:04:58,610 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-5) Context initialization failed: org.springframework.context.ApplicationContextException: Custom context class [org.springframework.web.context.support.AnnotationConfigWebApplicationContext] is not of type [org.springframework.web.context.ConfigurableWebApplicationContext]
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:345) [spring-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:281) [spring-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
    	at org.jboss.resteasy.plugins.spring.SpringContextLoaderListener.contextInitialized(SpringContextLoaderListener.java:44) [resteasy-spring-2.2.1.GA.jar:]
    	at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.17.Final-redhat-1.jar:]
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.17.Final-redhat-1.jar:]
    	at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:89) [jboss-as-web-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_38]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_38]
    	at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_38]
    my jboss-deployment-structure.xml looks like this:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <jboss-deployment-structure>
    	<deployment>
    		<exclusions>
    			<module name="org.jboss.as.weld" />
    			<module name="org.jboss.weld.core" />
    			<module name="org.jboss.weld.api" />
    			<module name="org.jboss.weld.spi" />
    		</exclusions>
    		<dependencies> 
    			<module name="org.slf4j" slot="main" services="export" export="true" /> 
    			<module name="org.aspectj" slot="main" services="export" export="true" />
    
    			<module name="org.apache.commons.pool" slot="main" services="export" export="true" />
    			<module name="org.apache.commons.codec" slot="main" services="export" export="true" />
    			<module name="org.apache.commons.dbcp" slot="main" services="export" export="true" />
    			<module name="org.apache.commons.logging" slot="main" services="export" export="true" /> 
    
    			<module name="aopalliance" slot="main" services="export" export="true" /> 
    
    			<module name="org.infinispan" slot="main" services="export" export="true" /> 
    			<module name="org.infinispan.client.hotrod" slot="main" services="export" export="true" /> 
    			<module name="org.infinispan.spring" slot="main" services="export" export="true" /> 
    
    			<module name="org.jboss.resteasy.resteasy-spring" slot="main" services="export" export="true" />
    
    
    			<module name="org.springframework.spring-expression"		slot="3.2.1" services="export" export="true" />
    			<module name="org.springframework.spring-core"				slot="3.2.1" services="export" export="true" />
    			<module name="org.springframework.spring-aop"				slot="3.2.1" services="export" export="true" />
    			<module name="org.springframework.spring-beans"				slot="3.2.1" services="export" export="true" />
    			<module name="org.springframework.spring-context"			slot="3.2.1" services="export" export="true" />
    			<module name="org.springframework.spring-tx"				slot="3.2.1" services="export" export="true" />
    			<module name="org.springframework.spring-jdbc"				slot="3.2.1" services="export" export="true" />
    			<module name="org.springframework.spring-web"				slot="3.2.1" services="export" export="true" />
    			<module name="org.springframework.spring-webmvc"			slot="3.2.1" services="export" export="true" />
    			<module name="org.springframework.spring-context-support"	slot="3.2.1" services="export" export="true" />
    			<module name="org.springframework.spring-jms"				slot="3.2.1" services="export" export="true" />
    			<module name="org.aspectj" slot="main" services="export" export="true" />
    
    			<module name="org.mybatis.mybatis" slot="main" services="export" export="true" />
    			<module name="org.mybatis.mybatis-spring" slot="main" services="export" export="true" />
    		</dependencies>
    	</deployment>
    </jboss-deployment-structure>
    In my web.xml I have:

    Code:
    	<context-param>
    		<javaee:param-name>contextClass</javaee:param-name>
    		<javaee:param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</javaee:param-value>
    	</context-param>
    As long as Spring is build with Maven scope "compile" instead of provided everything is fine.
    Both Classes are inside spring-web so why is one not matching the other?
    Last edited by OlliL; Jun 6th, 2013, 07:20 AM.

  • #2
    Found the problem - resteasy-spring (JBoss module.xml) depended on a different spring than my application depended on.

    Comment

    Working...
    X