We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspsoe.words and aspose.word.jasperreports licensing in same project

I would like to use aspose.words and aspose.words.jasperreports together in a project.

If aspose.words.jasperreports is on the classpath, i can’t licensing aspose.words.

The error message is:
java.lang.NoSuchFieldError: auj at com.aspose.words.License.setLicense(License.java:188)

If I remove aspose.words.jasperreports from classpath, the licensing works well.

My test code:
com.aspose.words.License license = new com.aspose.words.License();
try {
license.setLicense(“Aspose.Words.lic”);
} catch (Exception e) {
e.printStackTrace();
}

Best regards: Gabor Macskasy

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Which version of Aspose.Words for Jasper Reports do you use? The similar problem was fixed some time ago. So please try using the latest version. You can download it from here:

http://www.aspose.com/community/files/67/jasperreports-exporters/aspose.words-for-jasperreports/category1313.aspx

Best regards.

Dear Alexey,

Thanks for your response.
Unfortonately the usage of the latest version haven’t solved my problem.
Error messages are as follows:

aspose.words.jasperreports 1.2.1
aspose.words 3.3

Exception in thread “main” java.lang.NoSuchFieldError: auj at com.aspose.words.License.setLicense(License.java:188)
-----------------------------------------------------------------------------------
aspose.words.jasperreports 1.3.0
aspose.words 3.3

Exception in thread “main” java.lang.NoSuchFieldError: auj at com.aspose.words.License.setLicense(License.java:188)
----------------------------------------------------------------------------------

aspose.words.jasperresports 1.3.0
aspose.words 4.0

Exception in thread “main” java.lang.NoSuchMethodError: com.aspose.words.dy.an(Ljava/lang/String;)V at com.aspose.words.License.setLicense(License.java:226)
----------------------------------------------------------------------------------
Have you got any idea?

Thanks in advance.

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. I cannot reproduce the problem on my side. Maybe there are old version cached and that is why you get such error. Please try clearing caches.

Also, could you please provide me step by step manual how I can reproduce the same problem on my side.

Best regards.

Hi,
Thanks for your response.
I used the latest version both project.
I created a project in eclipse, my classpath is:

<?xml version="1.0" encoding="UTF-8"?>

My test class is:

public class Test {

public Test() throws Exception {
setAsposeWordsLicense();
setAsposeWordsJasperLicense();
}

public void setAsposeWordsLicense() throws Exception {
try {
com.aspose.words.License license = new com.aspose.words.License();
license.setLicense("Aspose.Words.lic");
System.out.println("licensing aspose.words OK");
} catch (Exception e) {
e.printStackTrace();
}
}

public void setAsposeWordsJasperLicense() throws Exception {
try {
com.aspose.words.jasperreports.License license = new com.aspose.words.jasperreports.License();
license.setLicense("Aspose.Words.JasperReports.lic");
System.out.println("licensing aspose.words.jasperreports OK");
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) throws Exception {
new Test();
}
}

Execute this code, throws the next stacktrace:
Exception in thread "main" java.lang.NoSuchMethodError: com.aspose.words.dy.an(Ljava/lang/String;)V
at com.aspose.words.License.setLicense(License.java:226)
at Test.setAsposeWordsLicense(Test.java:14)
at Test.(Test.java:6)
at Test.main(Test.java:33)

If i change the order in classpath as follows:

<?xml version="1.0" encoding="UTF-8"?>

the same code provides the next result: :-)
licensing aspose.words OK
licensing aspose.words.jasperreports OK
But this solution only works within eclipse.

as additional information:
If i try to export in doc format, with this order on the classpath, throws the next stacktrace:
java.lang.IllegalAccessError: tried to access class com.aspose.words.lt from class com.aspose.words.jasperreports.a.c
at com.aspose.words.jasperreports.a.c.(Unknown Source)
at com.aspose.words.jasperreports.AWAbstractExporter.exportReport(Unknown Source)

Best regards.

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. I tested with IntelliJ IDEA and I cannot reproduce the problem. I will install Eclipse and let you know how it goes in Eclipse on my side. Please expect a reply within few hours.

Best regards.