jboss Wildfly在启动时抛出UnsupportedOperationException(命名上下文为只读)

but5z9lq  于 2022-11-23  发布在  其他
关注(0)|答案(2)|浏览(181)

我们正在设置一个新的临时服务器(运行Ubuntu),在启动WildFly时遇到错误。

java.lang.UnsupportedOperationException: WFLYNAM0043: Naming context is read-only

这会导致许多关于缺少依赖项的错误。
我们已经在另一台服务器上建立了liquibase数据库,我们可以在内部使用ssh访问它。我们也搜索了StackOverflow,并尝试添加

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

到我们的standalone.conf、standalone.bat和standalone.conf.bat(为了尝试所有方法!)。我们还看到这个问题应该在WildFly 7.1.1中修复,我们自己运行9(以模拟实时服务器)。我们尝试手动安装依赖项,但依赖项太多-老实说,我们认为这不是主要问题。
我们也在运行nginx和Redis,我们在server.log(见下文)中看到错误发生在“启动Hibernate Redis缓存”之后,但错误本身似乎是WildFly特有的。
server.log的一个块如下所示:

2019-04-03 10:52:38,252 INFO  [com.company.ejb.util.config.ConfigRetriever] (ServerService Thread Pool -- 56) Successfully found and read the config file at /opt/wildfly/config.yml
2019-04-03 10:52:38,300 INFO  [com.company.ejb.entity.cache.RedisRegionFactory] (ServerService Thread Pool -- 56) Started Hibernate Redis cache
2019-04-03 10:52:46,896 INFO  [org.jboss.weld.Event] (MSC service thread 1-2) WELD-000411: Observer method [BackedAnnotatedMethod] com.sun.jersey.server.impl.cdi.CDIExtension.processAnnotatedType(@Observes ProcessAnnotatedType<Object>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds.
2019-04-03 10:52:47,041 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."DoThePublish.ear".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."DoThePublish.ear".WeldStartService: Failed to start service
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
Exception 0 :
java.lang.UnsupportedOperationException: WFLYNAM0043: Naming context is read-only
        at org.jboss.as.naming.WritableServiceBasedNamingStore.requireOwner(WritableServiceBasedNamingStore.java:161)
        at org.jboss.as.naming.WritableServiceBasedNamingStore.createSubcontext(WritableServiceBasedNamingStore.java:151)
        at org.jboss.as.naming.NamingContext.createSubcontext(NamingContext.java:417)
        at org.jboss.as.naming.InitialContext$DefaultInitialContext.createSubcontext(InitialContext.java:298)
        at org.jboss.as.naming.NamingContext.createSubcontext(NamingContext.java:425)
        [...]

2019-04-03 10:52:47,078 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "DoThePublish.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"DoThePublish. ear\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"DoThePublish.ear\".WeldStartService: Failed to
 start service
    Caused by: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
Exception 0 :
java.lang.UnsupportedOperationException: WFLYNAM0043: Naming context is read-only
        at org.jboss.as.naming.WritableServiceBasedNamingStore.requireOwner(WritableServiceBasedNamingStore.java:161)
        at org.jboss.as.naming.WritableServiceBasedNamingStore.createSubcontext(WritableServiceBasedNamingStore.java:151)
        at org.jboss.as.naming.NamingContext.createSubcontext(NamingContext.java:417)
        at org.jboss.as.naming.InitialContext$DefaultInitialContext.createSubcontext(InitialContext.java:298)
        at org.jboss.as.naming.NamingContext.createSubcontext(NamingContext.java:425)
        [...]
"}}
2019-04-03 10:52:47,178 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 32) WFLYSRV0010: Deployed "DoThePublish.ear" (runtime-name : "DoThePublish.ear")
2019-04-03 10:52:47,186 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report 
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."DoThePublish.ear".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."DoThePublish.ear".WeldStartService: Failed to start service

2019-04-03 10:52:47,581 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
2019-04-03 10:52:47,582 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
2019-04-03 10:52:47,582 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 9.0.1.Final (WildFly Core 1.0.1.Final) started (with errors) in 42472ms - Started 4599 of 5108 services (362 services failed or missing dependencies, 209 services are lazy, passive or on-demand)

接下来是一堆缺失的依赖项(有很多):

WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.deployment.subunit."DoThePublish.ear"."CoreEjb.jar".component.AbstractEntityMainSB.CREATE (missing) dependents: [service jboss.deployment.subunit."DoThePublish.ear"."CoreEjb.jar".component.AbstractEntityMainSB.START]
      service jboss.deployment.subunit."DoThePublish.ear"."CoreEjb.jar".component.AbstractEntityMainSB.START (missing) dependents: [service jboss.deployment.subunit."DoThePublish.ear"."CoreEjb.jar".moduleDeploymentRuntimeInformationStart, service jboss.deployment.subunit."DoThePublish.ear"."CoreEjb.jar".deploymentCompleteService]
      service jboss.deployment.subunit."DoThePublish.ear"."CoreEjb.jar".component.AbstractEntityMainSB.VIEW."com.company.ejb.session.AbstractEntityMainSBL".LOCAL (missing) dependents: [service jboss.deployment.subunit."DoThePublish.ear"."CoreEjb.jar".component.AbstractEntityMainSB.START]

我们已经尝试将设置与现有的生产(实时)服务器进行比较,但开发团队中出现了重大转变,因此没有人确切地知道它们是如何设置的。没有设置说明,因此我们在进行时正在尝试一些事情-也许以前的服务器遇到了这些相同的问题,但我们不知道。
我们希望修复这个异常,希望能够启动wildfly(因此我们的网站)没有问题(或至少移动到下一个错误...)任何帮助都非常感谢!

t1qtbnec

t1qtbnec1#

所以经过一系列的尝试之后,我们发现,我们尝试实现的代码行需要做一点修改:

JAVA_OPTS="$JAVA_OPTS -Dcom.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager=true"

所以我们删除了'set',并删除了星号和其他内容。在我们的例子中,是.conf文件需要这一行,我相信对于不同类型的实现,它可能是.bat或.conf.bat -抱歉,我不能进一步提供帮助。
希望这对其他人有帮助!

olhwl3o2

olhwl3o22#

我最近在启动JBOSS EAP 7.2和Wildfly 12时遇到了同样的错误。在我的例子中,它是一个旧的Hibernate Java应用程序。实体的Map在hibernate.cfg.xml中。我的问题是有人把name属性放在<session-factory name="">中,而那个特定的应用程序进入了两个上下文!在启动第二个上下文时,我得到了错误:
java.lang.UnsupportedOperationException: WFLYNAM0043: Naming context is read-only
从会话工厂中删除名称解决了问题。

相关问题