Friday, August 01, 2008

oh grails why do you hate me...

ok the last couple of days I was trying to get grails + a webservice server + a webservice client running. So my first choice was the xfire plugin which worked great.

Now I wanted to create a client in grails to access one of my services. So lets use groovy ws for this. Well nice thinking, but like always you get fancy exception and reading onlien just tells you that they are not compatible.

Basically thats the exception you get:

org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.LinkageError: loader constraints violated when linking javax/xml/namespace/QName class

with some pages of stack trace. Now I was tracing down all the jars and try to resolve this conflict which worked out somehow.

It turned out you need to delete some jars, if you use groovyws and the xfire plugin in the same grails application.

so go ahead and remove these two jars from the plugins/xfire***/lib directory

  • stax-api-1.0.1.jar
  • jsr173_api-1.0.jar
Now you can restart your grails application and it should work.

And least it did for me.

2 comments:

Unknown said...

Hello,

Nice post!

I am using grails+maven2 and I am not able to add GroovyWS to the pom.xml. Are you using maven2 in your project?

I am having problems with conflicting dependencies :(

Can you post your pom.xml?

Thank you!

Gert Wohlgemuth said...

hi,

i don't think I have the pom anymore, but yes I use maven2 with grails and it's fairly straightforward

I will post something about it in the next couple of days at my coding blog:

http://codingandmore.blogspot.com/