opensagres / xdocreport

XDocReport means XML Document reporting. It's Java API to merge XML document created with MS Office (docx) or OpenOffice (odt), LibreOffice (odt) with a Java model to generate report and convert it if you need to another format (PDF, XHTML...).
https://github.com/opensagres/xdocreport
1.22k stars 371 forks source link

Set template engine with IXDocReport#setTemplateEngine #233

Open djwalid opened 7 years ago

djwalid commented 7 years ago

Hi, i am using xdocreport. i'm getting the following exception : Null template engine. Set template engine with IXDocReport#setTemplateEngine. fr.opensagres.xdocreport.core.XDocReportException: Null template engine. Set template engine with IXDocReport#setTemplateEngine. at fr.opensagres.xdocreport.document.AbstractXDocReport.internalGetTemplateEngine(AbstractXDocReport.java:866) at fr.opensagres.xdocreport.document.AbstractXDocReport.createContext(AbstractXDocReport.java:462) at sga.api.report.ppo.web.AbstractprocessXDocReportServlet2.doGenerateReport(AbstractprocessXDocReportServlet2.java:234) at sga.api.report.ppo.web.AbstractprocessXDocReportServlet2.processRequest(AbstractprocessXDocReportServlet2.java:97) at fr.opensagres.xdocreport.document.web.BaseXDocReportServlet.doGet(BaseXDocReportServlet.java:78)

i attached to this issue pom.xml, atlassian-plugin.xml, and my java servlet. i don't know the origin of this exception. can anyone help me. Thank's

github.zip

angelozerr commented 7 years ago

Hav you velocity and their dependencies in your classpath?

djwalid commented 7 years ago

Hi, i'm using atlassian SDK to create a jira plugin, i used atlas-create-jira-plugin to create the plugin and no .classpath was generated. i don't know how to fixe that. Merci d'avance :)

djwalid commented 7 years ago

Since it's a maven project i added the following dependencies in the pom:

fr.opensagres.xdocreport fr.opensagres.xdocreport.document.docx 1.0.5 compile
    <dependency>
        <groupId>fr.opensagres.xdocreport</groupId>
        <artifactId>fr.opensagres.xdocreport.template.velocity</artifactId>
        <version>1.0.5</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>fr.opensagres.xdocreport</groupId>
        <artifactId>fr.opensagres.xdocreport.template.freemarker</artifactId>
        <version>1.0.5</version>
        <scope>compile</scope>
    </dependency>

and it doesn't work.

djwalid commented 7 years ago

Any pointer will be helpful.

angelozerr commented 7 years ago

i'm using atlassian SDK to create a jira plugin, i used atlas-create-jira-plugin to create the plugin and no .classpath was generated.

I don't know atlassian and when I say "classpath", I mean not .classpath which is an Eclipse file but I mean Java Class Loader.

You must have velocity.jar in your dependencies and you don't need fr.opensagres.xdocreport.template.freemarker and try to remove compile scope.

@djwalid we have not time to provide support, so I cannot help you more. Good luck!

djwalid commented 7 years ago

Hi,

I have finally found the solution, I had to use the following dependency :

<dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>xdocreport</artifactId>
            <version>1.0.4</version>
            <scope>compile</scope>
</dependency>

Thanks for your help Best regards,