[jboss-user] [JBoss/Spring Integration] - Spring module and war deployed separatly

djeanprost do-not-reply at jboss.com
Tue Jan 16 03:52:57 EST 2007


Hello,

My question may be considered as off-topic, but let me expose my problem. I would like folks here to share their point of view on my issue.

I have a spring module which holds my business implementation. This business implementation is shared between 2 webapps. So what I want to do is to deploy my spring module using spring deployer (what a great feature by the way), and use these beans in my webapps. Both of them are deployed in the deploy dir of jboss.
As I also need the beans classes in my webapp, I also need them in the WEB-INF/lib. The classloading problem is approaching, isn't it ?
ApplicationContext appContext = WebApplicationContextUtils
  |                 .getWebApplicationContext(servletContext);
  |         Object o = appContext.getBean("service.global.idFonctionnel");
  |         ServiceIdFonctionnel serviceIdFonctionnel = (ServiceIdFonctionnel)o; 
This code leads me to a ClassCastException. I precise that the bean do implements the ServiceIdFonctionnel interface.

My questions :
Is spring deployer aimed at this kind of deployment scenario ?
If so, how should I do to avoid this ClassCastException ? Do I have to play with classloading options of my jboss-web.xml ?
If not, this means to me that I can't share spring modules between 2 webapp ?

Thank you for your testimonials and answers.

Best regards,

Dom

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4002161#4002161

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4002161



More information about the jboss-user mailing list