Skip to content
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

Jackson 2.7.1 doesn't work with jdk6 due to use of Collections.emptyIterator() #1134

Closed
saladinkzn opened this issue Feb 18, 2016 · 3 comments
Milestone

Comments

@saladinkzn
Copy link

Collections.emptyIterator() is not available on jdk6:

java.lang.IllegalAccessError: tried to access method java.util.Collections.emptyIterator()Ljava/util/Iterator; from class com.fasterxml.jackson.databind.util.ClassUtil
        at com.fasterxml.jackson.databind.util.ClassUtil.emptyIterator(ClassUtil.java:24)
        at com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.getConstructorParameters(POJOPropertyBuilder.java:383)
        at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory._findCreatorsFromProperties(BasicDeserializerFactory.java:331)
        at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory._constructDefaultValueInstantiator(BasicDeserializerFactory.java:312)
        at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.findValueInstantiator(BasicDeserializerFactory.java:252)
        at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:221)
        at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:143)
        at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:406)
        at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:352)
        at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)
        at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)
        at com.fasterxml.jackson.databind.deser.DeserializerCache.hasValueDeserializerFor(DeserializerCache.java:191)
        at com.fasterxml.jackson.databind.DeserializationContext.hasValueDeserializerFor(DeserializationContext.java:422)
        at com.fasterxml.jackson.databind.ObjectMapper.canDeserialize(ObjectMapper.java:2633)
        at ru.shadam.ferry.simple.responsehandler.ObjectMapperResponseHandlerFactory.canCreateExtractor(ObjectMapperResponseHandlerFactory.java:25)
        at ru.shadam.ferry.factory.result.CompositeResultExtractorFactory.getResultExtractor(CompositeResultExtractorFactory.java:33)
        at ru.shadam.ferry.factory.InvocationHandlerFactory.getMethodExecutionContext(InvocationHandlerFactory.java:84)
        at ru.shadam.ferry.factory.InvocationHandlerFactory.createInvocationHandler(InvocationHandlerFactory.java:76)
        at ru.shadam.ferry.factory.ClientImplementationFactory.getInterfaceImplementation(ClientImplementationFactory.java:39)
@saladinkzn
Copy link
Author

Well, maybe it's not actually an issue as you stated that 2.7.x has jdk7 base line

But this quote:

So it should still be possible to use Jackson 2.7 on Java 6, but not compile, build.

Is not true.

@cowtowncoder
Copy link
Member

@saladinkzn Thank you for reporting this. Usage is accidental and is indeed contradicting the statement. Simple compatibility testing I tried managed to not notice this problem unfortunately. Will try to fix this for 2.7.2.

@cowtowncoder cowtowncoder added this to the 2.7.2 milestone Feb 22, 2016
@cowtowncoder cowtowncoder changed the title Jackson 2.7 doesn't work with jdk6 Jackson 2.7.1 doesn't work with jdk6 due to use of Collections.emptyIterator() Feb 22, 2016
@cowtowncoder
Copy link
Member

Thank you for reporting this; issue fixed in 2.7.2. Please let me know if you uncover other similar issues.
I hope to figure out a better way to test for compatibility wrt JDK6.

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

No branches or pull requests

2 participants