Hot Deployment using jboss deployer
brobertarch Jan 6, 2006 11:41 AMI wanted to use jboss/deployer to add spring functionality but hot deploy does not work.
Why I wanted to use JBoss/Deployer?
- Because it looked like an official deployer like Hibernate deployer in deploy folder when using JBoss 4.0.2
- Because just by ending my spring config file name with -spring.xml and putting
<description>BeanFactory=(mySpringBean-pojo)</description>tag and packaging it in my jar file all of it using maven2 was wonderful.
Unfortunately it does not work when re-HOT-deploying my ears.
I use 3 approaches:
- 1) from Rod Harrop ProSpring book hoping it would be portable from JBoss to Geronimo. By using
org.springframework.ejb.support.AbstractJmsMessageDrivenBean;it didn't work. see problem cause below
- 2) from JBoss/Deployer same thing. I do know that jboss deployer is intended to be used with EJB3 but it still works by calling
org.jboss.spring.factory.NamedXmlBeanFactory bfl = (org.jboss.spring.factory.NamedXmlBeanFactory)initialContext.lookup("my-spring-pojo"); dispatchManager = (DispatchManager) bfl.getBean("myDispatchManager");
- 3) Than I gave up and used a simple MBean that loads the spring mbeans as JNDI objects. From an MBean sample we had to modify to use Durable WS MQ Topics.
http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingWebSphereMQSeriesWithJBossASPartI
and Hot deploy works. I won't know the impact on the memory yet but I'll try to find out by using MBean console monitors.
Problem Caused by WeakReferenceMonitor.ReleaseListener?
What I noticed is that the beans are released just before ehcache when using Hibernate from Spring.
11:31:58,365 WARN [Configurator] No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: null
11:31:58,365 ERROR [LogInterceptor] TransactionRolledbackLocalException in method: public abstract void javax.jms.Messag
11:32:00,474 INFO [NamedXmlBeanFactory] Destroying singletons in factory {org.jboss.spring.factory.NamedXmlBeanFactory
11:31:58,365 ERROR [LogInterceptor] TransactionRolledbackLocalException in method: public abstract void javax.jms.Messag
11:32:00,474 INFO [NamedXmlBeanFactory] Destroying singletons in factory {org.jboss.spring.factory.NamedXmlBeanFactory
By using an in house MBean [than can be ported to a Geronimo GBean ], I resolved my problem but wanted to know if someone has faced the same problem.