You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andrei Tchijov <an...@tchijov.com> on 2007/10/22 22:54:54 UTC
Using JNDI. java:comp .... not defined?
Hi,
I guess I am missing something very very basic, but I can not see
what it is. I am trying to make some resources available via JNDI. I
have put appropriate "GlabalNamingResources/Resource" into my
server.xml ( and I think I did it properly - at least tomcat is not
complaining about ). The only problem is that I am getting
javax.naming.NameNotFoundException: Name comp is not bound in this
Context
at org.apache.naming.NamingContext.list(NamingContext.java:344)
at org.apache.naming.NamingContext.list(NamingContext.java:367)
at org.apache.naming.SelectorContext.list
(SelectorContext.java:306)
at javax.naming.InitialContext.list(InitialContext.java:395)
when I am trying to do " ... initCtx.list( "java:comp/env" ); ...".
Do I need to do anything to "enable" JNDI? Does it make any
difference that I am trying to use JNDI from Valve?
Any help will be highly appreciated.
Andrei
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Using JNDI. java:comp .... not defined?
Posted by Andrei Tchijov <an...@tchijov.com>.
I am using 5.5.20
On Oct 22, 2007, at 10:25 PM, foo shyn wrote:
> Hmm which Tomcat version you are using? For Tomcat 4.1 AFAIK you
> have to put a link in your application's web.xml to the global
> resources in order for your application to access it.
>
> HTH
> FooShyn
>
> Mark Thomas wrote:
>> Andrei Tchijov wrote:
>>
>>> when I am trying to do " ... initCtx.list( "java:comp/
>>> env" ); ...". Do I
>>> need to do anything to "enable" JNDI? Does it make any difference
>>> that I
>>> am trying to use JNDI from Valve?
>>>
>>
>> Probably. I haven't looked at the code but I would not expect this to
>> work. Test it in a JSP to see if it works there.
>>
>> Mark
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Using JNDI. java:comp .... not defined?
Posted by foo shyn <fo...@optegra.com.my>.
Hmm which Tomcat version you are using? For Tomcat 4.1 AFAIK you have to
put a link in your application's web.xml to the global resources in
order for your application to access it.
HTH
FooShyn
Mark Thomas wrote:
> Andrei Tchijov wrote:
>
>> when I am trying to do " ... initCtx.list( "java:comp/env" ); ...". Do I
>> need to do anything to "enable" JNDI? Does it make any difference that I
>> am trying to use JNDI from Valve?
>>
>
> Probably. I haven't looked at the code but I would not expect this to
> work. Test it in a JSP to see if it works there.
>
> Mark
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Using JNDI. java:comp .... not defined?
Posted by Mark Thomas <ma...@apache.org>.
Andrei Tchijov wrote:
> when I am trying to do " ... initCtx.list( "java:comp/env" ); ...". Do I
> need to do anything to "enable" JNDI? Does it make any difference that I
> am trying to use JNDI from Valve?
Probably. I haven't looked at the code but I would not expect this to
work. Test it in a JSP to see if it works there.
Mark
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org