0 Replies Latest reply on Jul 18, 2011 6:47 AM by Sebastian Koske

    Problem using Spring-XML-Files in WebApp

    Sebastian Koske Newbie

      Hi,

       

      I'm using Spring in my webapp. The Spring Context is configured in

       

      WEB-INF/classes/my-applicationContext.xml

       

      the web.xml activates Spring with:

       

         <context-param>

            <param-name>contextConfigLocation</param-name>

            <param-value>classpath*:my-applicationContext.xml</param-value>

         </context-param>

       

         <listener>

            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

         </listener>

       

      This used to work fine in AS 6 and earlier. When I deploy this to 7.0.0.FINAL I get the following error:

       

      12:37:24,459 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/myweb]] (MSC service thread 1-5) Except

      ion sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframewo

      rk.context.ApplicationContextException: Custom context class [org.springframework.web.context.support.XmlWebApplicationContext] is not of ty

      pe [org.springframework.web.context.ConfigurableWebApplicationContext]

              at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:232) [spring-2.0.8.jar:]

              at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189) [spring-2.0.8.jar:]

              at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) [spring-2.0.8.jar:]

              at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

              at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.0.Final.jar:7.0.0.Final]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)

              at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0-ea]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0-ea]

              at java.lang.Thread.run(Thread.java:732) [:1.7.0-ea]

       

      I have all spring libs included in my WAR under lib. It seems like a classloading-bug to me or am I doing something wrong. Is there anything I can try?