Java – JBoss wildly and Jersey web service deployment error jbas011859: naming context is read-only
•
Java
I am using Jersey servlet (1.18.1) to process Java Web services projects When I deploy my ear file to JBoss wildfly (8.1.0), I get the following error. I'm not sure why it breaks when deploying the same ear file 100% deployed in JBoss 7 (7.1.1)
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)
Solution
After doing some research in JBoss Development Forum, I found the answer This is caused by an error in Jersey, which does not allow JNDI entries to be added to the JVM
To fix it, add the following to standalone bat:
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager=**true**"
Or properties file:
com.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager=true
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码