Hi.

Section 5.3.4 of the jee spec:
The container must ensure that the application component instances have
only read access to their naming context. The container must throw the
javax.naming.OperationNotSupportedException from all the methods of the
javax.naming.Context interface that modify the environment naming context
and its subcontexts.

https://java.net/downloads/javaee-spec/JavaEE_Platform_Spec_EDR.pdf

Svetlin

2016-09-27 12:05 GMT+03:00 gchauvet <gchau...@zatarox.com>:

> Bump on this thread because I have the same issue. Below my context (a
> servlet project) :
>
> 1) I've defined a Datasource in tomee.xml with id "test/dossier" (used in a
> another EJB project with @Resource annotation without issue).
> 2) In my web.xml file, adding a new section :
> <resource-ref>
>         <res-ref-name>jdbc/test/dossier</res-ref-name>
>         <res-type>javax.sql.DataSource</res-type>
>         <res-auth>Container</res-auth>
>     </resource-ref>
> 3) In my META-INF/context.xml :
> <Context path="/cmis/test">
>     <Resource name="jdbc/test/dossier" type="javax.sql.DataSource" />
> </Context>
> 4) In my source code :
> final Context ic = new InitialContext();
> ic.createSubcontext("java:comp/env/jdbc");
> return ic;
>
> TomEE(in fact tomcat) returns me an OperationNotSupportedException with the
> message "The context is read-only".
>
> I know I've missed something.... but I'm a little bit lost
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/javax-naming-OperationNotSupportedException
> -Context-is-read-only-tp4678126p4680199.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Reply via email to