带有Jersey Web Services部署错误的JBoss Wildfly JBAS011859:命名上下文是只读的 [英] JBoss Wildfly with Jersey Web Services Deployment Error JBAS011859: Naming context is read-only

查看:168
本文介绍了带有Jersey Web Services部署错误的JBoss Wildfly JBAS011859:命名上下文是只读的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Jersey Servlet(1.18.1)处理Java Webservices项目.将我的EAR文件部署到Jboss WildFly(8.1.0)时,出现以下错误,并且不确定为什么它会因为在JBoss7(7.1.1)中部署并运行相同的EAR文件而中断.
错误堆栈跟踪:

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)

推荐答案

在JBoss Dev论坛上进行了一些研究之后,我遇到了答案.这是由于Jersey错误导致的,该错误不允许将JNDI条目添加到JVM.

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.

要对其进行修复,请将以下内容添加到standalone.bat中:

To fix it add the following to the standalone.bat:

set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager=**true**"

或属性文件:

com.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager=true

这篇关于带有Jersey Web Services部署错误的JBoss Wildfly JBAS011859:命名上下文是只读的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆