- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 eclipse 中使用 WildFly 18,jdk-13.0.1 编写了我的第一个 JSF hello world 程序。 , window 10。
Wildfly home 和管理控制台工作找到但在从 url http://localhost:8080/jsf1/faces/WEB-INF/helloworld.xhtml
执行程序时它给出 404 - 不发现
错误。我在 url http://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)
最佳答案
我在 WEB-INF
目录中添加了 beans.xml
文件,内容如下,错误消失了。最后,我能够在“Dynamic Web Module version 4.0”和“Java Server Faces version 2.3”中运行我的 hello world 程序。
beans.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>
关于jsf - Wildfly 以错误开始。 javax.faces.FacesException : Unable to find CDI BeanManager,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59607677/
在上述用例中,BeanManager 在单元测试期间不会返回 bean。该项目是一个Java 库。 Bean接口(interface) public interface My { String t
我正在尝试设置一个简单的应用程序,以在 Wildfly 14 上使用 SpringBoot 2.1.1 和 Java 11(因为 Eclipse 不支持 Wildfly 15)。 部署失败,因为 Wi
我有部署到 glassfish 的 .war 应用程序。我想做 CDI,所以我需要从我的 POJO 中查找 java:comp/BeanManager。但它不起作用:根本找不到 BeanManager
我正在尝试将 war 文件部署到 Wildfly 10.0.0.Final 中,部署失败并出现以下错误: "{\"WFLYCTL0080: Failed services\" => {\"jboss.
我在java se上使用weld+paxcdi。我可以使用 beanManager 获取引用 @Inject BeanManager beanManager; 但是,很明显,我只能在由 CDI 容器管
我正在尝试使用 JSF(使用 IntelliJ 的默认“hello world”项目)建立一个基本项目,但我不断收到 javax.faces.FacesException: Unable to fin
我正在工作中测试 Vaadin 14 的概念产品。我已确保安装 NodeJS (V13.3.0) 和 NPM (6.13.1),并将其包含到我的 POM.xml 中> 文件。我目前使用的是 JRE 和
据我所知,每个 osgi 包都有自己的 cdi 容器。所以我有以下情况 - 我有两个 bundle :A 和 B。 bundle 部署在 glassfish4 中。在 bundle A 中,我有 cd
这个问题在这里已经有了答案: Wildfly starts with error. javax.faces.FacesException: Unable to find CDI BeanManage
我已经在本地主机上运行的本地服务器上成功部署了一场 war 。但是,当我将 WAR 部署到我的远程 AWS 实例时,服务器会正确启动,但会在启动几秒钟后取消部署我的 WAR。 启动后,我从 sta
我认为有两种通用方法可以通过 BeanManager 获取自动创建的 CDI 托管 bean 实例。当只有 Bean 时首先(基于 Class 创建): 作者: BeanManager#getRefe
我正在尝试使用 BeanManager 而不是 Instance .select().get() 创建 CDI 托管 bean 的实例。 这被建议作为解决我一直遇到的 ApplicationScope
当尝试部署耳朵时,我们得到了臭名昭著的 WELD-001408(请参阅下面的堆栈跟踪)。 问题:WELD 似乎无法通过 @Inject 将 EJB 注入(inject) lib/shared.jar
运行于: Apache 汤姆猫 7.0.47OmniFaces 1.6.3JSF 莫哈拉 2.1.26CDI Weld 2.1.0.Final 通过访问 JNDI“java:comp/BeanMana
在 JEE/CDI 的上下文中,当我需要从方法中静态检索 CDI 托管 bean 时,我发现自己通常使用 CDI 静态函数。例如: MyBean myBean = CDI.current().sele
我在 eclipse 中使用 WildFly 18,jdk-13.0.1 编写了我的第一个 JSF hello world 程序。 , window 10。 Wildfly home 和管理控制台工作
我在 eclipse 中使用 WildFly 18,jdk-13.0.1 编写了我的第一个 JSF hello world 程序。 , window 10。 Wildfly home 和管理控制台工作
有一个包 A,并且包 A 中有一个类 MyClass。我们假设 pax-cdi+weld 已打开。 我可以在不使用@Inject和其他CDI注释的情况下获取MyClass内bundle A的BeanM
在我的 JSF 应用程序中构建了很多转换器之后,我将注意力转向了 Omnifaces,一切都运行良好。当我部署我的应用程序时出现问题。我第一次访问我的登录页面时,它抛出下一个异常: SEVER
我正在尝试显示来自托管 bean 方法的图像,该方法返回 byte[]与 使用 omnifaces 我在 WEB_INF/lib 中部署了 omnifaces 2.1这是我的代码 注册.java pu
我是一名优秀的程序员,十分优秀!