Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JasperReports 6.14.0 fails at Maven stage: "Could not find artifact com.lowagie:itext:jar:2.1.7.js8" #148

Closed
soc opened this issue Sep 25, 2020 · 16 comments

Comments

@soc
Copy link

soc commented Sep 25, 2020

When including jasper-reports in Maven as a dependency, Maven fails to resolve as it can't find com.lowagie:itext:jar:2.1.7.js8.

It seems as if JasperReports depends on a version of iText that is not available through public repositories.

@teodord
Copy link
Collaborator

teodord commented Sep 26, 2020

Actually, this modified version of iText 2.1.7 is available on this public repository:
http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/com/lowagie/itext/2.1.7.js8/

Please note that the pom.xml of the JasperReports library has a repository entry for that:

<repository>
	<id>jaspersoft-third-party</id>
	<url>http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/</url>
</repository>

See it here:
https://github.com/TIBCOSoftware/jasperreports/blob/master/jasperreports/pom.xml#L522

@soc
Copy link
Author

soc commented Sep 26, 2020

We are using JasperReports from MavenCentral directly, so that's probably why the itext artifact is not available.

Is it really necessary to depend on an additional repositories for dependencies of dependencies?
Wouldn't it be possible to publish it on Maven Central, like the rest of JasperReports?

@teodord
Copy link
Collaborator

teodord commented Sep 29, 2020

We use a modified version of iText. It is not our own software and we modified it only under the terms of the LGPL license under which that version was published. It is not up to us to publish such modified version of iText in Maven Central repositories.
We publish it in our own public repositories. The solution is to simply add the jaspersoft.jfrog.io repository to your build files. The very fact that Maven allows custom repositories is testimony to the fact that using only Maven Central is not mandatory in a Maven ecosystem.
Another solution would be to exclude our modified iText from the JasperReports dependency in your build system and bring the original iText 2.1.7 from the Maven Central.

@soc
Copy link
Author

soc commented Sep 29, 2020

Thanks for the help!

We use a modified version of iText. It is not our own software and we modified it only under the terms of the LGPL license under which that version was published. It is not up to us to publish such modified version of iText in Maven Central repositories.

Would it be an option to use a current, maintained version of itext instead, or did the versions diverge too much?

The very fact that Maven allows custom repositories is testimony to the fact that using only Maven Central is not mandatory in a Maven ecosystem.

Granted, perhaps it's more of a fault of Maven Central that it accepts artefacts with missing dependencies.

Another solution would be to exclude our modified iText from the JasperReports dependency in your build system and bring the original iText 2.1.7 from the Maven Central.

I guess another possibility would be to put the itext dependency in my Nexus manually?

@teodord
Copy link
Collaborator

teodord commented Oct 1, 2020

Not sure what you mean by "current, maintained version of iText", because iText 2.1.7 is no longer maintained. We had to stay with it because after 2.1.7, iText changed its license.
The current version of iText is 7+, but since it has different package names inside, it acts like a total different library compared to 2.1.7, so you cannot use it as a replacement.
Again, you can use the original iText 2.1.7 from Maven Central, without our modifications, which are marginal and you probably don't need them. In order to do that, you would have to use "exclude" in your pom.xml when you bring JasperReports.
You can also use a different fork of the iText 2.1.7, which is called OpenPDF:
https://github.com/LibrePDF/OpenPDF

@teodord teodord closed this as completed Oct 1, 2020
@soc
Copy link
Author

soc commented Oct 1, 2020

Understood, thanks!

@mwithi
Copy link

mwithi commented Oct 26, 2020

our modifications, which are marginal and you probably don't need them.

can you provide more information about those modification in jr8 version? Thanks!

@Master-Code-Programmer
Copy link

Master-Code-Programmer commented Aug 17, 2021

Actually, this modified version of iText 2.1.7 is available on this public repository:

<repository>
	<id>jaspersoft-third-party</id>
	<url>http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/</url>
</repository>

Depending on your setup and / or transitive dependencies this may be not enough, you may need this in <repositories> and also in <pluginRepositories> as:

<pluginRepository>
	<id>jaspersoft-third-party</id>
	<url>http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/</url>
</pluginRepository>

@mykytam
Copy link

mykytam commented Aug 27, 2021

Hi! I just found this ticket and it looks like a solution.
To use this library in Grails Framework I need to install Artifactory plugin also in the application, but it requires me to use username and password to download the jar file.
I have noticed, that there's "Allow Anonymous Access" in JFrog console.

@teodord can you please say, is there a way to use this modified version of iText 2.1.7 and get it from the public repo without creating the JFrog account? I can download .jar by hands, but my app can't download it using repo, just getting 403 error.

I will be happy, if you will answer)

@fer-marino
Copy link

I'm getting this error:

     Required by:
         project :pfd > net.sf.jasperreports:jasperreports:6.17.0
      > Could not resolve com.lowagie:itext:2.1.7.js8.
         > Could not parse POM http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/com/lowagie/itext/2.1.7.js8/itext-2.1.7.js8.pom
            > The element type "hr" must be terminated by the matching end-tag "</hr>".

I'm using gradle 6.8 and the repository mentioned above is in already

rrenkert added a commit to stadt-bielefeld/auik that referenced this issue Dec 15, 2021
@DannyJaramil
Copy link

[ERROR] Failed to execute goal on project ride: Could not resolve dependencies for project com.rolandopalermo.fa
cturacion.ec:ride:jar:1.0.0: Failed to collect dependencies at net.sf.jasperreports:jasperreports:jar:6.4.0 -> c
om.lowagie:itext:jar:2.1.7.js5:

Me podrian ayudar ya importe :

jaspersoft-third-party http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/

pero continua apareciendo el error.

@teodord
Copy link
Collaborator

teodord commented Dec 21, 2021

I think you need to use HTTPS for the URL nowadays:
https://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/

See we are using HTTPS in our pom.xml:
https://github.com/TIBCOSoftware/jasperreports/blob/master/jasperreports/pom.xml#L540

@kareemradwan
Copy link

I fix this issue by exclude the com.lowagie.text from jasperReport library and add it as other library


<dependency>
   <groupId>net.sf.jasperreports</groupId>
   <artifactId>jasperreports</artifactId>
   <version>6.16.0</version>

   <exclusions>
      <exclusion>
         <groupId>com.lowagie</groupId>
         <artifactId>itext</artifactId>
      </exclusion>
   </exclusions>
</dependency>


<dependency>
   <groupId>com.lowagie</groupId>
   <artifactId>itext</artifactId>
   <version>[1.02b,2.1.7]</version>
   <scope>compile</scope>
</dependency>

@dadza dadza mentioned this issue Nov 1, 2022
@rmahadik-swi
Copy link

net.sf.jasperreports jasperreports 6.20.5

Added this dependency in project and after that getting below Exception:
com.webobjects.foundation.NSForwardException [java.lang.NoClassDefFoundError] net/sf/jasperreports/engine/export/JExcelApiExporter:java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/export/JExcelApiExporter
com.webobjects.foundation.NSForwardException: java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/export/JExcelApiExporter

JExcelApiExporter this class is not even included in my project

@teodord
Copy link
Collaborator

teodord commented Jul 13, 2023

Not sure what you mean by "JExcelApiExporter this class is not even included in my project".
You are probably upgrading from a JRL version older than 6.4.3, when the JExcel based exporter has been removed from our library.
The error indicates your application somehow references it, so you need to check that out.

I hope this helps.
Teodor

PS: Ideally, you should first post on the discussion forums at https://community.jaspersoft.com/project/jasperreports-library/answers, because this is not a bug and because it does not have anything to do with the current tracker you added your comment to.

@han4219
Copy link

han4219 commented May 28, 2024

I fix this issue by exclude the com.lowagie.text from jasperReport library and add it as other library


<dependency>
   <groupId>net.sf.jasperreports</groupId>
   <artifactId>jasperreports</artifactId>
   <version>6.16.0</version>

   <exclusions>
      <exclusion>
         <groupId>com.lowagie</groupId>
         <artifactId>itext</artifactId>
      </exclusion>
   </exclusions>
</dependency>


<dependency>
   <groupId>com.lowagie</groupId>
   <artifactId>itext</artifactId>
   <version>[1.02b,2.1.7]</version>
   <scope>compile</scope>
</dependency>

it worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants