gpc / grails-mail

The Grails Mail Plugin
http://grails.org/plugin/mail
Apache License 2.0
45 stars 85 forks source link

Incompatible Class Change Error: jaxrs-0.7 vs mail-1.0.1 #16

Closed rahultongia closed 2 years ago

rahultongia commented 11 years ago

HI There,

I have a dependency resolution issue with another plugin, which is causing the following error:

Caused by: java.lang.IncompatibleClassChangeError at grails.plugin.mail.MailMessageContentRenderer$RenderEnvironment.init(MailMessageContentRenderer.groovy:125) at grails.plugin.mail.MailMessageContentRenderer$RenderEnvironment.with(MailMessageContentRenderer.groovy:158) at grails.plugin.mail.MailMessageContentRenderer.render(MailMessageContentRenderer.groovy:47) at grails.plugin.mail.MailMessageBuilder.doRender(MailMessageBuilder.groovy:235) at grails.plugin.mail.MailMessageBuilder.html(MailMessageBuilder.groovy:253)

The way to recreate the error: Install jaxrs 0.7 plugin and its dependencies in build config: spock 0.7 and org.springframework:spring-test:3.1.2.RELEASE

When I do run-app, since everything is loaded directly from resources, there is no error. However, doing a run-war, as dependencies are resolved I get the the above error.

The mail plugin depends on org.springframework:spring-test:3.1.0.RELEASE which gets kicked out. So, probably that is the reason.


Any suggestions on how to deal with this issue? I don't necessarily want to recompile the plugin separately as it becomes hard to maintain. I already tried a lot of combination in buildconfig for exclusion, but doesn't seem to work.

Thanks.

ccpost commented 10 years ago

Anyone have a solution to this? I'm running into the exact same dependency problem.

rahultongia commented 10 years ago

we repackaged the jaxrs plugin separately to remove the dependency. let me know if you need more specific details. Its not perfect but as work around solves the issue

Sent from my iPad

On 17-Dec-2013, at 2:57 am, Chris Post notifications@github.com wrote:

Anyone have a solution to this? I'm running into the exact same dependency problem.

— Reply to this email directly or view it on GitHub.

ccpost commented 10 years ago

Thanks, I tried messing with excluding the dependency to no avail, so I ended up repacking it myself as well based on a few commits from mainline jaxrs and some minor tweaks.

To anyone else who hits this same issue: the dependency was removed a little while ago in jaxrs, but hasn't made it to a release yet: https://github.com/krasserm/grails-jaxrs/pull/24

soumyapothu commented 10 years ago

I am seeing same issue, however, with grails rendering plugin. Can you please give more details on repacking?

candrews commented 10 years ago

As of version 1.0.5, there is no dependency on spring-test. Perhaps you could upgrade to at least that version and let us know if your problem is now solved?