eiffel-community / eiffel-remrem-publish

eiffel-remrem-publish
https://eiffel-community.github.io/eiffel-remrem-publish
Apache License 2.0
8 stars 77 forks source link

failure in publish-service startup 2.0.22 #227

Open jgse opened 2 years ago

jgse commented 2 years ago

Description

exception seen when starting docker container, built from tag 2.0.22

16-Dec-2021 16:18:02.930 WARNING [localhost-startStop-1] org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext.refresh Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'producerController': Unsatisfied dependency expressed through field 'messageService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'messageServiceRMQImpl': Unsatisfied dependency expressed through field 'rmqHelper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rmqHelper': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonParser.getReadCapabilities()Lcom/fasterxml/jackson/core/util/JacksonFeatureSet; 2021-12-16 16:18:02.931 WARN 9 --- [ost-startStop-1] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'producerController': Unsatisfied dependency expressed through field 'messageService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'messageServiceRMQImpl': Unsatisfied dependency expressed through field 'rmqHelper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rmqHelper': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonParser.getReadCapabilities()Lcom/fasterxml/jackson/core/util/JacksonFeatureSet;

Workaround

it works after I change the pom.xml to use remrem-parent version to 2.0.4 instead of 2.0.5 I think it is related with the upgrade of Jackson from 2.0.5

-        <jackson.databind.version>2.10.1</jackson.databind.version>
+        <jackson.databind.version>2.12.1</jackson.databind.version>
tobiasake commented 2 years ago

This error was seen before 2.0.22 due to jackson.databind and jacksonc.core versions was not aligned and when these two versions is not aligned then users will see the incompatible exceptions you mention: "nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.core.JsonParser.getReadCapabilities()Lcom/fasterxml/jackson/core/util/JacksonFeatureSet;"

In remrem-publish 2.0.22 version a specific and aligned version of jackson.databind and jackson.core dependency was added to pom file and error was not seen anymore.

To me it sounds like you either are not on latest master version or you have forgot to clean the old local java binaries that maven produced from earlier remrem-publish builds.

Make sure you are on latest master version and try maven clean before building/running remrem-publish: mvn clean

Do you get same error with the released 2.0.22 version in JitPack? https://jitpack.io/com/github/eiffel-community/eiffel-remrem-publish/publish-service/2.0.22/publish-service-2.0.22.war