hyunsikki / xdocreport

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

NullPointerException on fr.opensagres.xdocreport.template.velocity.VelocityTemplateEngine.getVelocityEngine(VelocityTemplateEngine.java:128) #406

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
click on web link to export data on odt format
What is the expected output? What do you see instead?
create a .odt file. Error 

What version of the product are you using? On what operating system?
1.0.4 on windows 7 with apache tomcat 5, using struts tech

Please provide any additional information below.

Docx Reporting in WEB Application with Dispatcher

A dispather has been created correctly and well configurated on web.xml. When 
link is clicked the getSourceStream() and populateContext() functions are 
executed after them the null pointer error is shown on screen. My libaries 
included are shown in attached file. Any help would be very appreciated

Thank you in advance

Original issue reported on code.google.com by juda...@gmail.com on 11 Jun 2014 at 10:59

Attachments:

GoogleCodeExporter commented 9 years ago
Before using XDocReport in Web App, I suggest you to use it in simple Java main 
to discover if it's a problem with report.

Original comment by angelo.z...@gmail.com on 11 Jun 2014 at 12:31

GoogleCodeExporter commented 9 years ago
Before using XDocReport in Web App, I suggest you to use it in simple Java main 
to discover if it's a problem with report.

Original comment by angelo.z...@gmail.com on 11 Jun 2014 at 12:31

GoogleCodeExporter commented 9 years ago
Before using XDocReport in Web App, I suggest you to use it in simple Java main 
to discover if it's a problem with report.

Original comment by angelo.z...@gmail.com on 11 Jun 2014 at 12:31

GoogleCodeExporter commented 9 years ago

Original comment by angelo.z...@gmail.com on 11 Jun 2014 at 12:31

GoogleCodeExporter commented 9 years ago
Thanks for your reply,

I tried using XDocReport with Java Main and it is working ok, i don´t see any 
problem with report. In fact, if in request i send the parameter processState 
with value "preprocessed" an Odt file is generated ok, but with no values in 
velocity fields

Thanks

Original comment by juda...@gmail.com on 11 Jun 2014 at 1:17

GoogleCodeExporter commented 9 years ago
It's very hard to help you, just with your info.

Original comment by angelo.z...@gmail.com on 12 Jun 2014 at 12:14

GoogleCodeExporter commented 9 years ago
What info do you need? I attach  the dispather and de jsp code is:

<form name="XdocReportForm"  action="/Contratacion/reportDispatcher"  
method="post">
                <input type="hidden" name="reportId" value="Pepe.odt"/>
                <input type="hidden" name="processState" value="generated"/>
                <input type="hidden" name="dispatch" value="view"/>

            </form>

The dispatcher is defined in web.xml as follows:
<servlet>
    <servlet-name>MyDispatcherReportServlet</servlet-name>
    <servlet-class>fr.opensagres.xdocreport.document.web.dispatcher.ProcessDispatcherXDocReportServlet</servlet-class>
    <init-param>
        <param-name>dispatchers</param-name>
        <param-value>es.di.dipcast.contratacion.actions.expedientes.pliegos.MyDispatcher</param-value>
    </init-param>
    <init-param>
        <param-name>cacheOriginalDocument</param-name>
        <param-value>true</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>MyDispatcherReportServlet</servlet-name>
    <url-pattern>/reportDispatcher/*</url-pattern>
  </servlet-mapping>

and i attach de servlet defined.

If you need mor infe just let me know

Thanks

Original comment by juda...@gmail.com on 12 Jun 2014 at 6:31

Attachments:

GoogleCodeExporter commented 9 years ago
I don't understand how you can have NPE. To understand it, I need to debug it, 
in other words I need your full webapp. Please create and attach a simple 
webapp which causes your problem.

Original comment by angelo.z...@gmail.com on 12 Jun 2014 at 7:00

GoogleCodeExporter commented 9 years ago
sorry but it is imposible to attach you my full app, and if i create another 
simple one it won't be equal than original. My impression is the problem should 
be for incompatibility of JARS or missing library or wrong version because i 
tried to do with servle instead of dispatcher ant i got the same error.

No ideas then?

Thanks

Original comment by juda...@gmail.com on 12 Jun 2014 at 7:43

GoogleCodeExporter commented 9 years ago
I have no idea how you could have this problem. Without debugging application, 
I cannot help you more.

Original comment by angelo.z...@gmail.com on 12 Jun 2014 at 7:46

GoogleCodeExporter commented 9 years ago
Ok so i tried to change using freemarker instead of velocity and im getting 
this error, maybe you can help with that??

java.lang.AbstractMethodError: 
fr.opensagres.xdocreport.template.freemarker.FreemarkerDocumentFormatter.getStar
tIfDirective(Ljava/lang/String;)Ljava/lang/String;
fr.opensagres.xdocreport.core.XDocReportException: 
java.lang.AbstractMethodError: 
fr.opensagres.xdocreport.template.freemarker.FreemarkerDocumentFormatter.getStar
tIfDirective(Ljava/lang/String;)Ljava/lang/String;
        at fr.opensagres.xdocreport.document.preprocessor.AbstractXDocPreprocessor.preprocess(AbstractXDocPreprocessor.java:118)

I have no experience working with freemarker. The template can be a ODT file?

Original comment by juda...@gmail.com on 12 Jun 2014 at 8:38

GoogleCodeExporter commented 9 years ago
judass8,

I have not a lot of time, so :

1) please attach simple sources which causes problem (I suggest you that you 
create a little WebApp from scratch to discover your problem).
2) please take time to learn Freemarker if you want to use Freemarker.

Original comment by angelo.z...@gmail.com on 12 Jun 2014 at 8:50

GoogleCodeExporter commented 9 years ago
Hi,

@judass8

It looks like you are using a recent version of 

fr.opensagres.xdocreport.template.freemarker.jar

with an older version of 

fr.opensagres.xdocreport.template.jar

Please make sure all your xdocreport modules versions are aligned or use the 
xdocreport "All in One" jar :

https://code.google.com/p/xdocreport/downloads/list

Regards.

Original comment by pascal.leclercq on 16 Jun 2014 at 11:38

GoogleCodeExporter commented 9 years ago
Hi,

I am using 1.0.4 version on both files

Thanks

regards

Original comment by juda...@gmail.com on 16 Jun 2014 at 11:48

GoogleCodeExporter commented 9 years ago
@judass8 we cannot try and guess your context, so if you want help, please 
attach a simple webapp which causes your problem, otherwise we will close this 
issue.

Regard's Angelo

Original comment by angelo.z...@gmail.com on 16 Jun 2014 at 12:11

GoogleCodeExporter commented 9 years ago
Due to schedule problems i can not waste time on making a new app sorry. I will 
not use XdocReport this time, so you can close this issue.

Thanks for your time

Original comment by juda...@gmail.com on 16 Jun 2014 at 12:18

GoogleCodeExporter commented 9 years ago
Ok I close this issue.

Next time, please attach a sample to help us to debug your problem. Hope you 
will understand that.

Original comment by angelo.z...@gmail.com on 16 Jun 2014 at 12:34

GoogleCodeExporter commented 9 years ago
cleanup

Original comment by pascal.leclercq on 10 Oct 2014 at 7:37