This content has been marked as final.
Show 3 replies
-
1. Re: How to get the Catalina Container from an EJB
starksm64 Apr 1, 2004 1:26 PM (in response to james.clover)I've thought about a JMX invoker into the web container but have not had a chance to look into it. I would be starting with the Tomcat 5 source however since its the more MBean friendly architecture.
-
2. Re: How to get the Catalina Container from an EJB
james.clover Apr 1, 2004 1:29 PM (in response to james.clover)I think I found in under TC5 - I'll post the details here when I have it verified.
-
3. Re: How to get the Catalina Container from an EJB
james.clover Apr 7, 2004 7:53 PM (in response to james.clover)Ok, I've found how to get the Container object for a web application using 3.2.4 or 4.0 and TC5. Here's a snippet:
InitialContext ic = new InitialContext(); RMIAdaptor rmiServer = (RMIAdaptor) ic.lookup("jmx/rmi/RMIAdaptor"); ObjectName name = new ObjectName("jboss.web:j2eeType=WebModule,name=//localhost/<web app name here>, J2EEApplication=none,J2EEServer=none"); org.apache.catalina.Manager manager = (org.apache.catalina.Manager) rmiServer.getAttribute(name, "manager"); org.apache.catalina.core.StandardContext container = (org.apache.catalina.core.StandardContext) manager.getContainer();
That will give you the Container object that has the prized invoke(request, response) method in it. However, I'm having a very hard time building my request; there doesn't seem to be a easy way to build it so that TC5 will recognize it and call the JSP/Servlet. In TC4, there was a base class for the Request objects, TC5 is full of wrappers on wrappers.
So, this is a question for any TC5 gurus out there: how can I correctly build my request object (and response for that matter) so that I can call Container.invoke(req, resp)?
Thanks,
James