Wildfly 在启动时抛出 UnsupportedOperationException(命名上下文是只读的)
Wildfly throws UnsupportedOperationException (Naming context is read-only) on start
我们正在设置一个新的暂存服务器 (运行 Ubuntu),并且在启动 WildFly 时遇到错误。主要的是
java.lang.UnsupportedOperationException: WFLYNAM0043: Naming context is read-only
然后会导致许多关于缺少依赖项的错误。
我们已经在另一台服务器上设置了我们的 (liquibase) 数据库,我们可以在内部通过 ssh 访问它。我们也搜索了 Whosebug,并尝试添加
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(见下文)中看到错误发生在"Started Hibernate Redis cache"之后,但错误本身似乎是特定于野蝇.
下面是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"
所以我们删除了 'set' 并删除了星号和其他内容。在我们的例子中,是 .conf 文件需要该行,我相信对于不同类型的实现,它可能是 .bat 或 .conf.bat - 抱歉,我无法提供更多帮助。
希望这对其他人有帮助!
我最近在启动 JBOSS EAP 7.2 和 Wildfly 12 时遇到了同样的错误。在我的例子中,它是一个旧的 Hibernate Java 应用程序。 hibernate.cfg.xml
中实体的映射。我的问题是有人将 name 属性放在 <session-factory name="">
中,并且那个特定的应用程序出现了两个上下文!在第二个上下文启动时,出现错误:
java.lang.UnsupportedOperationException: WFLYNAM0043: Naming context is read-only
从会话工厂中删除名称解决了问题。
我们正在设置一个新的暂存服务器 (运行 Ubuntu),并且在启动 WildFly 时遇到错误。主要的是
java.lang.UnsupportedOperationException: WFLYNAM0043: Naming context is read-only
然后会导致许多关于缺少依赖项的错误。
我们已经在另一台服务器上设置了我们的 (liquibase) 数据库,我们可以在内部通过 ssh 访问它。我们也搜索了 Whosebug,并尝试添加
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(见下文)中看到错误发生在"Started Hibernate Redis cache"之后,但错误本身似乎是特定于野蝇.
下面是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"
所以我们删除了 'set' 并删除了星号和其他内容。在我们的例子中,是 .conf 文件需要该行,我相信对于不同类型的实现,它可能是 .bat 或 .conf.bat - 抱歉,我无法提供更多帮助。
希望这对其他人有帮助!
我最近在启动 JBOSS EAP 7.2 和 Wildfly 12 时遇到了同样的错误。在我的例子中,它是一个旧的 Hibernate Java 应用程序。 hibernate.cfg.xml
中实体的映射。我的问题是有人将 name 属性放在 <session-factory name="">
中,并且那个特定的应用程序出现了两个上下文!在第二个上下文启动时,出现错误:
java.lang.UnsupportedOperationException: WFLYNAM0043: Naming context is read-only
从会话工厂中删除名称解决了问题。