Spring Download on Glassfish

there I get this during Spring boot deployment in GF3,4 although this is a known issue, see

spring boot problem

yet

no solutions were found except hacking with try / catch in GF sources.

The whole problem is in @Conditional ... Spring-Boot-annotations containing references to classes that are not related to CP, and this GF check disables the use of Spring-Boot.

I do not want to abandon Spring-Boot, but turning off @EnableAutoconfiguration does not work; excluding autoconfiguration classes in the annotation does not work either. Is there a way (throw away all auto-configurations), or am I doomed and should return to Spring vanilla ?????

Everyone gives up their hands, as this seems like a GF problem. Any hacking tips are 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) 
0
source share
2 answers

The problem is due to a bug in GlassFish . In my opinion, adding try-catch to GlassFish is not a hack. This makes GlassFish comment processing more robust and harmonizes with other Java EE servers such as WildFly and TomEE.

If you are happy to get your hands on it, you can try to apply a fix for this problem or use the Payara download associated with the problem. Otherwise, to continue using Spring Boot, you will have to move from GlassFish to either another Java EE server or the built-in container (Spring Boot supports Tomcat, Jetty, and Undertow).

+3
source

You can get around this by putting metadata-complete = "true" in your web.xml, which says Glassfish does not process annotations, as the application has already done so.

This fixes java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy and, for example, resolves the Spring Boot war application example that Spring provides to deploy and run successfully.

+2
source

Source: https://habr.com/ru/post/984649/


All Articles