Error thrown when using aspose.word.jasperreports and aspose-words at the same time

Hi,

I am now implement the java program with two functions:

  • using aspose.word.jasperreports-6.3.0-6.4.0.jar to convert the jasper file to word document.
  • using aspose.word-18.9-jdk16.jar to read the docx template to generate word document.
    The program work fine when only include 1 library (either jasper one or word). But when include two libraries at the same time. One of the function will throw error like this:

For aspose word generate:
Exception in thread “main” java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
com/aspose/words/Document.(Ljava/io/InputStream;)V @5: invokespecial
Reason:
Type ‘asposewobfuscated/zz7C’ (current frame, stack[1]) is not assignable to ‘asposewobfuscated/zz7A’
Current Frame:
bci: @5
flags: { flagThisUninit }
locals: { uninitializedThis, ‘java/io/InputStream’ }
stack: { uninitializedThis, ‘asposewobfuscated/zz7C’ }
Bytecode:
0x0000000: 2a2b b800 eeb7 012b b1

or

For aspose.word.jasperreport generation:

Exception in thread “main” java.lang.VerifyError: Cannot inherit from final class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at awjr.awjr5.awjr7.(Unknown Source)
at com.aspose.words.jasperreports.AWAbstractExporter.exportReport(Unknown Source)
at Jasper2Word.main(Jasper2Word.java:101)

I am using jasper report server 6.3.0.

Please let me know if there is any conflict to this two library and how to solve it. Thanks.

@alexhk2018

Thanks for your inquiry. Could you please share the following detail for investigation?

  1. Are you getting exception while using Aspose.Words for Java code?
  2. Please share the .jrprint file along with code example to reproduce this issue at our end.
  3. Please share the exported DOCX/DOC file by Aspose.Words for JasperReports.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Yes. I am using java program. Please find the attachment for the jrxml, docx and the source program. Thanks.20180914.zip (29.3 KB)

@alexhk2018

Thanks for sharing the detail. We have tested the scenario using “Jasper2Word.java” and faced java.lang.NoSuchFieldError exception. We have not faced the same exception that you shared. For the sake of correction, we have logged this problem in our issue tracking system as WORDSJR-242. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.

We have not found any issue while using Aspose.Words for Java 18.9.

It depends on which library class is loaded. If the aspose word is loaded, the aspose word can generate word document well and jasper to word will malfunction and vice versa.

Hope that this can help your investigation. Thanks.

Is there any schedule for fixing this issue since we are planning to buy the product once the problem is solved?

@alexhk2018

Thanks for your inquiry. We try our best to deal with every customer request in a timely fashion, we unfortunately cannot guarantee a delivery date to every customer issue. We work on issues on a first come, first served basis. We feel this is the fairest and most appropriate way to satisfy the needs of the majority of our customers.

Currently, your issue is under analysis phase. Once we complete the analysis of your issue, we will then be able to provide you an estimate.

You reported this issue in free support forum and it will be treated with normal priority. To speed up the progress of issue’s resolution, we suggest you please check our paid support policies from following link.
Paid Support Policies

Is there any updates? The issue status seems to be closed:

WORDSJR-242 ---- Status : Closed

@alexhk2018

Thanks for your inquiry. This issue has been resolved and its fix will be available in next version of Aspose.Words for JasperReports i.e. 18.10. This release will be published at the start of next month. We will inform you via this forum thread about it.

A post was split to a new topic: Conflict between two jars

The issues you have found earlier (filed as WORDSJR-242) have been fixed in this Aspose.Words for JasperReports 18.10 update.