- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试设置一个简单的应用程序,以在 Wildfly 14 上使用 SpringBoot 2.1.1 和 Java 11(因为 Eclipse 不支持 Wildfly 15)。
部署失败,因为 Wildfly 在项目中找不到 CDI BeanManager。我只是想遵循简单的(官方)教程,所以我不明白为什么会出现错误。
这是代码:
pom.xml
<properties>
<start-class>main</start-class>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
</parent>
<!-- Add typical dependencies for a web application -->
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<!-- Package as an executable jar -->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
应用程序.java
package main;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@EnableAutoConfiguration
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
这是堆栈跟踪:
> 12:51:13,365 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) WFLYSRV0027: Starting deployment of "SpringBoot-0.0.1.war" (runtime-name: "SpringBoot-0.0.1.war")
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by io.undertow.util.FlexBase64$1 (jar:file:/C:/Users/87003556/Documents/Java/Wildfly%2014/modules/system/layers/base/io/undertow/core/main/undertow-core-2.0.13.Final.jar!/) to constructor java.lang.String(char[],boolean)
> WARNING: Please consider reporting this to the maintainers of io.undertow.util.FlexBase64$1
> WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
> WARNING: All illegal access operations will be denied in a future release
> 12:51:13,429 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
> 12:51:13,531 INFO [org.jboss.ws.common.management] (MSC service thread 1-8) JBWS022052: Starting JBossWS 5.2.3.Final (Apache CXF 3.2.5.jbossorg-1)
> 12:51:15,606 WARN [org.jboss.as.ee] (MSC service thread 1-1) WFLYEE0007: Not installing optional component org.springframework.http.server.reactive.ServletServerHttpResponse$ResponseAsyncListener due to an exception (enable DEBUG log level to see the cause)
> 12:51:15,606 WARN [org.jboss.as.ee] (MSC service thread 1-1) WFLYEE0007: Not installing optional component org.springframework.http.server.reactive.ServletHttpHandlerAdapter$HandlerResultAsyncListener due to an exception (enable DEBUG log level to see the cause)
> 12:51:15,622 WARN [org.jboss.as.ee] (MSC service thread 1-1) WFLYEE0007: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to an exception (enable DEBUG log level to see the cause)
> 12:51:15,622 WARN [org.jboss.as.ee] (MSC service thread 1-1) WFLYEE0007: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to an exception (enable DEBUG log level to see the cause)
> 12:51:15,622 WARN [org.jboss.as.ee] (MSC service thread 1-1) WFLYEE0007: Not installing optional component org.springframework.http.server.reactive.ServletServerHttpRequest$RequestAsyncListener due to an exception (enable DEBUG log level to see the cause)
> 12:51:15,794 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-7) ISPN000128: Infinispan version: Infinispan 'Estrella Galicia' 9.3.1.Final
> 12:51:15,966 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 72) WFLYCLINF0002: Started client-mappings cache from ejb container
> 12:51:16,075 INFO [io.undertow.servlet] (ServerService Thread Pool -- 85) 1 Spring WebApplicationInitializers detected on classpath
> 12:51:16,153 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 85) Initializing Mojarra 2.3.5.SP2 for context '/SpringBoot-0.0.1'
> 12:51:16,761 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 85) Critical error during deployment: : com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
> at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:357)
> at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:243)
> at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:443)
> at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:237)
> at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
> at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:216)
> at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:185)
> at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
> at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
> ...
> at org.jboss.threads.JBossThread.run(JBossThread.java:485)
> Caused by: javax.faces.FacesException: Unable to find CDI BeanManager
> at com.sun.faces.application.ApplicationImpl.isJsf23(ApplicationImpl.java:2714)
> at com.sun.faces.application.ApplicationImpl.addELResolver(ApplicationImpl.java:549)
> ...
> at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:292)
> at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:354)
> ... 29 more
>
> 12:51:16,761 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 85) MSC000001: Failed to start service jboss.deployment.unit."SpringBoot-0.0.1.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."SpringBoot-0.0.1.war".undertow-deployment: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
> at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:81)
> at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
> ...
> at java.base/java.lang.Thread.run(Thread.java:825)
> at org.jboss.threads.JBossThread.run(JBossThread.java:485)
> Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
> at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:252)
> at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
> at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
> ... 8 more
> Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
> at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:315)
> at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
> at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:216)
> at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:185)
> at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
> ...
> at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:250)
> ... 10 more
> Caused by: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
> at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:357)
> ...
> at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:237)
> ... 26 more
> Caused by: javax.faces.FacesException: Unable to find CDI BeanManager
> at com.sun.faces.application.ApplicationImpl.isJsf23(ApplicationImpl.java:2714)
> at com.sun.faces.application.ApplicationImpl.addELResolver(ApplicationImpl.java:549)
> at org.jboss.as.jsf.injection.weld.WeldApplication.<init>(WeldApplication.java:60)
> at org.jboss.as.jsf.injection.weld.WeldApplicationFactory.getApplication(WeldApplicationFactory.java:52)
> at com.sun.faces.application.InjectionApplicationFactory.getApplication(InjectionApplicationFactory.java:88)
> ... at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:292)
> at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:354)
> ... 29 more
>
> 12:51:16,762 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "SpringBoot-0.0.1.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"SpringBoot-0.0.1.war\".undertow-deployment" => "java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
> Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
> Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
> Caused by: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
> Caused by: javax.faces.FacesException: Unable to find CDI BeanManager"}}
> 12:51:16,762 INFO [org.jboss.as.server] (ServerService Thread Pool -- 42) WFLYSRV0010: Deployed "SpringBoot-0.0.1.war" (runtime-name : "SpringBoot-0.0.1.war")
> 12:51:16,762 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
> WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."SpringBoot-0.0.1.war".undertow-deployment: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
最佳答案
正如我们在评论中讨论的那样,解决方案可能就像将 cdi-api
添加到 pom.xml 依赖项一样简单。它不包含在您指定的依赖项中。
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>1.2</version>
</dependency>
关于java - 无法找到 CDI BeanManager,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54021886/
我想用 CDI 实现工厂模式。这里我们有一个商业案例示例: A client provides a string representing a type. Depending on this type
我在这里的部分问题是使用正确的词汇,所以我提前为这可能是一个简单的术语问题道歉。 假设我有一个 Person接口(interface)和 PersonBean实现该接口(interface)的类。 进
我想我了解 CDI 的工作原理,为了深入研究它,我想尝试将它与现实世界的示例一起使用。我被一件事困住了,我需要你的帮助才能让我理解。我非常感谢您在这方面的帮助。 我有自己的工作流框架,使用 Java
来自 Guice 背景,我知道可以使用范围从范围中播种对象值。 scope.seed(Key.get(SomeObject.class), someObject); 我想可以通过注册一个从 Abs
JSR-299 (CDI) 引入了资源的(不幸命名的)概念:http://docs.jboss.org/weld/reference/1.0.0/en-US/html/resources.html#d
规范说,当作用域的上下文即将被销毁时,CDI 容器会删除 SFSB。它如何准确地删除 EJB?它似乎没有调用带有@Remove 注释的方法。 @Stateful public class Custom
我有一个手动初始化的对象(遗留代码)。我想将此对象放入应用程序上下文,以使其通过 CDI 可用。 如何在不编写 CDI 扩展的情况下做到这一点? 最佳答案 使用生产者。制作一个 @Produces 您
我有一个关于在 Java EE 中拥有一个尽可能不耦合的系统的最佳实现的问题,问题是使用 CDI 事件还是 CDI 拦截器更好,显然对于安全性之类的事情来说拦截器,对于日志,例如根据具体情况的两者中的
我正在尝试做简单的事情。注塑合格String (或 File )在 CDI 中。 所以我有一个限定符: @Retention(RetentionPolicy.RUNTIME) @Target({FIE
使用 Wildfly 8.2.0.Final(我相信它使用 Weld 2.2),我在 Maven 多模块项目中用 2 个简单的类重现了这个问题。一个生成一个 javax.ws.rs.client.Cl
我正在使用 picketlink 对项目中的用户进行身份验证。我还创建了一个 @produces 注释方法,因此我可以在其他地方注入(inject)经过身份验证的用户。现在,我正在使用 envers,
是否可以在使用 new 关键字创建的类中获取 CDI bean 的实例?我们目前正在对一个旧应用程序进行一些改进,我们总是得到一个 ContextNotActiveException每次我们做 pro
我正在尝试在 WildFly 8.1.0.Final 上使用 CDI 运行 Liquibase 脚本,但出现此错误: Unsatisfied dependencies for type Resourc
在没有值的情况下使用 CDI @Named 有什么意义吗?难道这不就相当于一起使用@Qualifier和@Default吗? @Named public class GifFileEditor imp
我在 JBoss-7 环境中使用 ReastEasy,目前正在实现安全功能。我正在使用带有 SSL 连接的 HTTP Basic。添加和评估 header 参数很容易(感谢 Passing param
我正在开发一些应用程序,它由三层组成: 数据库访问层(JPA + Hibernate 作为提供者) 业务逻辑层 表示层 (JSF 2.0) 在开始之前,我已经阅读了 David Geary 和 Cay
在 CDI 中,我能够注入(inject)具有特定范围的 bean,即定义 bean 类的范围。但是,如果我创建没有任何作用域的 bean 类,并且在注入(inject)时为该 bean 赋予作用域,
我们想使用 Jglue 框架对我们的 CDI 应用程序进行单元测试。我们使用 gradle 进行构建。 我们准备了这样的东西: 1) 要测试的类: @Default public class Rate
我已经有一个 session 范围的 CDI bean,它保持当前登录的用户数据。 现在,从另一个请求范围内,我想访问这个 bean 以获取一些数据。我有一些操作要做,这取决于用户登录。这是我需要的唯
有一个包 A,并且包 A 中有一个类 MyClass。我们假设 pax-cdi+weld 已打开。 我可以在不使用@Inject和其他CDI注释的情况下获取MyClass内bundle A的BeanM
我是一名优秀的程序员,十分优秀!