Hi,
I’m running my app on Jboss server and when I try to save document in PDF I’m getting this error:
Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "javax.imageio.metadata.IIOMetadata.getAsTree(Ljava/lang/String;)Lorg/w3c/dom/Node;" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, asposewobfuscated/qx, and the class loader (instance of ) for resolved class, javax/imageio/metadata/IIOMetadata, have different Class objects for the type org/w3c/dom/Node used in the signature
at asposewobfuscated.qx.a(Unknown Source)
at asposewobfuscated.qw.l(Unknown Source)
at asposewobfuscated.qw.c(Unknown Source)
at asposewobfuscated.ur.(Unknown Source)
at asposewobfuscated.uf.a(Unknown Source)
at asposewobfuscated.uj.e(Unknown Source)
at asposewobfuscated.tp.a(Unknown Source)
at asposewobfuscated.uc.j(Unknown Source)
at asposewobfuscated.uh.a(Unknown Source)
at asposewobfuscated.ae.a(Unknown Source)
at asposewobfuscated.q.a(Unknown Source)
at asposewobfuscated.n.a(Unknown Source)
at asposewobfuscated.q.a(Unknown Source)
at asposewobfuscated.ad.a(Unknown Source)
at asposewobfuscated.uh.e(Unknown Source)
at com.aspose.words.aky.d(Unknown Source)
at com.aspose.words.qj.a(Unknown Source)
at com.aspose.words.Document.a(Unknown Source)
at com.aspose.words.Document.a(Unknown Source)
at com.aspose.words.Document.h(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
Do you have any solution for this problem?
What kind of libraries are you using for xml parsing? Are they included in Aspose jar?
Most of our Java products depend upon the JAI package (Java Advanced Imaging)
from Sun in order to process images. By looking at the stack trace, it
seems your problem is somehow related to JAI. Please configure JAI
package on your side, you can find jai 1.1.3 and jai-imageio 1.1 in the
following links:
Hope this helps you. If you still face problem, please share following detail for testing. I will investigate the issue on my side and provide you more information.
What environment are you running on?
OS (Windows Version or Linux Version)
Architecture (32 / 64 bit)
Java version
Please attach your input Word document.
Unfortunately,
it is difficult to say what the problem is without the Document(s) and
simplified application. We need your Document(s) and simple project to
reproduce the problem. As soon as you get these pieces of information to
us we’ll start our investigation into your issue.
Hi,
thank you for reply. I’ve managed to solve the problem using workaround - saving document first to DOC format, open it again and save in PDF.
However, now I got the same error in different situation., when calling method insertImage from DocumentBuilder class. It occurs every time, doesn’t depend on document or image.
I’ve tried to cofigure JAI but it didn’t help.
I’m running application on JBoss Server with parent-last class loading policy. Changing to parent-first helps but I can’t do that because it affects the other modules of application.
It doesn’t depend on OS, architecture or java version.
Can you provide any fix or workaround for this problem?
Thanks for your inquiry. It is nice to hear from you that you have found the workaround of your issue.
*jmytnik:
However, now I got the same error in different situation., when calling method insertImage from DocumentBuilder class. It occurs every time, doesn’t depend on document or image.
Can you provide any fix or workaround for this problem?*
Regarding issue with DocumentBuilder.insertImage, I suggest you please try the following code example to insert the image. Hope this helps you.
Document doc = new Document();
Shape shape = new Shape(doc, ShapeType.IMAGE);
shape.getImageData().setImage(MyDir + "Aspose Logo.png");
shape.setWidth(100);
shape.setHeight(100);
Paragraph para = new Paragraph(doc);
para.appendChild(shape);
doc.getFirstSection().getBody().appendChild(para);
doc.save(MyDir + "Out.docx");
*jmytnik:
I’ve tried to cofigure JAI but it didn’t help.
I’m running application on JBoss Server with parent-last class loading policy. Changing to parent-first helps but I can’t do that because it affects the other modules of application.
It doesn’t depend on OS, architecture or java version.*
This issue seem to be related to JAI setting with JBoss server. Please share which version of JBoss Server you are using. I will setup JBoss Server at my side. As soon as everything is setup,
we will test the issue at our end and will post the results here for
your kind reference.
I’m using JBoss 5.1.0.GA version but probably it occurs on other versions as well.
To reproduce problem the most important setting is class loading strategy: parent-first=false.
I have logged a new Task in our issue tracking system as WORDSJAVA-816 to investigate the shared issue. We will investigate your issue at our end and will post the results here for
your kind reference asap.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.