qwazer / markdown-confluence-gradle-plugin

Gradle plugin to publish markdown pages to confluence
Apache License 2.0
12 stars 16 forks source link

Fix no class def found error #27

Closed rchicoli closed 3 years ago

rchicoli commented 3 years ago

Hi there I've had a problem using this plugin in a Linux system, for whatever reason a bean could not be instantiated.

Funny enough, it works perfectly fine in a windows environment.

Here is the stacktrace I got:

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mainService' defined in URL [jar:../com.github.qwazer/markdown-confluence-gradle-plugin/0.9.2/a7bf3b4939779f48f3f963a14824ea49fc020671/markdown-confluence-gradle-plugin-0.9.2.jar!/com/github/qwazer/markdown/confluence/core/service/MainService.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pageService' defined in URL [jar:.../com.github.qwazer/markdown-confluence-gradle-plugin/0.9.2/a7bf3b4939779f48f3f963a14824ea49fc020671/markdown-confluence-gradle-plugin-0.9.2.jar!/com/github/qwazer/markdown/confluence/core/service/PageService.class]: Unsatisfied dependency expressed through
constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'confluenceService' defined in URL [jar:file:.../com.github.qwazer/markdown-confluence-gradle-plugin/0.9.2/a7bf3b4939779f48f3f963a14824ea49fc020671/markdown-confluence-gradle-plugin-0.9.2.jar!/com/github/qwazer/markdown/confluence/core/service/ConfluenceService.class]: Unsatisfied
dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'restTemplate' defined in com.github.qwazer.markdown.confluence.core.SpringConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.client.RestTemplate]: Factory method 'restTemplate' threw exception; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException

The solution was simply to add jackson-databind to the dependencies. Besides that I optimized the imports, I hope it is all fine.

Great project.

qwazer commented 3 years ago

Thanks!

bevintang commented 3 years ago

Hi! Any updates on when the next release is? I could really use this fix!

colossal20 commented 2 years ago

I am experiencing a similar issue where some of the beans are not being initialized with the same error as posted above. Is there a plan to release this soon ?

qwazer commented 2 years ago

Yes, I have such plans, but need to make a lot of infrastructure work to release 1) move out of bintray 2) update to recent gradle 3) update all deps 4) fix tests

Cannot promise any timelines. It is a hobby project.

qwazer commented 2 years ago

to #29