Skip to content

Adding jackson-datatype-jdk8 breaks app server integration tests #9391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
snicoll opened this issue Jun 2, 2017 · 4 comments
Closed

Adding jackson-datatype-jdk8 breaks app server integration tests #9391

snicoll opened this issue Jun 2, 2017 · 4 comments
Assignees
Labels
type: task A general task
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Jun 2, 2017

If jackson-datatype-jdk8 is added to the classpath, the Glassfish integration test breaks with java.lang.VerifyError: Cannot inherit from final class. Please see server.log for more details. and

java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:763)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1220)
org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1750)
org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1633)
com.fasterxml.jackson.datatype.jdk8.Jdk8Module.setupModule(Jdk8Module.java:30)
com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:651)
org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.registerWellKnownModulesIfAvailable(Jackson2ObjectMapperBuilder.java:750)
org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.configure(Jackson2ObjectMapperBuilder.java:622)
org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.build(Jackson2ObjectMapperBuilder.java:605)
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter.<init>(MappingJackson2HttpMessageConverter.java:57)
org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter.<init>(AllEncompassingFormHttpMessageConverter.java:67)
org.springframework.web.filter.HttpPutFormContentFilter.<init>(HttpPutFormContentFilter.java:63)
org.springframework.boot.web.servlet.filter.OrderedHttpPutFormContentFilter.<init>(OrderedHttpPutFormContentFilter.java:29)
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration.httpPutFormContentFilter(WebMvcAutoConfiguration.java:152)
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$$EnhancerBySpringCGLIB$$4697ba9a.CGLIB$httpPutFormContentFilter$1(<generated>)
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$$EnhancerBySpringCGLIB$$4697ba9a$$FastClassBySpringCGLIB$$3143788e.invoke(<generated>)
org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:362)
org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$$EnhancerBySpringCGLIB$$4697ba9a.httpPutFormContentFilter(<generated>)
@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label Jun 2, 2017
@wilkinsona
Copy link
Member

wilkinsona commented Jun 2, 2017

Glassfish bundles a rather old and incomplete version of Jackson. As a result, our sample app loads some Jackson classes from the war that's deployed and some from Glassfish itself. This mismatch of versions causes the VerifyError. We can avoid the problem by using a Glassfish-specific deployment descriptor to make the web app's class loader prefer its own classes over those available from its parent.

@wilkinsona wilkinsona added priority: normal type: task A general task and removed for: team-attention An issue we'd like other members of the team to review labels Jun 2, 2017
@wilkinsona wilkinsona self-assigned this Jun 2, 2017
@wilkinsona wilkinsona added this to the 2.0.0.M2 milestone Jun 2, 2017
@wilkinsona wilkinsona changed the title Adding jackson-datatype-jdk8 breaks Glassfish integration test Adding jackson-datatype-jdk8 breaks app server integration tests Jun 2, 2017
@wilkinsona wilkinsona reopened this Jun 2, 2017
@wilkinsona
Copy link
Member

Wildfly appears to have the same problem

@nelavelli
Copy link

I m using jsr310 jar, but still I am facing aame error.

@snicoll
Copy link
Member Author

snicoll commented Jun 22, 2017

@nelavelli this issue is closed so I am not sure I understand what you're reporting here really. Regardless, if you have a question please join us on Gitter or ask on StackOvrerflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

No branches or pull requests

3 participants