Spring Boot exception: Could not open ServletContext resource [/WEB-INF/dispatcherServlet-servlet.xml]

前端 未结 2 483
北海茫月
北海茫月 2020-12-06 01:49

I have developed this proof of concept https://github.com/DISID/disid-proofs/tree/master/spring-boot-weblogic to test the deployment of Spring Boot applications in Weblogic

相关标签:
2条回答
  • 2020-12-06 02:12

    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.

    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 /.

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

    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.

    0 讨论(0)
  • 2020-12-06 02:22

    I found a workaround putting a dummy dispatcherServlet-servlet.xml file under WEB-INF:

    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans.xsd">
    
        <!-- Do not remove this file! -->
    
    </beans>
    
    0 讨论(0)
提交回复
热议问题