[jboss-user] [JBoss/Spring Integration] - Re: Bean destroy methods when undeploying
tkyung
do-not-reply at jboss.com
Tue Jul 15 11:38:50 EDT 2008
I checked the mbean defined in the spring deployer and it is using SpringApplicationContextDeployer. Then I threw an exception inside one of the bean's destroy method and it showed up, so after all the destroy method is being called, just that I didn't set up my log correctly. Thanks for the pointers!
Then I noticed the deployed app is registered in JNDI, so I went further to deploy two spring apps (app1 and app2), where in app2 I refer to the app1's context using jndi, like this in app2's applicationContext.xml:
<bean id="app1Context" class="org.springframework.jndi.JndiObjectFactoryBean">
| <property name="jndiName" value="app1"/>
| <property name="expectedType" value="org.springframework.context.support.AbstractApplicationContext"/>
| </bean>
|
The issue is, when I shutdown jboss, I see the message "Failed to stop bean factory app2", and if I remove this bean, the app can be undeployed without failing. It also works if I make this bean prototype scope instead of a singleton. Is there a downside for making this a prototype bean?
Thanks,
Ken
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164535#4164535
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164535
More information about the jboss-user
mailing list