当前位置: 首页 > 知识库问答 >
问题:

Wildfly以错误开始。javax.faces.FacesExc0019:找不到CDI BeanManager

从烈
2023-03-14

我已经用WildFly 18、jdk-13.0.1、windows 10在eclipse中编写了我的第一个JSF Hello world程序。

野飞家和管理控制台工作查找但当执行程序从urlhttp://localhost:8080/jsf1/faces/WEB-INF/helloworld.xhtml它给404-未找到错误。我得到同样的错误在urlhttp://localhost:8080/jsf1

这是web.xml档案

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" id="WebApp_ID" version="4.0">
  <display-name>jsf1</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
  </servlet-mapping>
</web-app>

下面是wildfly服务器日志

2020-01-06 10:59:19,677 INFO  [org.jboss.as.patching] (MSC service thread 1-2) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
2020-01-06 10:59:19,694 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-6) WFLYDM0111: Keystore C:\Program Files\wildfly-18.0.1.Final\standalone\configuration\application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
2020-01-06 10:59:19,702 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) WFLYDS0013: Started FileSystemDeploymentService for directory C:\Program Files\wildfly-18.0.1.Final\standalone\deployments
2020-01-06 10:59:19,723 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of "jsf2.war" (runtime-name: "jsf2.war")
2020-01-06 10:59:19,720 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "jsf1.war" (runtime-name: "jsf1.war")
2020-01-06 10:59:19,827 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
2020-01-06 10:59:20,856 INFO  [org.jboss.ws.common.management] (MSC service thread 1-7) JBWS022052: Starting JBossWS 5.3.0.Final (Apache CXF 3.3.3) 
2020-01-06 10:59:25,045 INFO  [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-6) ISPN000128: Infinispan version: Infinispan 'Infinity Minus ONE +2' 9.4.16.Final
2020-01-06 10:59:25,635 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 77) WFLYCLINF0002: Started client-mappings cache from ejb container
2020-01-06 10:59:26,604 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 80) Initializing Mojarra 2.3.9.SP04 for context '/jsf1'
2020-01-06 10:59:26,610 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 78) Initializing Mojarra 2.3.9.SP04 for context '/jsf2'
2020-01-06 10:59:27,168 ERROR [stderr] (ServerService Thread Pool -- 80) javax.faces.FacesException: Unable to find CDI BeanManager

2020-01-06 10:59:27,169 ERROR [stderr] (ServerService Thread Pool -- 80)    at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.application.applicationimpl.Version.isJsf23(Version.java:62)

2020-01-06 10:59:27,169 ERROR [stderr] (ServerService Thread Pool -- 80)    at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.application.applicationimpl.ExpressionLanguage.addELResolver(ExpressionLanguage.java:136)

2020-01-06 10:59:27,170 ERROR [stderr] (ServerService Thread Pool -- 80)    at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.application.ApplicationImpl.addELResolver(ApplicationImpl.java:221)

2020-01-06 10:59:27,170 ERROR [stderr] (ServerService Thread Pool -- 80)    at org.jboss.as.jsf-injection//org.jboss.as.jsf.injection.weld.WeldApplication.<init>(WeldApplication.java:60)

2020-01-06 10:59:27,171 ERROR [stderr] (ServerService Thread Pool -- 80)    at org.jboss.as.jsf-injection//org.jboss.as.jsf.injection.weld.WeldApplicationFactory.getApplication(WeldApplicationFactory.java:52)

2020-01-06 10:59:27,171 ERROR [stderr] (ServerService Thread Pool -- 80)    at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.application.InjectionApplicationFactory.getApplication(InjectionApplicationFactory.java:61)

2020-01-06 10:59:27,172 ERROR [stderr] (ServerService Thread Pool -- 80)    at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:109)

2020-01-06 10:59:27,173 ERROR [stderr] (ServerService Thread Pool -- 80)    at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.lifecycle.ClientWindowFactoryImpl.<init>(ClientWindowFactoryImpl.java:39)

2020-01-06 10:59:27,173 ERROR [stderr] (ServerService Thread Pool -- 80)    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

2020-01-06 10:59:27,174 ERROR [stderr] (ServerService Thread Pool -- 80)    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

2020-01-06 10:59:27,174 ERROR [stderr] (ServerService Thread Pool -- 80)    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

2020-01-06 10:59:27,174 ERROR [stderr] (ServerService Thread Pool -- 80)    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)

2020-01-06 10:59:27,175 ERROR [stderr] (ServerService Thread Pool -- 80)    at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:166)

2020-01-06 10:59:27,175 ERROR [stderr] (ServerService Thread Pool -- 80)    at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:404)

2020-01-06 10:59:27,176 ERROR [stderr] (ServerService Thread Pool -- 80)    at java.base/java.lang.Class.newInstance(Class.java:591)

最后几行日志

Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
    at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:357)
    at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:205)
    ... 21 more
Caused by: java.lang.NullPointerException
    at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.facelets.impl.DefaultResourceResolver.resolveUrl(DefaultResourceResolver.java:40)
    at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.facelets.impl.DefaultFaceletFactory.init(DefaultFaceletFactory.java:129)
    at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.application.ApplicationAssociate.createFaceletFactory(ApplicationAssociate.java:849)
    at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.application.ApplicationAssociate.initializeFacelets(ApplicationAssociate.java:342)
    at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.application.ApplicationAssociate.getCompiler(ApplicationAssociate.java:420)
    at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:217)
    at com.sun.jsf-impl@2.3.9.SP04//com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:341)
    ... 22 more

2020-01-06 10:59:28,236 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "jsf1.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"jsf1.war\".undertow-deployment" => "java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
    Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
    Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
    Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
    Caused by: java.lang.NullPointerException"}}
2020-01-06 10:59:28,466 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "jsf2.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"jsf2.war\".undertow-deployment" => "java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
    Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
    Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
    Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
    Caused by: java.lang.NullPointerException"}}
2020-01-06 10:59:28,518 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 44) WFLYSRV0010: Deployed "jsf2.war" (runtime-name : "jsf2.war")
2020-01-06 10:59:28,519 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 44) WFLYSRV0010: Deployed "jsf1.war" (runtime-name : "jsf1.war")
2020-01-06 10:59:28,521 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."jsf2.war".undertow-deployment: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
      service jboss.deployment.unit."jsf1.war".undertow-deployment: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
WFLYCTL0448: 2 additional services are down due to their dependencies being missing or failed
2020-01-06 10:59:28,735 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
2020-01-06 10:59:28,745 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
2020-01-06 10:59:28,745 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
2020-01-06 10:59:28,745 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 18.0.1.Final (WildFly Core 10.0.3.Final) started (with errors) in 29279ms - Started 496 of 731 services (6 services failed or missing dependencies, 379 services are lazy, passive or on-demand)

共有2个答案

戚俊健
2023-03-14

我通过创建一个新项目并将“DynamicWebModule版本更改为3.1”和“JavaServerFacesVersion更改为2.2”修复了这个错误。以前,它们分别被设置为版本4和2.3。

葛炜
2023-03-14

我已经添加了beans.xml文件WEB-INF目录下的以下内容和错误消失。最后,我能够在“动态网络模块版本4.0”和“Java服务器面孔版本2.3”中运行我的Hello world程序。

豆。xml内容

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
       version="2.0" bean-discovery-mode="annotated">

</beans>
 类似资料:
  • 我正在努力学习React,我正在使用一个私人回购开始。 我在repo目录中运行,但得到错误消息: 我已经安装了节点和纱线。

  • 26-org.apache.karaf.deployer.features-4.0.1无法安装功能java.io.ioexception:错误解析项目org.apache.cxf.dosgi:cxf-dosgi:xml:features:1.7.0:无法将项目org.apache.cxf.dosgi:cxf-dosgi:xml:features:1.7.0:无法将项目org.apache.cxf.

  • 我不能安装任何需要的包。错误消息如下所示 我还尝试了包,得到了完全相同的结果。 路径: Make:GNU Make 3.81安装在中(来自官方的Debian包) 分册:Debian 6.0.8 ARCH:AMD64 构建-基本包:已安装 节点:从源手工构建 安装非GYP软件包:正常工作

  • 你好,我试图学习野蝇和springboose一个非常简单的应用程序使用eclipse。项目名称是springboo-test。包括主方法类在内的所有类都在同一个包中。 主方法类称为'App',其代码如下: 以下是服务器日志: 11:36:57281信息[org.wildfly.extension.undertow](服务器服务线程池--68)WFLYUT0021:注册的web上下文:'/sprin

  • 问题内容: 我有一个由Eclipse生成的.jar,我无法在其他计算机(与Windows XP)上运行。出现“找不到主类。程序将退出”消息。那台计算机可以在Netbeans生成的另一个.jar上正常运行,所以我想JRE并不是问题。我更新了JRE,但没有改变。问题是什么? 更新:我忘了提,我做了一个可运行的jar文件。在另外两台计算机上,它可以正常工作(win 7和XP),但在特定计算机上则不能。

  • 问题内容: 所有, 我的类路径已设置为以下文件夹: 我所有的Java文件和类文件都在中列出的文件夹下。 但是在运行in 文件夹时出现以下错误: 谁能帮我理解这里的原因? 问题答案: 您在包装内。您应该坐在包根目录中。上一个文件夹。 然后使用重新执行它。 就是说,您不应该使用环境变量。您的当前也是无效的。未加引号的路径名中有空格。另外,该文件夹不应放在类路径中。只需使用like这样的参数(坐在包根文