Spring Boot App不会部署在Glassfish 4.1上

我有一个香草弹簧启动应用程序,由以下pom.xml组成

  4.0.0 xxx.alexius myapp 1.0-SNAPSHOT war my app Core Application Platform  org.springframework.boot spring-boot-starter-parent 1.2.2.RELEASE     UTF-8 1.7    org.springframework.boot spring-boot-starter-data-jpa   org.springframework.boot spring-boot-starter-data-mongodb   org.springframework.boot spring-boot-starter-mobile   org.springframework.boot spring-boot-starter-security   org.springframework.boot spring-boot-starter-social-facebook   org.springframework.boot spring-boot-starter-social-twitter   org.springframework.boot spring-boot-starter-thymeleaf   org.springframework.boot spring-boot-starter-web   mysql mysql-connector-java runtime   org.postgresql postgresql 9.4-1201-jdbc41 runtime   org.springframework.boot spring-boot-starter-test test      org.apache.maven.plugins maven-compiler-plugin 2.3.2  1.7 1.7 -Xlint:all true true     

当我将它部署到Tomcat时,一切正常,但是当我尝试在Glassfish 4.1服务器上部署它时,我收到以下错误

 SEVERE: Class [ liquibase/integration/spring/SpringLiquibase ] not found. Error while loading [ class org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration ] SEVERE: Exception while deploying the app [platform] SEVERE: Exception during lifecycle processing java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy 

什么出错了? 它是Spring还是Glassfish的bug?

它看起来像Glassfish中的一个错误: GLASSFISH-21265

您可以尝试通过在web.xml添加metadata-complete="true"来解决这个问题,如下所示:

    

metadata-complete =“true”表示/ WEB-INF / lib中的JAR文件不需要扫描Servlet 3.0特定的注释,但仍会扫描webapp自己的类。

也可以看看:

  • Glassfish的spring启动
  • 部署到Glassfish的Spring Boot应用程序给出了奇怪的结果
  • 无法在Glassfish 3.1.2和4.0.0+上部署简单项目
  • Spring.io Blog – 部署Spring Boot应用程序