tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonghui Chen <chenyh1...@yahoo.com>
Subject Re: About jndi
Date Mon, 23 Jul 2001 15:37:45 GMT
Yep, if using tomcat 4.0b5, I can get the env using
default InitialContext, but can this doesnot work when
I using tomcat 3.2. And I have tried to add the jars
ship with Tomcat 4.0 into CLASSPATH, set the
InitialContext, but it doesnot work at all.

Any way, thank you.
Jacky
 --- Fernando_Salazar@lotus.com 的正文:> 
> I believe this resulted from a change made in 4.0
> B5, and that the plan is
> to change it back.
> Meanwhile, if you want to fix it yourself, try
> modifying Catalina.java.
> line 698 or so reads:
> 
>   
>
System.setProperty(javax.naming.Context.URL_PKG_PREFIXES,
> value);
> 
> After this line, insert:
> 
>   
>
System.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY,
> 
> "org.apache.naming.java.javaURLContextFactory");
> 
> After that, rebuild Tomcat.  I think that would do
> it.
> 
> - fernando
> 
> 
> 
> 
> Hi all,
> 
> I have just set a env-entry in web.xml, how can I
> use
> jndi to find it a java:comp/env/test?
> 
>     <env-entry>
>       <env-entry-name>test</env-entry-name>
> 
> <env-entry-type>java.lang.String</env-entry-type>
>       <env-entry-value>this is a
> test</env-entry-value>
>     </env-entry>
> 
> I just use
> InitialContext ic = new InitialContext();
> Object obj = ic.lookup("java:comp/env/test");
> 
> 
> but it throws a exception says that I have not set
> the
> jndi factory. Could you have me?
> 
> 
> 
> 
>  

_________________________________________________________
Do You Yahoo!? 登录免费雅虎电邮! http://mail.yahoo.com.cn

<font color=#6666FF>无聊?郁闷?高兴?没理由?都来聊天吧!</font>――

雅虎全新聊天室! http://cn.chat.yahoo.com/c/roomlist.html

Mime
View raw message