我在将 Spring Boot 部署到 GF3、4 期间得到了这个 虽然知道问题见
除了在 GF 源代码中使用 try/catch 进行破解外,没有其他解决方案。
整个问题是关于@Conditional ... Spring-Boot 注释,它包含不在 CP 上的类引用,并且此 GF 检查禁用了 Spring-Boot。
我不想放弃 Spring-Boot,但是关闭 @EnableAutoconfiguration 不起作用,在注解中排除自动配置类也不起作用。有没有办法解决(扔掉所有自动配置)或者我 注定 需要退回到 Vanilla Spring?????
每个人都在放弃,因为这似乎是 GF 问题。任何黑客建议表示赞赏。
WARNING|glassfish3.1.2|global|_ThreadID=86;_ThreadName=Thread-2;|Error in annotation processing: java.lang.NoClassDefFoundError: org/springframework/batch/core/configuration/annotation/BatchConfigurer|#]
WARNING|glassfish3.1.2|global|_ThreadID=86;_ThreadName=Thread-2;|Error in annotation processing: java.lang.NoClassDefFoundError: org/springframework/batch/core/configuration/annotation/BatchConfigurer|#]
SEVERE|glassfish3.1.2|global|_ThreadID=86;_ThreadName=Thread-2;|Class [ org/apache/solr/client/solrj/SolrServer ] not found. Error while loading [ class org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration ]|#]
SEVERE|glassfish3.1.2|global|_ThreadID=86;_ThreadName=Thread-2;|Class [ liquibase/integration/spring/SpringLiquibase ] not found. Error while loading [ class org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration ]|#]
SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=86;_ThreadName=Thread-2;|Exception while deploying the app [PaySafeCardConnector-1.0-SNAPSHOT]|#]
SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=86;_ThreadName=Thread-2;|sun.reflect.annotation.TypeNotPresentExceptionProxy
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:715)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:522)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:348)
最佳答案
您可以通过在 web.xml 中放置 metadata-complete="true"来解决这个问题,这会告诉 glassfish 不要处理注释,因为应用程序已经这样做了。
这修复了 java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy,例如,将允许 Spring 提供的示例 Spring Boot war 应用程序成功部署和运行。
关于annotations - Glassfish 上的 Spring Boot,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28737018/