Jboss 应用程序 运行(war 文件)出现以下错误。我正在使用 windfly/jboss 10 版本

Jboss application running(war file) getting below error. I'm using windfly/jboss 10 version

伙计们知道是什么原因造成的。我搜索了互联网,但在 运行 我的 war 文件位于 windfly/jboss 10 服务器

时找不到此类错误

我正在使用 Maven pom 文件构建。 ..................................................... ..................................................... ..................................................... ………… 最后它在控制台中给我一个错误说 WFLYCTL0186:无法启动的服务:服务 jboss.undertow.deployment.default-server.default-host./smsc2

    15:56:02,168 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 58) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./smsc2: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./smsc2: javax.servlet.ServletException: No resources
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.run(UndertowDeploymentService.java:85)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
        at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: javax.servlet.ServletException: No resources
        at org.apache.catalina.servlets.DefaultServlet.init(DefaultServlet.java:338)
        at javax.servlet.GenericServlet.init(GenericServlet.java:244)
        at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
        at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
        at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
        at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:250)
        at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:133)
        at io.undertow.servlet.core.DeploymentManagerImpl.call(DeploymentManagerImpl.java:546)
        at io.undertow.servlet.core.DeploymentManagerImpl.call(DeploymentManagerImpl.java:517)
        at io.undertow.servlet.core.ServletRequestContextThreadSetupAction.call(ServletRequestContextThreadSetupAction.java:42)
        at io.undertow.servlet.core.ContextClassLoaderSetupAction.call(ContextClassLoaderSetupAction.java:43)
        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper.call(LegacyThreadSetupActionWrapper.java:44)
        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper.call(LegacyThreadSetupActionWrapper.java:44)
        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper.call(LegacyThreadSetupActionWrapper.java:44)
        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper.call(LegacyThreadSetupActionWrapper.java:44)
        at io.undertow.servlet.api.LegacyThreadSetupActionWrapper.call(LegacyThreadSetupActionWrapper.java:44)
        at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:559)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.run(UndertowDeploymentService.java:82)
        ... 6 more
Caused by: javax.naming.NameNotFoundException: comp/Resources -- service jboss.naming.context.java.comp.Resources
        at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:106)
        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207)
        at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:235)
        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:193)
        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:189)
        at javax.naming.InitialContext.lookup(InitialContext.java:417)
        at javax.naming.InitialContext.lookup(InitialContext.java:417)
        at org.apache.catalina.servlets.DefaultServlet.init(DefaultServlet.java:333)
        ... 24 more

15:56:02,180 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "smsc2.war")]) - failure description: {
    "WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./smsc2" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./smsc2: javax.servlet.ServletException: No resources
    Caused by: javax.servlet.ServletException: No resources
    Caused by: javax.naming.NameNotFoundException: comp/Resources -- service jboss.naming.context.java.comp.Resources"},
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.undertow.deployment.default-server.default-host./smsc2"],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
}
15:56:02,271 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0

看起来像是 JNDI 查找失败问题,请尝试检查您在何处尝试查找名为 comp/Resources 的资源或更正 JNDI 名称。

问题已解决我错过了未部署在 src/main/resources war 文件中的资源文件(jndi.properties.....config xmls 等)