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

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

问题描述

我正在使用 Jersey Servlet (1.18.1) 进行 Java Web 服务项目.将我的 EAR 文件部署到 Jboss WildFly (8.1.0) 时,我收到以下错误,我不确定为什么它会在 JBoss7 (7.1.1) 中部署和工作 100% 的同一个 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 开发论坛上做了一些研究后,我找到了答案.这是由 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

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

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