Glassfish 上的 Spring Boot [英] Spring Boot on Glassfish

查看:47
本文介绍了Glassfish 上的 Spring Boot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Spring Boot 部署到 GF3,4 期间我得到了这个虽然它是知道问题看到

there I'm getting this during Spring Boot deployment to GF3,4 although it is know problem see

spring boot 问题

另一个

除了在 GF 源中使用 try/catch 进行 hack 之外,无处可找到解决方案.

there is nowhere solution to be found, except for the hack with try/catch in GF sources.

整个问题是关于@Conditional... Spring-Boot 注释,其中包含不在 CP 上的类引用,并且此 GF 检查禁用了 Spring-Boot 的使用.

The whole problem is about @Conditional... Spring-Boot annotations, which holds classes references that are not on CP and this GF check disables the usage of Spring-Boot.

我不想放弃 Spring-Boot,但是关闭 @EnableAutoconfiguration 不起作用,在注释中排除 auto-config 类也不起作用.有没有办法解决(扔掉所有的自动配置)或者我注定并且需要回退到香草春天????

I don't want to abandon Spring-Boot, but switching off @EnableAutoconfiguration is not working, exclude auto-config classes in the annotation does not work either. Is there a way around(throw away all auto-configs) or I am doomed and need to fall back to vanilla Spring?????

每个人都放弃了,因为这似乎是 GF 问题.任何黑客建议表示赞赏.

Everybody is giving hands away as it seems to be GF problem. Any hack advice appreciated.

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)

推荐答案

问题是由于 GlassFish 中的错误.在我看来,在 GlassFish 中添加 try-catch 并不是一个技巧.它使 GlassFish 的注释处理更加稳健,并使其与其他 Java EE 服务器(例如 WildFly 和 TomEE)保持一致.

The problem's due to a bug in GlassFish. The addition of the try-catch in GlassFish isn't a hack, in my opinion. It's making GlassFish's annotation handling more robust and bringing it into line with other Java EE servers such as WildFly and TomEE.

如果您愿意亲自动手,可以尝试在该问题中应用补丁或使用与该问题相关的 Payara 下载.否则,要继续使用 Spring Boot,您将不得不从 GlassFish 转移到另一个 Java EE 服务器或嵌入式容器(Spring Boot 支持 Tomcat、Jetty 和 Undertow).

If you're happy to get your hands dirty you could try applying the patch in that issue or using the Payara download that's linked to in the issue. Failing that, to continue using Spring Boot you'll have to move away from GlassFish, either to another Java EE server or to an embedded container (Spring Boot supports Tomcat, Jetty, and Undertow).

这篇关于Glassfish 上的 Spring Boot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆