Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index



/On Tue Mar  5/Lionel Elie Mamane wrote:

On Tue, Mar 05, 2013 at 04:20:32PM +0200, Noel Grandin wrote:

/  Normally when that happens it indicates that you have multiple
/>>/  copies of the same code in your CLASSPATH, and the two copies are
/>>/  from different versions of the code.
/
Concretely, how do I find out which this is?
I tried looking for duplicates in workdir/, but didn't get anywhere.

You have to know what are you looking for.
For that just put some diagnsostic in your java code and produce
Exception stack trace to find out the abusing class.

In your case it is the Interface ReportEngine.java,
because the exception is thrown while trying to load this class:
public class PentahoReportEngine implements ReportEngine

Then with this one liner figure out where is the second class is coming from:

for file in `find /home/david/projects/libo/install/ -name "*.jar"`; do echo $file; jar -tf $file | grep ReportEngine; done

first one:
/home/david/projects/libo/install/program/classes/unoil.jar
com/sun/star/report/ReportEngine.class

second one:
/home/david/projects/libo/install/share/extensions/report-builder/sun-report-builder.jar
com/sun/star/report/ReportEngine.class

let's look inside it and see the difference:

ReportEngine in unoil.jar:
javap -classpath /home/david/projects/libo/install/program/classes/unoil.jar
public final class com.sun.star.report.ReportEngine extends java.lang.Object{ public static com.sun.star.report.XReportEngine create(com.sun.star.uno.XComponentContext);
}

and ReportEngine in sun-report-builder.jar

public interface com.sun.star.report.ReportEngine{
public abstract com.sun.star.report.ReportJobDefinition createJobDefinition();
    public abstract com.sun.star.report.ReportEngineMetaData getMetaData();
public abstract com.sun.star.report.ReportJob createJob(com.sun.star.report.ReportJobDefinition) throws com.sun.star.report.JobDefinitionException;
}

So why it is so? Well apparently a new empty IDL was defined (since 4.1):

offapi/com/sun/star/report/ReportEngine.idl

that collide with our own ReportEngine.java.

to rectify that i renamed our class to be ReportEngine2.java
and you test report from fdo#61726 works like a charm ;-)

David


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.