You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2011/07/20 00:34:26 UTC
tomcat and comp jndi context
Hi,
where can i get more information on the way tomcat manage its jndi tree?
Pratically i need the get java:comp context but i don't know when/where to
look up it.
I didn't find it in ContextBindings.getClassLoader() in start or after_start
lifecycle event.
any link or doc is appreciated ;)
- Romain
Re: tomcat and comp jndi context
Posted by Romain Manni-Bucau <rm...@gmail.com>.
The question is "how to get the comp context in the after start event in
tomcat"...i did
standContext.getNamingContextListener().getNamingContext().lookup("comp")
and it seems to work.
yes EJB...but it is simple (EJB 2, not 2) and standard... so it is not so
bad :p
- Romain
2011/7/20 Pid <pi...@pidster.com>
> On 20/07/2011 13:09, Romain Manni-Bucau wrote:
> > I'm in OpenEJB modifying a lifecycle listener.
> >
> > The current code is:
> >
> > ContextBindings.getClassLoader().lookup("comp");
> >
> > but it fails, i wonder if i can replace it by:
> >
> > standardContext.getNamingContextListener();
>
> Perhaps this is an OpenEJB* question rather than a Tomcat one?
>
> p
>
>
> * EJB! Really!?
>
> > - Romain
> >
> > 2011/7/20 Pid <pi...@pidster.com>
> >
> >> On 19/07/2011 23:34, Romain Manni-Bucau wrote:
> >>> Hi,
> >>>
> >>> where can i get more information on the way tomcat manage its jndi
> tree?
> >>>
> >>> Pratically i need the get java:comp context but i don't know when/where
> >> to
> >>> look up it.
> >>>
> >>> I didn't find it in ContextBindings.getClassLoader() in start or
> >> after_start
> >>> lifecycle event.
> >>>
> >>> any link or doc is appreciated ;)
> >>>
> >>> - Romain
> >>>
> >>
> >> How about the Tomcat docs?
> >>
> >>
> >>
> http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
> >>
> >> Context initContext = new InitialContext();
> >> Context envContext = (Context)initContext.lookup("java:/comp/env");
> >>
> >>
> >> p
> >>
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
Re: tomcat and comp jndi context
Posted by Pid <pi...@pidster.com>.
On 20/07/2011 13:09, Romain Manni-Bucau wrote:
> I'm in OpenEJB modifying a lifecycle listener.
>
> The current code is:
>
> ContextBindings.getClassLoader().lookup("comp");
>
> but it fails, i wonder if i can replace it by:
>
> standardContext.getNamingContextListener();
Perhaps this is an OpenEJB* question rather than a Tomcat one?
p
* EJB! Really!?
> - Romain
>
> 2011/7/20 Pid <pi...@pidster.com>
>
>> On 19/07/2011 23:34, Romain Manni-Bucau wrote:
>>> Hi,
>>>
>>> where can i get more information on the way tomcat manage its jndi tree?
>>>
>>> Pratically i need the get java:comp context but i don't know when/where
>> to
>>> look up it.
>>>
>>> I didn't find it in ContextBindings.getClassLoader() in start or
>> after_start
>>> lifecycle event.
>>>
>>> any link or doc is appreciated ;)
>>>
>>> - Romain
>>>
>>
>> How about the Tomcat docs?
>>
>>
>> http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
>>
>> Context initContext = new InitialContext();
>> Context envContext = (Context)initContext.lookup("java:/comp/env");
>>
>>
>> p
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: tomcat and comp jndi context
Posted by Romain Manni-Bucau <rm...@gmail.com>.
I'm in OpenEJB modifying a lifecycle listener.
The current code is:
ContextBindings.getClassLoader().lookup("comp");
but it fails, i wonder if i can replace it by:
standardContext.getNamingContextListener();
- Romain
2011/7/20 Pid <pi...@pidster.com>
> On 19/07/2011 23:34, Romain Manni-Bucau wrote:
> > Hi,
> >
> > where can i get more information on the way tomcat manage its jndi tree?
> >
> > Pratically i need the get java:comp context but i don't know when/where
> to
> > look up it.
> >
> > I didn't find it in ContextBindings.getClassLoader() in start or
> after_start
> > lifecycle event.
> >
> > any link or doc is appreciated ;)
> >
> > - Romain
> >
>
> How about the Tomcat docs?
>
>
> http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
>
> Context initContext = new InitialContext();
> Context envContext = (Context)initContext.lookup("java:/comp/env");
>
>
> p
>
>
Re: tomcat and comp jndi context
Posted by Pid <pi...@pidster.com>.
On 19/07/2011 23:34, Romain Manni-Bucau wrote:
> Hi,
>
> where can i get more information on the way tomcat manage its jndi tree?
>
> Pratically i need the get java:comp context but i don't know when/where to
> look up it.
>
> I didn't find it in ContextBindings.getClassLoader() in start or after_start
> lifecycle event.
>
> any link or doc is appreciated ;)
>
> - Romain
>
How about the Tomcat docs?
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:/comp/env");
p