Im working on a Java Webservices Project Using the Jersey Servlet (1.18.1). When deploying my EAR file to Jboss WildFly (8.1.0) I'm Getting the following Error and im unsure why its breaking as this same EAR file deployed and worked 100% in JBoss7 (7.1.1).
The Error stacktrace:
java.lang.UnsupportedOperationException: JBAS011859: Naming context is read-only
at org.jboss.as.naming.WritableServiceBasedNamingStore.requireOwner(WritableServiceBasedNamingStore.java:126)
at org.jboss.as.naming.WritableServiceBasedNamingStore.createSubcontext(WritableServiceBasedNamingStore.java:116)
at org.jboss.as.naming.NamingContext.createSubcontext(NamingContext.java:338)
at org.jboss.as.naming.InitialContext.createSubcontext(InitialContext.java:229)
at org.jboss.as.naming.NamingContext.createSubcontext(NamingContext.java:346)
at javax.naming.InitialContext.createSubcontext(InitialContext.java:464)
at com.sun.jersey.server.impl.cdi.CDIExtension$1.stepInto(CDIExtension.java:280)
I am able to manage this. Add a patch in naming jar. Just change org.jboss.as.naming.service.NamingStoreService -> readOnly = true
Full java class -
public class NamingStoreService implements Service {
If you are using Mac, add the below line to your standalone.conf file in Jboss_home/bin directory
After Doing some research in JBoss Dev Forums i came across the answer. This is caused by a bug with Jersey which doesn't allow add JNDI entries into the JVM.
To fix it add the following to the standalone.bat:
or properties file: