Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes java.lang.LinkageError: loader constraint violation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "java.lang.LinkageError: loader constraint violation" Watch "java.lang.LinkageError: loader constraint violation" New topic
Author

java.lang.LinkageError: loader constraint violation

Ritu Bansal
Greenhorn

Joined: Nov 07, 2007
Posts: 11
I am getting the following exception while trying to send an attachment email using Java mail API. The code runs locally using jetty server.

org.netbeans.modules.viewmodel.TreeModelNode@1f42ccb[Name=, displayName=e] NestedServletException org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.LinkageError: loader constraint violation: when resolving method "javax.mail.internet.MimeBodyPart.setDataHandler(Ljavax/activation/DataHandler;)V" the class loader (instance of org/mortbay/jetty/webapp/WebAppClassLoader) of the current class, org/springframework/mail/javamail/MimeMessageHelper, and the class loader (instance of org/codehaus/classworlds/RealmClassLoader) for resolved class, javax/mail/internet/MimeBodyPart, have different Class objects for the type javax/activation/DataHandler used in the signature
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

Sounds like an issue I'm still having with JBoss at work... Anyway, the problem is probably caused by two versions of the Java Activation Framework. Before Java 6 it was a separate library. A lot of frameworks and libraries still have it as a separate dependency. Try to see if removing activation.jar solves this issue.

(FYI, in my case it's the javax.xml.crypto package or a sub package that's causing the issue because it's a dependency of PicketLink. Red Hat is still working on the case.)


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.LinkageError: loader constraint violation
 
Similar Threads
The First Steps.. you start here
Linkage Error with LOG4j
java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLog
Linkage error in tomcat
Joboss deployment error