Spring Boot 异常:无法打开 ServletContext 资源 [/WEB

编程入门 行业动态 更新时间:2024-10-26 20:25:19
本文介绍了Spring Boot 异常:无法打开 ServletContext 资源 [/WEB-INF/dispatcherServlet-servlet.xml]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经开发了这个概念证明 github/DISID/disid-proofs/tree/master/spring-boot-weblogic 用于测试Spring Boot应用在Weblogic 12c (12.2.1)中的部署.

I have developed this proof of concept github/DISID/disid-proofs/tree/master/spring-boot-weblogic to test the deployment of Spring Boot applications in Weblogic 12c (12.2.1).

应用程序部署并成功启动,但是当我尝试连接到它时(即/accounts?number=1234)显示以下错误:

The application deploys and starts successfully, but when I try to connect to it (i.e. /accounts?number=1234) the error below is shown:

Error 500--Internal Server Error From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1: 10.5.1 500 Internal Server Error The server encountered an unexpected condition which prevented it from fulfilling the request.

并且日志文件有异常:

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/dispatcherServlet-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/dispatcherServlet-servlet.xml] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:344) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:609) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:510) at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) at javax.servlet.GenericServlet.init(GenericServlet.java:244) at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run

我错过了什么吗?

谢谢,

推荐答案

我已经使用 spring-boot-sample-war (带有额外的 weblogic.xml 来处理日志记录).还尝试了最新的补丁集(WLS PATCH SET UPDATE 12.2.1.0.160419),但问题仍然存在.

I've reproduced this issue with WebLogic 12.2.1.0 (plain new install) using spring-boot-sample-war (with an additional weblogic.xml to handle logging). Also tried the latest patchset (WLS PATCH SET UPDATE 12.2.1.0.160419), but the issue remains.

出于某种原因,WebLogic 决定它需要在您访问/上可用的应用程序后立即使用它自己的配置创建 DispatcherServlet.

For some reason WebLogic decides it needs to create the DispatcherServlet using it's own configuration as soon as you access the application available on /.

我已向 Oracle 支持部门提出了服务请求,我们将看看他们对此问题的看法.

I've put in a service request to Oracle Support and we'll see what they think about this issue.

更新:补丁 23124727:由于 JAVA.IO.FILENOTFOUNDEXCEPTION,无法在 12.2.1 上部署 SPRING BOOT .WAR"可用于 Oracle WebLogic Server 12.2.1.0.0 并与 spring-boot-sample-war 一起使用以及更高级的应用程序.

Update: 'Patch 23124727: CANNOT DEPLOY SPRING BOOT .WAR ON 12.2.1 DUE TO JAVA.IO.FILENOTFOUNDEXCEPTION' is available for Oracle WebLogic Server 12.2.1.0.0 and works with both the spring-boot-sample-war as well as a more advanced application.

更多推荐

Spring Boot 异常:无法打开 ServletContext 资源 [/WEB

本文发布于:2023-10-28 17:48:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1537342.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法打开   异常   资源   Spring   Boot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!