Commit 31874090 authored by Andy Wilkinson's avatar Andy Wilkinson

Fix ArrayStoreException caused by JerseyAutoConfiguration again

This is a follow-on from the changes made in 2b7bf3e7. In addition to the
problematic use of @ConditionalOnClass that was addressed in 2b7bf3e7,
JerseyAutoConfiguration also used @ConditionalOnBean referencing a 
Jersey class. This has the same problem when used on a class that
implements WebApplicationInitializer. Implementing
WebApplicationInitializer causes the class’s annotations to be
introspected during servlet container initialiser processing. If a
@ConditionalOnBean annotation references a Class that cannot be
loaded an ArrayStoreException occurs.

This commit updates JerseyAutoConfiguration to reference ResourceConfig
as a String. This allows it annotations to be introspected without
attempting to load a Jersey class that may not be on the classpath.

Fixes gh-1733
Fixes gh-1719
parent 9984939c
...@@ -52,7 +52,7 @@ import org.springframework.web.filter.RequestContextFilter; ...@@ -52,7 +52,7 @@ import org.springframework.web.filter.RequestContextFilter;
@ConditionalOnClass(name = { @ConditionalOnClass(name = {
"org.glassfish.jersey.server.spring.SpringComponentProvider", "org.glassfish.jersey.server.spring.SpringComponentProvider",
"javax.servlet.ServletRegistration" }) "javax.servlet.ServletRegistration" })
@ConditionalOnBean(ResourceConfig.class) @ConditionalOnBean(type = "org.glassfish.jersey.server.ResourceConfig")
@ConditionalOnWebApplication @ConditionalOnWebApplication
@Order(Ordered.HIGHEST_PRECEDENCE) @Order(Ordered.HIGHEST_PRECEDENCE)
@AutoConfigureBefore(DispatcherServletAutoConfiguration.class) @AutoConfigureBefore(DispatcherServletAutoConfiguration.class)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment