Spring Boot App does not deploy on Glassfish 4.1

后端 未结 1 1936
南方客
南方客 2020-12-09 12:38

I have a vanilla spring boot app that consists of the following pom.xml

 


        
相关标签:
1条回答
  • 2020-12-09 12:51

    It looks like this a bug in Glassfish: GLASSFISH-21265

    You can try to get around that by adding metadata-complete="true" in your web.xml like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="3.1" 
             metadata-complete="true"
             xmlns="http://xmlns.jcp.org/xml/ns/javaee" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
    </web-app>
    

    The metadata-complete="true" indicates that the JAR files in /WEB-INF/lib doesn't need to be scanned for Servlet 3.0 specific annotations, but the webapp's own classes will still be scanned.

    See also:

    • Spring Boot on Glassfish
    • Spring Boot app deployed to Glassfish is giving strange results
    • Cannot deploy simple project on Glassfish 3.1.2 and 4.0.0+
    • Spring.io Blog - Deploying Spring Boot Applications
    0 讨论(0)
提交回复
热议问题