我已经开发了这个概念验证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
我错过了什么?
谢谢,
我找到了一个解决方法,将虚拟dispatcherServlet-servlet.xml
文件放在WEB-INF
:
我使用spring-boot-sample-war(使用额外的weblogic.xml来处理日志记录),使用WebLogic 12.2.1.0(普通新安装)重现了这个问题.还尝试了最新的补丁集(WLS PATCH SET UPDATE 12.2.1.0.160419),但问题仍然存在.
出于某种原因,只要您访问/上可用的应用程序,WebLogic就会决定使用自己的配置来创建DispatcherServlet.
我已向Oracle支持部门提出服务请求,我们将看到他们对此问题的看法.
更新:'补丁23124727:无法部署SPRING BOOT.由于JAVA.IO.FILENOTFOUNDEXCEPTION 12.2.1可用于Oracle WebLogic Server 12.2.1.0.0并且可以同时使用spring-boot-sample-war以及更高级的应用程序.