kh-fataoui / xdocreport

Automatically exported from code.google.com/p/xdocreport
0 stars 0 forks source link

fr.opensagres.xdocreport.core.XDocReportException: java.lang.AbstractMethodError #444

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
I copied the hello word program:

That's my code:
private InputStream loadDocumentAsStream(String filePath) {
        //URL url =new File(filePath).toURL();
        URL url =new File(filePath).toURI().toURL();
        InputStream documentTemplateAsStream=null;
        documentTemplateAsStream= url.openStream();
        return documentTemplateAsStream;
    }

    public void create (String template, String output) {
        try {

            InputStream in = loadDocumentAsStream(template);
            IXDocReport report = XDocReportRegistry.getRegistry().loadReport(in, TemplateEngineKind.Velocity);

            // 2) Create context Java model
            IContext context = report.createContext();
            Project project = new Project("XDocReport");
            context.put("project", project);

            // 3) Generate report by merging Java model with the Docx
            OutputStream out = new FileOutputStream(new File(output));
            report.process(context, out);

        } catch (IOException e) {
            e.printStackTrace();
        } catch (XDocReportException e) {
            e.printStackTrace();
        }
    }

On  "report.process(context, out)" call i get this:
fr.opensagres.xdocreport.core.XDocReportException: 
java.lang.AbstractMethodError: 
fr.opensagres.xdocreport.template.formatter.AbstractDocumentFormatter.getFunctio
nDirective(ZZLjava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Ljava/lang/
String;
    at fr.opensagres.xdocreport.document.preprocessor.AbstractXDocPreprocessor.preprocess(AbstractXDocPreprocessor.java:118)
    at fr.opensagres.xdocreport.document.AbstractXDocReport.doPreprocessorIfNeeded(AbstractXDocReport.java:366)
    at fr.opensagres.xdocreport.document.AbstractXDocReport.process(AbstractXDocReport.java:512)
    at fr.opensagres.xdocreport.document.AbstractXDocReport.process(AbstractXDocReport.java:487)
    at OpenOfficeManager.create(OpenOfficeManager.java:49)
    at Main1.main(Main1.java:18)
Caused by: java.lang.AbstractMethodError: 
fr.opensagres.xdocreport.template.formatter.AbstractDocumentFormatter.getFunctio
nDirective(ZZLjava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Ljava/lang/
String;
    at fr.opensagres.xdocreport.template.formatter.AbstractDocumentFormatter.getFunctionDirective(AbstractDocumentFormatter.java:165)
    at fr.opensagres.xdocreport.template.formatter.AbstractDocumentFormatter.getFunctionDirective(AbstractDocumentFormatter.java:170)
    at fr.opensagres.xdocreport.document.docx.preprocessor.sax.styles.DocxStylesDocumentContentHandler.doEndElement(DocxStylesDocumentContentHandler.java:124)
    at fr.opensagres.xdocreport.document.preprocessor.sax.BufferedDocumentContentHandler.endElement(BufferedDocumentContentHandler.java:267)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1742)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2900)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
    at fr.opensagres.xdocreport.document.preprocessor.sax.SAXXDocPreprocessor.preprocess(SAXXDocPreprocessor.java:62)
    at fr.opensagres.xdocreport.document.preprocessor.sax.SAXXDocPreprocessor.preprocess(SAXXDocPreprocessor.java:47)
    at fr.opensagres.xdocreport.document.preprocessor.AbstractXDocPreprocessor.preprocess(AbstractXDocPreprocessor.java:88)
    ... 5 more

What version of the product are you using? On what operating system?

I've downloaded the last maven version jars. Run on ubuntu

My pom is 
 <dependencies>
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>fr.opensagres.xdocreport.core</artifactId>
            <version>1.0.4</version>
        </dependency>
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>fr.opensagres.xdocreport.document</artifactId>
            <version>1.0.4</version>
        </dependency>
        <dependency>
            <groupId>fr.opensagres</groupId>
            <artifactId>fr.opensagres.xdocreport.template.velocity</artifactId>
            <version>0.9.1</version>
        </dependency>
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>fr.opensagres.xdocreport.converter</artifactId>
            <version>1.0.4</version>
        </dependency>
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>fr.opensagres.xdocreport.document.docx</artifactId>
            <version>1.0.4</version>
        </dependency>
        <dependency>
            <groupId>fr.opensagres</groupId>
            <artifactId>fr.opensagres.xdocreport.template.velocity</artifactId>
            <version>0.9.1</version>
        </dependency>
    </dependencies>

Please provide any additional information below.

Please help;)

Original issue reported on code.google.com by fg.randa...@hotmail.it on 25 Sep 2014 at 4:07

GoogleCodeExporter commented 9 years ago
the file word is attached:

Original comment by fg.randa...@hotmail.it on 25 Sep 2014 at 4:13

Attachments:

GoogleCodeExporter commented 9 years ago
In your POM you have 2 versions 0.9.1 and 1.0.4.

Original comment by angelo.z...@gmail.com on 25 Sep 2014 at 4:14

GoogleCodeExporter commented 9 years ago
i found the error. The maven dependencies were not all updated!!! thanks

Original comment by fg.randa...@hotmail.it on 25 Sep 2014 at 4:24