-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
in: corestatus: duplicateThere is already an issue similar to this. The link to it should be presentThere is already an issue similar to this. The link to it should be presenttype: bug
Description
kane zhu opened INT-4319 and commented
I'm using spring boot 2.0.0 M3 and below integration components.
'org.springframework.boot:spring-boot-starter-integration',
"org.springframework.integration:spring-integration-amqp",
"org.springframework.integration:spring-integration-mongodb",
I failed to start my spring boot app due to KotlinModule can not be instantiated,
Caused by: java.util.ServiceConfigurationError: com.fasterxml.jackson.databind.Module: Provider com.fasterxml.jackson.module.kotlin.KotlinModule could not be instantiated
at java.util.ServiceLoader.fail(ServiceLoader.java:232)
at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at com.fasterxml.jackson.databind.ObjectMapper.findModules(ObjectMapper.java:982)
at com.fasterxml.jackson.databind.ObjectMapper.findModules(ObjectMapper.java:966)
at com.fasterxml.jackson.databind.ObjectMapper.findAndRegisterModules(ObjectMapper.java:1016)
at org.springframework.integration.support.json.Jackson2JsonObjectMapper.<init>(Jackson2JsonObjectMapper.java:63)
at org.springframework.integration.support.json.JsonObjectMapperProvider.newInstance(JsonObjectMapperProvider.java:54)
at org.springframework.integration.json.JsonToObjectTransformer.<init>(JsonToObjectTransformer.java:66)
at org.springframework.integration.json.JsonToObjectTransformer.<init>(JsonToObjectTransformer.java:57)
at cn.pilipa.agent.flow.NoteFlow.noteInStock(NoteFlow.java:28)
at cn.pilipa.agent.flow.NoteFlow$$EnhancerBySpringCGLIB$$9f4a7026.CGLIB$noteInStock$0(<generated>)
at cn.pilipa.agent.flow.NoteFlow$$EnhancerBySpringCGLIB$$9f4a7026$$FastClassBySpringCGLIB$$de649d.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:360)
at cn.pilipa.agent.flow.NoteFlow$$EnhancerBySpringCGLIB$$9f4a7026.noteInStock(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:155)
... 19 common frames omitted
Caused by: java.lang.NoClassDefFoundError: kotlin/jvm/internal/DefaultConstructorMarker
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getConstructor0(Class.java:3075)
at java.lang.Class.newInstance(Class.java:412)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
... 39 common frames omittedFrom the stacktrace the error is caused by JsonToObjectTransformer trying to load unexpected jackson module 'KotlinModule'.
Below is the code snippet of integration dsl,
@Bean
public IntegrationFlow noteInStock(ConnectionFactory connectionFactory, AmqpTemplate amqpTemplate,
MongoOperations mongoOperations) {
return IntegrationFlows.from(Amqp.inboundAdapter(connectionFactory, MY_QUEUE))
.transform(new JsonToObjectTransformer(Note.class))
.log()
.handle(MongoDb.outboundGateway(mongoOperations)
.expectSingleResult(true).entityClass(Note.class))
.get();
}Affects: 5.0 M6
Issue Links:
- Jackson2JsonObjectMapper should use Jackson2ObjectMapperBuilder and don't load modules unconditionally [INT-4318] #8261 Jackson2JsonObjectMapper should use Jackson2ObjectMapperBuilder and don't load modules unconditionally
("duplicates")
Metadata
Metadata
Assignees
Labels
in: corestatus: duplicateThere is already an issue similar to this. The link to it should be presentThere is already an issue similar to this. The link to it should be presenttype: bug