gpt4 book ai didi

spring - Wildfly 在启动时抛出 UnsupportedOperationException(命名上下文是只读的)

转载 作者:太空宇宙 更新时间:2023-11-03 17:04:32 24 4
gpt4 key购买 nike

我们正在设置一个新的暂存服务器(运行 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(以及我们的网站)(或者至少继续处理下一个错误...)非常感谢您的帮助!

最佳答案

经过多次尝试,我们终于弄明白了。我们尝试实现的行需要稍微更改一下:

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

所以我们删除了“集合”并删除了星号和其他内容。在我们的例子中,是 .conf 文件需要该行,我相信对于不同类型的实现,它可能是 .bat 或 .conf.bat - 抱歉,我无法提供更多帮助。

希望这对其他人有帮助!

关于spring - Wildfly 在启动时抛出 UnsupportedOperationException(命名上下文是只读的),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55495498/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com