I remember it was a workaround for some jersey/weld bug and jersey store some cdi extension object in jndi. Not clear if that workaround is still needed on which version of jersey or weld. The lookup name seems to be hardcoded, but you can try turning off the jndi binding/unbinding by jersey by a sysprop com.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager in server JVM.
The unqualified global context in GF is writable so it worked there.
I've got the same problem here.
I've got a JBoss 7.1.1 which is currently running a RESTEasy based JAX-RS application that uses as well beans. For certain reasons I need to change from RESTEasy to Jersey.
Unfortuantely I cannot change any settings within the JBoss itself (no access to the server).
What may be a workaround for others that do have other requirements than I have is get rid of beans (also remove beans.xml) or change the JVM CDI settings.
But what can you cannot change all those things? Is there another way in order be let Jersey add an JNDI entry in order to remove the exception mentioned above (JBAS011859: Naming context is read-only)?
I guess there won't be any chance to get a fix from the Jersey team because it is perectly running in other servers.
What can I do?
Di you find any workaround? I have same issue when having beans.xml and jersey. I tried with jboss 7.1.1 and jboss 7.1.2, still same issue.
I added set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager=false" in the standalone.conf.bat file but that didn't fix the issue.
Should be set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager=true"