一尘不染

Spring Boot异常:无法打开ServletContext资源[/WEB-INF/dispatcherServlet-servlet.xml]

spring-boot

我已经开发了此概念证明https://github.com/DISID/disid-proofs/tree/master/spring-boot-
weblogic,以测试Weblogic 12c(12.2.1)中Spring Boot应用程序的部署。

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

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

我错过了什么?

谢谢,


阅读 1063

收藏
2020-05-30

共1个答案

一尘不染

我已经使用spring-boot-sample-war(以及用于处理日志记录的附加weblogic.xml )在WebLogic 12.2.1.0(纯新安装)中重现了此问题。还尝试了最新的补丁集(WLS
PATCH SET UPDATE 12.2.1.0.160419),但问题仍然存在。

出于某种原因,一旦访问/上可用的应用程序,WebLogic决定需要使用其自身的配置来创建DispatcherServlet。

我已经向Oracle支持小组提出了服务请求,我们将看看他们对这个问题的看法。

更新:Oracle WebLogic Server
12.2.1.0.0可以使用“补丁23124727:由于JAVA.IO.FILENOTFOUNDEXCEPTION而无法在12.2.1上部署弹簧启动.WAR”,并且与spring-
boot-sample-war和一个更高级的应用程序。

2020-05-30