Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336137 - org.apache.batik.pdf exports incomplete org.apache.commons.io package
Summary: org.apache.batik.pdf exports incomplete org.apache.commons.io package
Status: RESOLVED DUPLICATE of bug 344560
Alias: None
Product: Orbit
Classification: Tools
Component: bundles (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Orbit Bundles CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 336138
  Show dependency tree
 
Reported: 2011-02-02 14:49 EST by Steffen Pingel CLA
Modified: 2011-05-03 12:10 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2011-02-02 14:49:38 EST
The org.apache.batik.pdf bundle exports a number of unexpected packages:

 org.apache.commons.io,
 org.apache.commons.io.output,
 org.apache.commons.logging,
 org.apache.commons.logging.impl

Since the package does not contain all classes that are part of the org.apache.commons.io library this causes this exception in the Mylyn Gerrit connector:

java.lang.NoClassDefFoundError: org/apache/commons/io/FilenameUtils
at org.eclipse.mylyn.internal.reviews.ui.operations.ReviewCompareEditorInput$ByteArrayInput.getType(ReviewCompareEditorInput.java:67)
at org.eclipse.compare.internal.CompareUIPlugin.getTypes(CompareUIPlugin.java:985)
[..]

The Gerrit connector that has a package import in its manifest:

 Import-Package: org.apache.commons.io

osgi> packages org.apache.commons.io
org.apache.commons.io; version="0.0.0"<org.apache.batik.pdf_1.6.0.v201011041432 [218]>
  org.eclipse.gmf.runtime.draw2d.ui.render.awt_1.4.1.v20101119-2230 [321] imports
  org.eclipse.mylyn.gerrit.ui_0.7.0.I20110202-0132 [463] imports

Can the org.apache.commons.* package exports be removed from org.apache.batik.pdf?
Comment 1 Chris Aniszczyk CLA 2011-02-02 14:50:50 EST
I'd send an email to orbit-dev too.

Who owns this?
Comment 2 Steffen Pingel CLA 2011-02-05 16:04:30 EST
Anthony, do you have any thoughts on this?
Comment 3 Anthony Hunter CLA 2011-02-07 09:57:52 EST
(In reply to comment #0)
> The org.apache.batik.pdf bundle exports a number of unexpected packages:
> 
>  org.apache.commons.io,
>  org.apache.commons.io.output,
>  org.apache.commons.logging,
>  org.apache.commons.logging.impl
> 
> Since the package does not contain all classes that are part of the
> org.apache.commons.io library this causes this exception in the Mylyn Gerrit
> connector:

Huge ouch. I assume this is the org.apache.batik.pdf version 1.6.0 bundle?

As far as I can recall, the Batik SVG toolkit as it comes from apache includes some "other" apache common code. In Batik 1.7 in orbit we tried to not repackage these common libraries, but that does not help you with Batik 1.6.

Unfortunately, I am not sure what the answer is. These batik 1.6 bundles have worked well for 5 years and modifying them is not going to work.

What we should be doing is moving to Batik 1.7, but that effort has been a failure thus far since Batik 1.7 has API breakages.
Comment 4 Steffen Pingel CLA 2011-02-07 11:40:25 EST
The org.eclipse.birt.chart_2.6.1.v20100709-7f9T7DFQCnv8nz0gRMa6NG1 feature seems to include org.apache.batik 1.6. I have the following plug-ins on disk:

 org.apache.batik.bridge_1.6.0.v201011041432.jar      org.apache.batik.pdf_1.6.0.v201011041432.jar
 org.apache.batik.css_1.6.0.v201011041432.jar         org.apache.batik.svggen_1.6.0.v201011041432.jar
 org.apache.batik.dom_1.6.0.v201011041432.jar         org.apache.batik.transcoder_1.6.0.v201011041432.jar
 org.apache.batik.dom.svg_1.6.0.v201011041432.jar     org.apache.batik.util_1.6.0.v201011041432.jar
 org.apache.batik.ext.awt_1.6.0.v201011041432.jar     org.apache.batik.util.gui_1.6.0.v201011041432.jar
 org.apache.batik.parser_1.6.0.v201011041432.jar      org.apache.batik.xml_1.6.0.v201011041432.jar

Looking at Birt 4.0 they still include that same version of Batik. Xiaoying, any plans to move to 1.7?
Comment 5 Anthony Hunter CLA 2011-02-07 11:56:54 EST
There are no plans to adopt Batik 1.7 in Indigo by Eclipse Modeling (GMF). We need to stick on Batik 1.6.
Comment 6 David Williams CLA 2011-03-02 12:53:07 EST
> 
> ... These batik 1.6 bundles have
> worked well for 5 years and modifying them is not going to work.
> 

Why not? If it is wrong the way it is, and we are breaking other, new participants, something has to be done. 

Perhaps this case would be helped by importing what's exported (for these known, troublesome packages). See 

http://www.osgi.org/blog/2007/04/importance-of-exporting-nd-importing.html

This scheme allows packages/classes to "pass through" a bundle, if provided by someone else. (depending on load order, etc.) Steffen, can you test that "locally" to see if it helps? 

Other suggestions welcome.
Comment 7 David Williams CLA 2011-05-03 12:10:42 EDT
Dupping to 344560 as it appears it has a practical solution in comments.

*** This bug has been marked as a duplicate of bug 344560 ***