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.