You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ron McNulty <rm...@xtra.co.nz> on 2009/03/13 23:39:06 UTC

Extending JNDI

Hello

I am running Apache Jetspeed Portal server (which sits on top of Tomcat) as a development platform. We then deploy portlets to Websphere portal server for production.

One area of incompatibility that I would like to fix is JNDI branches. Tomcat provides the standard java:comp/env/ branch, but IBM have a couple of other branches (e.g. /cells/persistent/... and /services/...) that don't have the usual java:comp/env/ prefix. As JNDI paths specified in /conf/context.xml automatically get the prefix added, these JNDI paths won't work on Tomcat/Jetspeed.

I have an application level fix that works, but developers need to use a specific class to do JNDI access (and regularly forget to do so). So I would like implement the other JNDI branches in Tomcat itself. It would be nice if this could be done as a plug-in module, but I am happy to hack the Tomcat source code if necessary.

My impression is that I would need to provide a new naming context to implement this. Can anyone point me at some documentation or give me some ideas on how I could implement these paths?

Regards

Ron




Re: Extending JNDI

Posted by Ron McNulty <rm...@xtra.co.nz>.
Thanks Mark

That certainly looks like the place to start.

Regards

Ron

----- Original Message ----- 
From: "Mark Thomas" <ma...@apache.org>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Saturday, March 14, 2009 11:38 PM
Subject: Re: Extending JNDI


> Ron McNulty wrote:
>> Hello
>>
>> I am running Apache Jetspeed Portal server (which sits on top of Tomcat) 
>> as a development platform. We then deploy portlets to Websphere portal 
>> server for production.
>>
>> One area of incompatibility that I would like to fix is JNDI branches. 
>> Tomcat provides the standard java:comp/env/ branch, but IBM have a couple 
>> of other branches (e.g. /cells/persistent/... and /services/...) that 
>> don't have the usual java:comp/env/ prefix. As JNDI paths specified in 
>> /conf/context.xml automatically get the prefix added, these JNDI paths 
>> won't work on Tomcat/Jetspeed.
>>
>> I have an application level fix that works, but developers need to use a 
>> specific class to do JNDI access (and regularly forget to do so). So I 
>> would like implement the other JNDI branches in Tomcat itself. It would 
>> be nice if this could be done as a plug-in module, but I am happy to hack 
>> the Tomcat source code if necessary.
>>
>> My impression is that I would need to provide a new naming context to 
>> implement this. Can anyone point me at some documentation or give me some 
>> ideas on how I could implement these paths?
>
> Take a look at
> http://svn.eu.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?view=markup
>
> look for namingContextListener
> and
> http://svn.eu.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java?view=markup
>
> You can see from those how Tomcat does this.
>
> I suspect you'll need to patch one or both of these. The
> createNamingContext() method in the listener looks like a good place to
> start.
>
> HTH,
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


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


Re: Extending JNDI

Posted by Mark Thomas <ma...@apache.org>.
Ron McNulty wrote:
> Hello
> 
> I am running Apache Jetspeed Portal server (which sits on top of Tomcat) as a development platform. We then deploy portlets to Websphere portal server for production.
> 
> One area of incompatibility that I would like to fix is JNDI branches. Tomcat provides the standard java:comp/env/ branch, but IBM have a couple of other branches (e.g. /cells/persistent/... and /services/...) that don't have the usual java:comp/env/ prefix. As JNDI paths specified in /conf/context.xml automatically get the prefix added, these JNDI paths won't work on Tomcat/Jetspeed.
> 
> I have an application level fix that works, but developers need to use a specific class to do JNDI access (and regularly forget to do so). So I would like implement the other JNDI branches in Tomcat itself. It would be nice if this could be done as a plug-in module, but I am happy to hack the Tomcat source code if necessary.
> 
> My impression is that I would need to provide a new naming context to implement this. Can anyone point me at some documentation or give me some ideas on how I could implement these paths?

Take a look at
http://svn.eu.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?view=markup

look for namingContextListener
and
http://svn.eu.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java?view=markup

You can see from those how Tomcat does this.

I suspect you'll need to patch one or both of these. The
createNamingContext() method in the listener looks like a good place to
start.

HTH,

Mark



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