- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用 JBoss AS 7.1.1 + CDI (Weld) + JSF + Intellij IDEA。我创建了项目并下载了文件:
1. jsf-api.jar
2. jsf-impl.jar
3. jstl-1.1.0.jar
4. weld-servlet.jar
一切正常,直到我开始使用 Weld(创建 beans.xml 并将 ManagedBeans 重命名为 Named)。在此之后,工件停止部署并出现错误:
"CONFIGURATION FAILED! WELD-001001 Cannot pass null expressionFactory".
错在哪里?可能存在不兼容技术版本?我已经用 IDE Idea 下载了文件。
编辑:
[2012-12-19 02:17:27,111] Artifact war exploded: Artifact is being deployed, please wait... 14:17:27,314 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "war_exploded.war" 14:17:28,190 WARN [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Tomcat6InjectionProvider:org.apache.catalina.util.DefaultAnnotationProcessor' for service type 'com.sun.faces.spi.injectionprovider' 14:17:28,193 WARN [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Jetty6InjectionProvider:org.mortbay.jetty.plus.annotation.InjectionCollection' for service type 'com.sun.faces.spi.injectionprovider' 14:17:28,233 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016002: Processing weld deployment war_exploded.war 14:17:28,258 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016005: Starting Services for CDI deployment: war_exploded.war 14:17:28,263 INFO [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016008: Starting weld service for deployment war_exploded.war 14:17:28,334 INFO [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored. 14:17:28,342 INFO [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Initializing Mojarra 2.1.7-jbossorg-1 (20120227-1401) for context '/war_exploded' 14:17:28,429 WARNING [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) JSF1067: Resource /META-INF/faces-config.xml specified by the javax.faces.CONFIG_FILES configuration option cannot be found. The resource will be ignored. 14:17:28,458 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Critical error during deployment: : com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! WELD-001001 Cannot pass null expressionFactory at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:376) [jsf-impl-2.1.7-jbossorg-2.jar:] at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.7-jbossorg-2.jar:] at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:] at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_03] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_03] at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_03] Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001001 Cannot pass null expressionFactory at org.jboss.weld.el.WeldExpressionFactory.<init>(WeldExpressionFactory.java:38) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] at org.jboss.weld.manager.BeanManagerImpl.wrapExpressionFactory(BeanManagerImpl.java:995) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] at org.jboss.as.weld.webtier.jsf.WeldApplication.getExpressionFactory(WeldApplication.java:91) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final] at org.jboss.weld.environment.servlet.jsf.WeldApplication.init(WeldApplication.java:79) [weld-servlet.jar:20120429-1045] at org.jboss.weld.environment.servlet.jsf.WeldApplication.delegate(WeldApplication.java:87) [weld-servlet.jar:20120429-1045] at org.jboss.weld.environment.servlet.jsf.ForwardingApplication.getActionListener(ForwardingApplication.java:168) [weld-servlet.jar:20120429-1045] at com.sun.faces.config.processor.ApplicationConfigProcessor.addActionListener(ApplicationConfigProcessor.java:459) [jsf-impl-2.1.7-jbossorg-2.jar:] at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:290) [jsf-impl-2.1.7-jbossorg-2.jar:] at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.7-jbossorg-2.jar:] at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116) [jsf-impl-2.1.7-jbossorg-2.jar:] at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.7-jbossorg-2.jar:] at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:222) [jsf-impl-2.1.7-jbossorg-2.jar:] at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.7-jbossorg-2.jar:] ... 9 more
14:17:28,487 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/war_exploded]] (MSC service thread 1-1) Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! WELD-001001 Cannot pass null expressionFactory at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292) [jsf-impl-2.1.7-jbossorg-2.jar:] at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:] at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_03] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_03] at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_03] Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! WELD-001001 Cannot pass null expressionFactory at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:376) [jsf-impl-2.1.7-jbossorg-2.jar:] at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.7-jbossorg-2.jar:] ... 8 more Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001001 Cannot pass null expressionFactory at org.jboss.weld.el.WeldExpressionFactory.<init>(WeldExpressionFactory.java:38) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] at org.jboss.weld.manager.BeanManagerImpl.wrapExpressionFactory(BeanManagerImpl.java:995) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] at org.jboss.as.weld.webtier.jsf.WeldApplication.getExpressionFactory(WeldApplication.java:91) [jboss-as-weld-7.1.1.Final.jar:7.1.1.Final] at org.jboss.weld.environment.servlet.jsf.WeldApplication.init(WeldApplication.java:79) [weld-servlet.jar:20120429-1045] at org.jboss.weld.environment.servlet.jsf.WeldApplication.delegate(WeldApplication.java:87) [weld-servlet.jar:20120429-1045] at org.jboss.weld.environment.servlet.jsf.ForwardingApplication.getActionListener(ForwardingApplication.java:168) [weld-servlet.jar:20120429-1045] at com.sun.faces.config.processor.ApplicationConfigProcessor.addActionListener(ApplicationConfigProcessor.java:459) [jsf-impl-2.1.7-jbossorg-2.jar:] at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:290) [jsf-impl-2.1.7-jbossorg-2.jar:] at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.7-jbossorg-2.jar:] at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116) [jsf-impl-2.1.7-jbossorg-2.jar:] at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.1.7-jbossorg-2.jar:] at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:222) [jsf-impl-2.1.7-jbossorg-2.jar:] at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.7-jbossorg-2.jar:] ... 9 more
14:17:28,519 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Error listenerStart 14:17:28,520 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Context [/war_exploded] startup failed due to previous errors 14:17:28,522 SEVERE [javax.faces] (MSC service thread 1-1) Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory. Attempting to find backup. 14:17:28,524 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Unexpected exception when attempting to tear down the Mojarra runtime: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory. at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1008) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final] at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final] at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:131) [jsf-impl-2.1.7-jbossorg-2.jar:] at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:328) [jsf-impl-2.1.7-jbossorg-2.jar:] at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3489) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3999) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.StandardContext.start(StandardContext.java:3917) [jbossweb-7.0.13.Final.jar:] at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_03] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_03] at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_03]
14:17:28,540 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.web.deployment.default-host./war_exploded: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./war_exploded: JBAS018040: Failed to start context at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_03] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_03] at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_03]
14:17:28,750 INFO [org.jboss.as.server] (management-handler-thread - 20) JBAS015870: Deploy of deployment "war_exploded.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./war_exploded" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./war_exploded: JBAS018040: Failed to start context"}} 14:17:28,757 INFO [org.jboss.weld.deployer] (MSC service thread 1-8) JBAS016009: Stopping weld service for deployment war_exploded.war 14:17:28,780 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015877: Stopped deployment war_exploded.war in 31ms 14:17:28,782 INFO [org.jboss.as.controller] (management-handler-thread - 20) JBAS014774: Service status report JBAS014777: Services which failed to start: service jboss.web.deployment.default-host./war_exploded: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./war_exploded: JBAS018040: Failed to start context
[2012-12-19 02:17:28,918] Artifact war exploded: Error during artifact deployment. See server log for details.
最佳答案
如果您使用的容器可以验证 Web 配置文件或完整配置文件(JBoss AS7 都是),您不包含任何 CDI、JSF 或 jSTL(我不知道为什么您需要它,JSF 2 默认使用 facelets)在你的 war 中,它们已经由容器为你提供。
简而言之,除非您使用 jetty 或普通 tomcat,否则不要在您的 war 中捆绑任何规范 jar 或规范实现 jar。
关于Java Weld 空表达式工厂,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13950497/
我正在尝试从 Glassfish+Jersey+Weld 迁移到 Jetty。 我有这样的设置:gist of pom.xml, web.xml and Java launcher . 应用程序似乎可
注意:我已经尝试过类似问题的可用解决方案。 我正在使用JSF,Java 8,Tomcat 9,Maven,H2 db开发一个简单的CRUD应用程序。 当我尝试启动服务器时,发生以下异常 由以下原因
我刚刚将 Weld 从版本 2.4.4 更新到 3.0.1。我在应用程序启动时遇到以下错误,但找不到解决方案。我正在使用 Weld SE。 Sep 15, 2017 1:25:12 PM org.jb
我想使用 WELD SE 和 JEE8 (CDI 2.0) 创建 REST 资源的单元测试。 这是 REST 资源类的代码: @Path("/members") @RequestScoped publ
我正在使用 NetBeans 和 Glassfish 4.1.1 开发一个 Web 应用程序。我使用 JSF 和 CDI 来管理 Facelets 的支持 bean。由于在更改代码中的任何内容后不久,
从 JPA 2.1 开始,可以将 EJB 注入(inject)到实体监听器中。然而,WildFly 9.0.2 final 失败并出现以下异常。 15:41:12,125 ERROR [org.jbo
我使用 Weld SE 创建了一个简单的 JavaSE 应用程序。我正在尝试使用 gradle run 运行它会抛出异常: :compileJava UP-TO-DATE :processResour
我正在尝试在 DAO 类中注入(inject)一个实体管理器并使用 Weld 容器对其进行测试,但我不断收到以下异常: org.jboss.weld.exceptions.NullInstanceEx
由于某种原因,以下代码不起作用,我不明白为什么。我目前的,相当随意的,从大惊小怪的几个细微变化的信念是,因为 bean 是在 ExternalContext 之前创建的。它导致异常。但是,Extern
我有一个 Java 8 项目和一个 JBoss 7.1.0GA 服务器。我有一个带有全局变量的批处理类 @EJB public MyInterface delegate; 它在我的 ejb-jar.x
我的项目昨天运行良好。我唯一做的就是将结构从单一 war 更改为多模块 pom。如果我正确理解堆栈跟踪,则焊接和omnifaces websocket lib之间存在歧义。但是,在堆栈跟踪上似乎没有对
我按照文档(https://docs.jboss.org/weld/reference/latest/en-US/html/injection.html)创建限定符,现在我在wildfly-10.1.
我正在开发一个 JavaFX 2 项目,并且该应用程序必须使用另一个 main 方法(根据生成的 JAR list 为 com.javafx.main.Main)启动。据官方焊缝reference引导
我们有一个 Web 应用程序,目前正在使用 Java EE 7、JSF 2.2 和 Glassfish 4.0 开发。有两个特定的托管 Bean,它们具有循环依赖关系。 Usuario Control
我正在使用 Weld 来观察事件。我认为有一种方法可以指定观察者是否异步,但我没有找到该注释或文档。 观察者可以是异步的吗?如果是这样,我需要做什么才能做到这一点? 最佳答案 有一个开放请求:CDI-
我正在尝试将 war 部署到 JBoss AS 7.1.1 服务器中,但在尝试注入(inject) EntityManager 时部署失败: 17:44:48,037 ERROR [org.jboss
我尝试在 Weld 中制作装饰器,但 Weld 返回错误。我不明白我的错误是什么。我使用了相同的 Weld 示例“weld-se-numberguess”,并创建了一个装饰器扩展游戏。 Set 18
我使用 JBoss AS 7.1.1 + CDI (Weld) + JSF + Intellij IDEA。我创建了项目并下载了文件: 1. jsf-api.jar 2. jsf-impl.jar 3
我正在搭建学习 JavaEE7 中 CDI 的基础环境。我有以下用于启动 Weld 的代码。只是启动和关闭。 package com.anshbansal; import org.jboss.weld
我使用 weld se 2.0 和其他简单的依赖项构建了一个应用程序。在我的开发环境(eclipse)中这工作正常,没有错误,但是......在生产中应用程序完全崩溃并且焊接的实习生依赖部分抛出“模糊
我是一名优秀的程序员,十分优秀!