View Full Version : Resin 3.1 - Host level beans

11-23-2009, 09:04 PM

I am using Resin 3.1. I want to define a <bean> in a <host>. I want the bean to be initialized before the web apps are loaded.

<bean ...>
<web-app-deploy ...>

When I try this, the bean's init method is called after the web apps are deployed. I expected the bean to be initialized first.

Are my expectations incorrect? Is there an attribute that controls when the bean is initialized?


11-25-2009, 05:11 PM
Hi Ed,

That's true, but beans in the webapps are initialized after beans in the host, which might help for your application. In other words, the order is:

Initialize webapps
Initialize host beans
Initialize webapp beans

So you should see the @PostConstruct/init() method of your host bean executed first. You can then inject the bean into a webapp bean.

Does that help? If not, can you give me more information about what you're trying to achieve?


11-25-2009, 05:31 PM
Yes, that helps. Thanks.