javax.naming.NamingException: java:comp namespace cannot be modified

Hi,

I'm using the SunAppServer that is part of the Java Studio Creator 2 update 1 (version 8.2 I believe) and have the following problem I need help solving:

In my web app I have a Springframework ApplicationContext being instantiated via a Listener (org.springframework.web.context.ContextLoaderListener). This is in turn instantiating a java bean that is trying to bind an object into JNDI under a name in the formate "java:/com/mycompany/mybean", which fails with the following exception:

javax.naming.NamingException: java:comp namespace cannot be modified

at com.sun.enterprise.naming.java.javaURLContext.createSubcontext(javaURLContext.j ava:261)

at com.sun.enterprise.naming.SerialContext.createSubcontext(SerialContext.java:588 )

at com.sun.enterprise.naming.SerialContext.createSubcontext(SerialContext.java:617 )

at javax.naming.InitialContext.createSubcontext(InitialContext.java:427)

Is it a permission issue? (how do I rectify?)

Do I need to bind not under java:comp ? (if so, how?)

Any help much appreciated,

Regards,

Sean

P.S. Similar code works fine under OC4J

[1162 byte] By [MiniRadish] at [2007-11-26 7:35:01]
# 1

Anything within the java: namespace of a J2EE component is read-only as per the J2EE spec Naming chapter.java: is a special namespace set up by the container on behalf of the application. It is not intended as a general-purpose mutable runtime namespace. The OC4J implementation is non-portable.It shouldn't be allowing modifications to anything under java:

--ken

ksaks at 2007-7-6 19:33:57 > top of Java-index,Application & Integration Servers,Application Servers...