You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Rickard Öberg <ri...@dreambean.com> on 2003/05/20 09:06:33 UTC

Accessing Tomcat in JBoss

Hi!

I'm developing a portlet container using JBoss/Tomcat. To do this I need 
to be able to access the deployed WAR's, and in order to do this I need 
to access the Tomcat instance (I think). The question is: how do I do 
this? The MBean that JBoss exposes for the embedded Tomcat instance does 
not have any methods to get to the underlying Embedded isntance, and I 
can't find any other way to do it (statics? JNDI?). If anyone have any 
idea how to accomplish this I would appreciate it a LOT!

regards,
   Rickard

-- 
Rickard Öberg
rickard@dreambean.com
Senselogic

Got blog? I do. http://dreambean.com



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Accessing Tomcat in JBoss

Posted by Costin Manolache <cm...@yahoo.com>.
Rickard Öberg wrote:

> Rickard Öberg wrote:
>> I'm developing a portlet container using JBoss/Tomcat. To do this I need
>> to be able to access the deployed WAR's, and in order to do this I need
>> to access the Tomcat instance (I think). The question is: how do I do
>> this? The MBean that JBoss exposes for the embedded Tomcat instance does
>> not have any methods to get to the underlying Embedded isntance, and I
>> can't find any other way to do it (statics? JNDI?). If anyone have any
>> idea how to accomplish this I would appreciate it a LOT!
> 
> Replying to my own post here... I managed to figure out how to access
> the list of deployed apps from EmbeddedCatalina41.

In 5.0 you'll be able to use JMX. It works with 4.1 too - but there are some
tricks and few changes needed in the jboss integration code.


>  From that I have a StandardContext object which represents the WAR file
> that has been deployed, which is great!
> 
> There is one more thing that would make it super-nice: is it somehow
> possible to set the parent classloader of the WAR to be the
> WebappClassLoader of another WAR? Specifically, my portlet container is
> a WAR, and it would be great if I could somehow specify that as the
> parent of all deployed portlet apps. I tried calling
> context.setParentClassLoader() but that was not picked up by the
> WebappClassLoader of that app. It seems as though the call was too late.


 
> So, is there any way I can replace the current parent of
> WebappClassLoader (which is a JBoss-loader) with my own loader? That
> would be awesome!

I think you'll need to hack a bit - but it should be possible. 


Costin



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Accessing Tomcat in JBoss

Posted by Rickard Öberg <ri...@dreambean.com>.
Rickard Öberg wrote:
> I'm developing a portlet container using JBoss/Tomcat. To do this I need 
> to be able to access the deployed WAR's, and in order to do this I need 
> to access the Tomcat instance (I think). The question is: how do I do 
> this? The MBean that JBoss exposes for the embedded Tomcat instance does 
> not have any methods to get to the underlying Embedded isntance, and I 
> can't find any other way to do it (statics? JNDI?). If anyone have any 
> idea how to accomplish this I would appreciate it a LOT!

Replying to my own post here... I managed to figure out how to access 
the list of deployed apps from EmbeddedCatalina41.

 From that I have a StandardContext object which represents the WAR file 
that has been deployed, which is great!

There is one more thing that would make it super-nice: is it somehow 
possible to set the parent classloader of the WAR to be the 
WebappClassLoader of another WAR? Specifically, my portlet container is 
a WAR, and it would be great if I could somehow specify that as the 
parent of all deployed portlet apps. I tried calling 
context.setParentClassLoader() but that was not picked up by the 
WebappClassLoader of that app. It seems as though the call was too late.

So, is there any way I can replace the current parent of 
WebappClassLoader (which is a JBoss-loader) with my own loader? That 
would be awesome!

regards,
   Rickard

-- 
Rickard Öberg
rickard@dreambean.com
Senselogic

Got blog? I do. http://dreambean.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org