tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: what's wrong here?
Date Thu, 26 Jul 2001 06:32:32 GMT


On Tue, 17 Jul 2001, Aditya Anand wrote:

> Hi what is wrong with this code?
> 
> ic = new InitialContext();
> Object myObj = new MyObject();
> ic.rebind("java:comp/env/my_object", myObj);
> // I even tried "java:/comp/env/my_obj"
> ic.close();
> 
> I get a NamingException saying the context is
> readonly.
> I am using Tomcat 4.0 beta5 on NT / JVM 1.3.0_02

You get this error because the default naming context provided by Tomcat 4
is read only.  :-)

This context contains entries accumulated from your web.xml file (things
like <env-entry> and <resource-ref>), plus objects configured in the
conf/server.xml file.  It is not designed for storage of your own objects.

> 
> any suggestion?
> 
> Adi
> 

Craig McClanahan


Mime
View raw message