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

下拖和Spring引导1.4错误

暨修洁
2023-03-14

当运行undertow和spring-boot1.4时,我得到了NullPointerException。

未激活StartupServletContextListener时可能会发生此错误。它是由UndertowMyFacesSpringBootaUtoConfiguration创建的。Debug表示它已激活:

   UndertowMyfacesSpringBootAutoConfiguration matched
      - @ConditionalOnClass classes found: io.undertow.Undertow,org.apache.myfaces.webapp.StartupServletContextListener (OnClassCondition)

上面的堆栈跟踪:

java.lang.NullPointerException: null at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:62) ~[myfaces-bundle-2.2.10.jar!/:2.2.10]
    at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:172) ~[myfaces-bundle-2.2.10.jar!/:2.2.10]
    at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:121) [myfaces-bundle-2.2.10.jar!/:2.2.10]
    at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187) [undertow-servlet-1.3.23.Final.jar!/:1.3.23.Final]
    at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:198) [undertow-servlet-1.3.23.Final.jar!/:1.3.23.Final]
    at org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory.createDeploymentManager(UndertowEmbeddedServletContainerFactory.java:390) [spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
    at org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory.getEmbeddedServletContainer(UndertowEmbeddedServletContainerFactory.java:224) [spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164) [spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) [spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535) [spring-context-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) [spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369) [spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:313) [spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185) [spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174) [spring-boot-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
    at org.joinfaces.example.JoinFacesExampleApplication.main(JoinFacesExampleApplication.java:10) [classes!/:2.1.4-SNAPSHOT]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_101]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_101]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_101]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_101]
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [joinfaces-example-2.1.4-SNAPSHOT.jar:2.1.4-SNAPSHOT]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [joinfaces-example-2.1.4-SNAPSHOT.jar:2.1.4-SNAPSHOT]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [joinfaces-example-2.1.4-SNAPSHOT.jar:2.1.4-SNAPSHOT]
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58) [joinfaces-example-2.1.4-SNAPSHOT.jar:2.1.4-SNAPSHOT]

共有1个答案

涂溪叠
2023-03-14

错误出现在JoinFaces Undertow starter上,因为它使用了两个版本的JspFactory类。

Duplicate Finder Maven插件现在被用来避免重复的类和资源。

 类似资料:
  • 请帮助我在Spring启动应用程序,它不工作。我太紧张了。 文件夹列表 null 导入org.springframework.boot.springapplication;导入org.springframework.boot.autocigure.springbootapplication MainController类: 包装控制器; 和错误消息: 并且在资源/模板中有一个index.htm文件

  • 我试图在spring boot应用程序中作为servlet容器运行undertow,我遵循了所有关于它的说明,但从日志来看,tomcat似乎是web服务器。 以下是日志: 21-03-17 00:15:45.481INFO[,][restartedMain]o.s.b.w.embedded.tomcat.TomcatWebServer:Tomcat初始化端口:8080(超文本传输协议) 2021-

  • 是否可以根据我使用的Spring Boot配置文件加载不同的log4j配置。 假设我在application.properties中 在application-live.properties中,我为所有3个都有不同的值

  • 我正在tomcat(Servlet2.5)中运行一个传统的Spring启动战。虽然CharacterEncodingFilter默认配置为spring boot 1.2.0,但请求没有任何编码集。我可以在自动配置和日志中看到它的配置。这可能不是由SpringBootLegacy(1.0.1)配置的?我将过滤器添加到web。xml和我的请求现在采用utf-8编码。但是,这不适用于请求参数。我认为这是

  • 当我在项目中包括spring boot时,它有其他spring组件的预定义版本。带有spring boot starter web的spring boot 1.3.5自动包含spring mvc 4.2.6。如果我想使用WebMVC4.3中的一些功能,我怎么知道它们是兼容的?是否存在兼容性矩阵?还是我应该把它当作一个单一的版本,永远不改变版本?

  • 当线程停止时,关闭Spring引导的正确方法是什么?我不应该使用Spring中的吗? 谢谢!