Skip to main content

"SEVERE: caught throwable java.lang.LinkageError: loader constraint violation" when using Metro Maven plugin. Please help me.

Please note these forums are being decommissioned and use the new and improved forums at
2 replies [Last post]
Joined: 2006-07-07

I have been trying out the and sample projects, but to no complete success. The wsgen project can be successfully compiled and "mvn jetty:run". I could even access the http://localhost:9090/helloworld?wsdl page correctly and use the wsimport project to generate client stub code. However, when I tried to test with a really simple web service call, the server side returned HTTP 500 error and threw the following exception.
Jan 11, 2012 11:55:57 PM doGet
SEVERE: caught throwable
java.lang.LinkageError: loader constraint violation: when resolving overridden method ";)Ljavax/activation/DataHandler;" the class loader (instance of org/mortbay/jetty/webapp/WebAppClassLoader) of the current class, com/sun/xml/ws/message/AttachmentUnmarshallerImpl, and its superclass loader (instance of <bootloader>), have different Class objects for the type javax/activation/DataHandler used in the signature
The following is the method of the simple web service call that I coded.
public class TestClientStub {
public static void main(String[] args) {
HelloWorldService service = new HelloWorldService();
String result = service.getHelloWorldPort().helloWorld("Yeah!");
wsgen and wsimport-url are the two Maven projects I checked out from javanet. I only made minor modifications to them, i.e. changing "jaxws.plugin.version" setting in the pom file from 2.2 to 2.2-SNAPSHOT because I could not find 2.2 and only found 2.2-SNAPSHOT from the repository (at and changing the <wsdlUrl> parameter for the wsimport maven plugin.
And FYI, the IDE I use is IntelliJ. But even when I just use command line to run the jetty goals, the same error still happen.
I tried to google a solution and found out this post archive, However, the suggested solutions do not help.
Could any guru give me some guidance on this issue? Is there anything I did wrong that's causing it?
Thanks a lot!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-08-17

Hi, can you try to update jetty plugin version from 6.0.1 to 6.1.26 as I did here: and let me know if it helps, please?


Joined: 2006-07-07

Wow! jungicz, you are awesome! Now it simply works! =P

Thanks a lot!