Conflict between Aspose Java libraries

Hi all,
In my project I have a license for Aspose.Words and now we need to use/purchase also the Jasper report version of this library. If I try to import the trial library of Jasper Report in my project the export doesn’t work.

So I opened the jar of two library (Aspose.Word and Aspose.Words for JasperReport) and probably there is a conflict with classes generated for the obsfuscation because when I try to use the JasperReport library I receive this error:

Failed to define class com.aspose.words.awjr37 in Module “com.aspose:main” from local module loader @14b25f37 : java.lang.SecurityException: class “com.aspose.words.awjr37”'s signer information does not match signer information of other classes in the same package

Is there a way to resolve this conflict between these libraries?

Cheers,

Federico

Hi Federico,

Thanks for your inquiry.

With Aspose.Words for JasperReports, you can export reports from JasperReports and JasperServer to Microsoft Word document (DOC), Office Open XML (OOXML, DOCX), Rich Text Format (RTF), OpenDocument Text (ODT), Web page (HTML) and plain text (TXT) formats.

Aspose.Words for Java is a class library that enables your applications to perform a great range of document processing tasks. Aspose.Words supports DOC, DOCX, RTF, HTML, OpenDocument, PDF, XPS, EPUB and other formats. With Aspose.Words you can generate, modify, convert, render and print documents without utilizing Microsoft Word®.

Could you please share some detail about your scenario/test case in which you are using Aspose.Words for Java and Aspose.Words for JasperReports? We will then provide you more information about your query.

Hi Tahir,

I already know what every library can do. The project where I’m working in has an old set of features that use Aspose.Words for Java to generate a custom document.
Now there is the need to use JasperReport to create some report and we would like to user Aspose.Words for JasperReport. Is it impossible?

Cheers,

Federico

Hi Federico,

Thanks for your inquiry. You can use Aspose.Words for JasperReports and Aspose.Words for Java in your application.
fpaparoni:
Failed to define class com.aspose.words.awjr37 in Module “com.aspose:main” from local module loader @14b25f37 : java.lang.SecurityException: class “com.aspose.words.awjr37”'s signer information does not match signer information of other classes in the same package

Is there a way to resolve this conflict between these libraries?
We need some detail about your scenario to investigate this issue. Please share following detail for investigation purposes.

Please share Jasper Reports version.
Please share version of Aspose.Words for JasperReports and Aspose.Words for Java.
Please create a standalone Java application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

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

Hi Tahir,

the informations you need:

JasperReport 5.6.0
Aspose Words for Java 11.7.0.0
Aspose Words for JasperReports 2.3.0
Web application deployed under JBoss 7.1.1.Final

A standalone Java application is every application that has these two libraries in the classpath and tries to print something using JasperReport. Probably the problem is in the classloader because the package com.aspose.words already exists in Aspose Words for Java and the Java exception says

class “com.aspose.words.awjr37”'s signer information does not match signer information of other classes in the same package

Is it possible to use both these two libraries inside the same web application? Or I have to refactor the old application that uses Aspose Words for Java and convert it to JasperReport?

Cheers,

Federico

Hi Federico,

Thanks for your inquiry. Yes, you can use Aspose.Words for Java and Aspose.Words for JasperReports in one web application. We have tested the scenario at Windows 7 with a simple application and have not found any issue. We suggest you please remove all old reference of Aspose.Words Jar files from your application and add references of Aspose.Words again in your application. Hope this helps you.

If the problem still remains, please create a simple web application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing along with .Jrprint file. We will investigate the issue on our side and provide you more information.

Hi Tahir,

the problem doesn’t occur when I debug the application using Eclipse (I have JRebel). When outside Eclipse I start the same server with the same application I have the Exception. One library (Words for Java) is licensed while the other is unlicensed, so is it possible that the licensed jar has a signature that conflicts with the unlicensed (which is probably without signature) ?

Cheers

Federico

I tried two jar without signature (the trial jars) but the problem is already here.
In the attachment you can find the project a simple web application, where the root servlet create a hello world jasper print exporting it to DOCX using Aspose.
To test it you have to put the license file under the package test.aspose and the JBoss 7.1.1 server you will use must have a module named “jasper.lib” where you put the libraries related to JasperReport and also Aspose libraries.
The application has a ServletContextListener, that initializes the Aspose for Words license. If you disable this listener the export works, otherwise there is the Exception related to a possible collision of packages.

Hi Federico,

Thanks for sharing the detail. We are working over your query and will get back to you soon.

Hi Federico,

Thanks for your patience. We have setup JBoss 7.1.1 server at our end and have tested the scenario using latest version of Aspose.Words for Java 16.3.0 and Aspose.Words for JasperReports 2.6.0 and have not found the shared issue.

Please use latest version of Aspose.Words for Java 16.3.0 and Aspose.Words for JasperReports 2.6.0 and set the license as shown in following in following code snippet. Hope this helps you.

public void contextInitialized(ServletContextEvent event) {
    logger.info("Initializing application context...");
    try
    {
        InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("/test/aspose/Aspose.Word.lic");
        com.aspose.words.License license = new com.aspose.words.License();
        license.setLicense(inputStream);
        logger.info("Application context initialized (Aspose.Words License)");
        InputStream inputStream2 = this.getClass().getClassLoader().getResourceAsStream("/test/aspose/Aspose.Words.JasperReports.lic");
        com.aspose.words.jasperreports.License license2 = new com.aspose.words.jasperreports.License();
        license2.setLicense(inputStream2);
        logger.info("Application context initialized (Aspose.Words for JasperReports License)");
    }
    catch (Exception e)
    {
        logger.error("Error encountered trying to set Aspose.Words license!", e);
        logger.error(e.getMessage());
    }
}

Hi Tahir,

I cannot use the version 16.3.0 because I have the license for 11.7.0.0. Is it impossible with this old versione?

Cheers

Federico

Hi Federico,

Thanks for your inquiry. Well, you’re using very old version of Aspose.Words. Unfortunately, we don’t provide support for older released versions of Aspose.Words. Also, please note that we do not provide any fixes or patches for old versions of Aspose products either. All fixes and new features are always added into new versions of our products. So, we suggest you please upgrade to the latest version of Aspose.Words from the following link:

Download Aspose.Words for Java 16.3.0

Hi Tahir,

is possible to use the new version with an old license or I have to buy another?

Cheers

Federico

Hi Federico,

Thanks for your inquiry.

The latest version of Aspose.Words was released on 13th April 2016. Your license file comes with an expiry date which determines whether you can freely upgrade to latest version of Aspose.Words or not. In case you find that the expiry date of your existing license has passed, then you need to renew your subscription. For renewing/upgrading a subscription, please contact our sales team via Aspose.Purchase forum.

You check the expiry date of your license by opening the license file in notepad (please don’t modify the license file). There, you will see the following tag:
20131011

It means that you can free upgrade to version of Aspose.Words published before 10/11/2013.

Best regards,