You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Aditya Anand <ad...@yahoo.com> on 2001/07/17 14:27:20 UTC
what's wrong here?
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
any suggestion?
Adi
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
Re: what's wrong here?
Posted by "Craig R. McClanahan" <cr...@apache.org>.
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