This content has been marked as final.
Show 2 replies
-
1. Re: Servlet depending on MBean: loading order
peterj Jul 1, 2009 12:58 PM (in response to sanches)Try adding a depends clause to the WEB-INF/jboss-web.xml file:
<?xml version="1.0"?> <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd"> <jboss-web> <depends>-the mbean name goes here-</depends> </jboss-web>
-
2. Re: Servlet depending on MBean: loading order
sanches Jul 1, 2009 2:04 PM (in response to sanches)PeterJ, thanks a lot!
This is correct solution.
That way I am also able to use
<load-on-startup>1</load-on-startup>
in web.xml
I had tried adding similar construction before (but as injection into servlet), and it did not work:@Depends({"-the mbean name goes here-"}) public class JMSEventListenerServlet extends HttpServlet { ..
I did get error about not bound JNDI name (that was JMS resource, actually)
Could you explain please what is the difference between your working solution and that one, which is not?