Page 1 of 1

Error: java.lang.LinkageError: loader constraint violation:

PostPosted: Wed Feb 06, 2013 6:26 pm
by sagar.singh
Hi Experts,
I am using docx4j API to manipulate a word document. When I am trying to use the docx4j API in a sample code I am able to do the edition correctly.
But when i deployed code to my server (Content Management Server) its giving the error.
My deployed code is running on JBoss.
Below is the error stack trace. Kindly give me the solution to the problem.

---------------------------------------------------------
java.lang.LinkageError: loader constraint violation: when resolving method "javax.xml.bind.JAXBElement.getName()Ljavax/xml/namespace/QName;" the class loader (instance of java/net/URLClassLoader) of the current class, org/docx4j/XmlUtils, and the class loader (instance of <bootloader>) for resolved class, javax/xml/bind/JAXBElement, have different Class objects for the type javax/xml/namespace/QName used in the signature
at org.docx4j.XmlUtils.unwrap(XmlUtils.java:260)
---------------------------------------------------------

'Any help is appreciated.

Thanks & Regards,

Re: Error: java.lang.LinkageError: loader constraint violati

PostPosted: Thu Feb 07, 2013 9:55 am
by jason
Have you tried Googling "jboss jaxb linkage error" ?

What version of JBoss are you using?

What version of Java?

Re: Error: java.lang.LinkageError: loader constraint violati

PostPosted: Fri Aug 02, 2013 10:34 pm
by ano
Hi,

i have the same error. The full message is:

Caused by: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.apache.xml.utils.UnImplNode.getParentNode()Lorg/w3c/dom/Node;" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/apache/xml/utils/UnImplNode, and the class loader (instance of <bootloader>) for interface org/w3c/dom/Node have different Class objects for the type getParentNode used in the signature

We use Jboss 7.1.1 and JDK 1.7.

I built a library on top of docx4j. The lib uses customxml data and content controls in the word document with od:repeat-tags and od:xpath-tag and edits the SDTs to create the databinding without using a word addin. The code works exept when i try to start the process from jboss. As a console application, the code works fine.

Of course i googled the error, but i'm not that familiar with java and jboss and when others questions are a little bit different, don't know, if it would help me.

Re: Error: java.lang.LinkageError: loader constraint violati

PostPosted: Sat Aug 03, 2013 10:04 am
by jason
Googling "jboss java.lang.LinkageError: loader constraint violation"

Good background:- https://access.redhat.com/site/document ... u_Are.html
(see bottom for debugging tips)

The only place docx4j does anything special with class loaders is line 106 of https://github.com/plutext/docx4j/blob/ ... ntext.java
(and this was for earlier versions of JBoss).

Oh, also ResourceUtils uses Thread.currentThread().getContextClassLoader()

Have a look at https://community.jboss.org/message/530886#530886
Is JBoss starting with an endorsed dir, and if so what is in it?