[jboss-user] [Spring Integration] - JBoss 5.1.0 and Multiple EARs and EJBs using the SpringBeanAutowiringInterceptor issue
Kyle Bober
do-not-reply at jboss.com
Tue Jun 1 11:33:57 EDT 2010
Kyle Bober [http://community.jboss.org/people/kyle.bober] replied to the discussion
"JBoss 5.1.0 and Multiple EARs and EJBs using the SpringBeanAutowiringInterceptor issue"
To view the discussion, visit: http://community.jboss.org/message/545656#545656
--------------------------------------------------------------
I agree Marius. I think it has to do with the isolation at the EAR level. I have set the EAR classloader isolation to true as such in the ear-deployer-jboss-beans.xml file:
<bean name="EARClassLoaderDeployer">
<!-- A flag indicating if ear deployments should have their own scoped
class loader to isolate their classes from other deployments.
-->
<property name="isolated">true</property>
</bean>
This now causes another issue to rear its ugly head. When I attempt to deploy my EAR now I receive the following exception:
11:25:11,500 INFO [[/ChannelService]] Initializing Spring root WebApplicationContext
11:25:11,500 INFO [ContextLoader] Root WebApplicationContext: initialization started
11:25:11,562 INFO [ClassPathXmlApplicationContext] Refreshing org.springframework.context.support.ClassPathXmlApplicationContext at 1501c9a: display name [org.springframework.context.support.ClassPathXmlApplicationContext at 1501c9a]; startup date [Tue Jun 01 11:25:11 EDT 2010]; root of context hierarchy
11:25:11,656 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from URL [vfszip:/C:/ApplicationServers/jboss-5.1.0.GA/server/default/deploy/channel-service-0.0.1--SNAPSHOT.ear/beanRefContext.xml]
11:25:11,718 INFO [ClassPathXmlApplicationContext] Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext at 1501c9a]: org.springframework.beans.factory.support.DefaultListableBeanFactory at afacf1
11:25:11,734 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory at afacf1: defining beans [ear.context]; root of factory hierarchy
11:25:11,812 INFO [VFSClassPathXmlApplicationContext] Refreshing org.jboss.spring.vfs.context.VFSClassPathXmlApplicationContext at 3e68f4: display name [org.jboss.spring.vfs.context.VFSClassPathXmlApplicationContext at 3e68f4]; startup date [Tue Jun 01 11:25:11 EDT 2010]; root of context hierarchy
11:25:11,812 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from ZipEntryHandler at 23845366[path=channel-service-0.0.1--SNAPSHOT.ear/lib/channel-service-dao-0.0.1-SNAPSHOT.jar/channel-dao-applicationContext.xml context=file:/C:/ApplicationServers/jboss-5.1.0.GA/server/default/deploy/ real=file:/C:/ApplicationServers/jboss-5.1.0.GA/server/default/deploy/channel-service-0.0.1--SNAPSHOT.ear/lib/channel-service-dao-0.0.1-SNAPSHOT.jar/channel-dao-applicationContext.xml]
11:25:11,859 INFO [VFSClassPathXmlApplicationContext] Bean factory for application context [org.jboss.spring.vfs.context.VFSClassPathXmlApplicationContext at 3e68f4]: org.springframework.beans.factory.support.DefaultListableBeanFactory at 1cd8006
11:25:11,906 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory at 1cd8006: defining beans [dataSource,transactionManager,DatabaseInstanceDAO,BusinessUnitDAO,ChannelDAO,DistributionDAO,ReportColumnDAO,ProductDAO,DatabaseInstancePersistentManager,ChannelPersistentManager,DistributionPersistentManager,ReportColumnPersistentManager,ProductPersistentManager]; root of factory hierarchy
11:25:12,171 INFO [XmlWebApplicationContext] Refreshing org.springframework.web.context.support.XmlWebApplicationContext at 1866052: display name [Root WebApplicationContext]; startup date [Tue Jun 01 11:25:12 EDT 2010]; parent: ear.context
11:25:12,171 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [channel-dao-applicationContext.xml]
11:25:12,203 INFO [XmlWebApplicationContext] Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext at 1866052]: org.springframework.beans.factory.support.DefaultListableBeanFactory at 63b075
11:25:12,218 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory at 63b075: defining beans [dataSource,transactionManager,DatabaseInstanceDAO,BusinessUnitDAO,ChannelDAO,DistributionDAO,ReportColumnDAO,ProductDAO,DatabaseInstancePersistentManager,ChannelPersistentManager,DistributionPersistentManager,ReportColumnPersistentManager,ProductPersistentManager]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory at 1cd8006
11:25:12,218 INFO [ContextLoader] Root WebApplicationContext: initialization completed in 718 ms
11:25:12,328 ERROR [[/ChannelService]] StandardWrapper.Throwable
java.lang.ClassCastException: org.springframework.web.context.support.XmlWebApplicationContext cannot be cast to java.lang.Exception
at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:96)
at org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:70)
at org.jboss.wsf.stack.cxf.CXFServletExt.loadBus(CXFServletExt.java:100)
at org.apache.cxf.transport.servlet.AbstractCXFServlet.init(AbstractCXFServlet.java:90)
at org.jboss.wsf.stack.cxf.CXFServletExt.init(CXFServletExt.java:77)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4421)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
at $Proxy38.start(Unknown Source)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
at org.jboss.system.ServiceController.start(ServiceController.java:460)
at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
11:25:12,328 ERROR [[/ChannelService]] Servlet /ChannelService threw load() exception
java.lang.ClassCastException: org.springframework.web.context.support.XmlWebApplicationContext cannot be cast to java.lang.Exception
at org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:96)
at org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:70)
at org.jboss.wsf.stack.cxf.CXFServletExt.loadBus(CXFServletExt.java:100)
at org.apache.cxf.transport.servlet.AbstractCXFServlet.init(AbstractCXFServlet.java:90)
at org.jboss.wsf.stack.cxf.CXFServletExt.init(CXFServletExt.java:77)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4421)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
at $Proxy38.start(Unknown Source)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
at org.jboss.system.ServiceController.start(ServiceController.java:460)
at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
We are using the JBossWS Apache CXF 3.2.0. webservice stack. I know this uses Spring 2.5.5 internally. For our application code we are using Spring 2.5.6 and it is included in the common lib directory of the EAR file. I have a feeling that the two versions are conflicting now. Any ideas on how to resolve this???
Is there a way to resolve this without EAR classloader isolation set to true?
Thanks for you help once again,
Kyle
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/545656#545656]
Start a new discussion in Spring Integration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2082]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100601/9aebb473/attachment-0001.html
More information about the jboss-user
mailing list