Jump to content

Recommended Posts

Posted

I am trying to integrate Jasper Reports 6.1.0 in my Java application.

I downloaded jasperreports-6.1.0.jar from the official page and looked at its MANIFEST.MF to see what it depends on... but it does not declare any explicit dependencies; it just has:

DynamicImport-Package: *[/code]

And the jar doesn't have a pom.xml.

I eventually found the dependencies at grepcode (I imagine they were deduced from the pom.xml that somehow is available there) but ended up downloading the whole project (jasperreports-6.1.0-project.zip, from the release page) and packaging it together as an OSGi plug-in, since my application is based on OSGi.

The problem is I am getting linking errors because of class conflicts:

java.lang.LinkageError: loader constraint violation: when resolving method "net.sf.jasperreports.engine.data.JRXmlDataSource.<init>(Lorg/w3c/dom/Document;)V" the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the current class, <className>, and the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) for resolved class, net/sf/jasperreports/engine/data/JRXmlDataSource, have different Class objects for the type .<init>(Lorg/w3c/dom/Document;)V used in the signature[/code]

This is because xml-apis.jar, on which jasperreports-6.1.0.jar depends, contains an org.w3c.dom.Document that conflicts with the one coming with the standard JRE.

Is this a known problem? Why does xml-apis.jar contain classes that are already present in the JRE? What can I do to avoid this issue?

Thank you.

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...