MohamedSaeed / xdocreport

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

Attribute Value is null causing a NPE #319

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This library is used in a product that we developed for a client. We cannot 
reproduce the problem in our development environment. Our development 
environment is mostly Windows boxes with a few Linux boxes. 

Our client has two environments, Test and Production, which are both Linux 
boxes that use Java and Tomcat. The exact details of which are not available.

The client routinely restarts Tomcat each night. In the morning all DocX 
Reports work for a few hours and then they all produce stacktraces around 
mid-morning. The only solution is to restart Tomcat. The rest of the 
application which is quite complex and has other reporting frameworks continues 
to work with no problems.

The stacktrace generated by the failing DocX Reports is:
2013-10-28 15:38:49 ERROR com.geometryit.ead.web.custom.ReportHandler - - 
java.lang.NullPointerException
at java.io.Writer.write(Writer.java:157)
at 
fr.opensagres.xdocreport.document.preprocessor.sax.BufferedAttribute.save(Buffer
edAttribute.java:70)
at 
fr.opensagres.xdocreport.document.preprocessor.sax.BufferedRegion.save(BufferedR
egion.java:54)
at 
fr.opensagres.xdocreport.document.preprocessor.sax.BufferedTagElement.save(Buffe
redTagElement.java:55)
at 
fr.opensagres.xdocreport.document.preprocessor.sax.BufferedRegion.save(BufferedR
egion.java:54)
at 
fr.opensagres.xdocreport.document.preprocessor.sax.BufferedTagElement.save(Buffe
redTagElement.java:55)
at 
fr.opensagres.xdocreport.document.preprocessor.sax.BufferedRegion.save(BufferedR
egion.java:54)
at 
fr.opensagres.xdocreport.document.preprocessor.sax.BufferedTagElement.save(Buffe
redTagElement.java:55)
at 
fr.opensagres.xdocreport.document.preprocessor.sax.BufferedElement.save(Buffered
Element.java:161)
at 
fr.opensagres.xdocreport.document.preprocessor.sax.SAXXDocPreprocessor.preproces
s(SAXXDocPreprocessor.java:66)
at 
fr.opensagres.xdocreport.document.preprocessor.sax.SAXXDocPreprocessor.preproces
s(SAXXDocPreprocessor.java:47)
at 
fr.opensagres.xdocreport.document.preprocessor.AbstractXDocPreprocessor.preproce
ss(AbstractXDocPreprocessor.java:88)
at 
fr.opensagres.xdocreport.document.AbstractXDocReport.doPreprocessorIfNeeded(Abst
ractXDocReport.java:363)
at 
fr.opensagres.xdocreport.document.AbstractXDocReport.process(AbstractXDocReport.
java:509)
at 
fr.opensagres.xdocreport.document.AbstractXDocReport.process(AbstractXDocReport.
java:484)
at 
com.geometryit.eagle.web.AbstractReportHandler.generateXDocReport(AbstractReport
Handler.java:228)
at 
com.geometryit.ead.web.custom.ReportHandler.generateReport(ReportHandler.java:10
67)
at com.geometryit.ead.web.custom.ReportHandler.process(ReportHandler.java:259)
at com.geometryit.eagle.web.BaseDefaultSite.process(BaseDefaultSite.java:164)
at com.geometryit.eagle.mng.SiteManager.invoke(SiteManager.java:103)
at com.geometryit.eagle.servlet.AppServlet.invoke(AppServlet.java:838)
at com.geometryit.eagle.servlet.AppServlet.processRequest(AppServlet.java:804)
at com.geometryit.eagle.servlet.AppServlet.doPost(AppServlet.java:346)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:305)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:210)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
22)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:1
23)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.jav
a:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118
)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200)
at 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractPro
tocol.java:589)
at 
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)

What version of the product are you using? On what operating system?
We are using version 1.0.0 The problem is occurring on out client's Linux 
System but not consistently.

Original issue reported on code.google.com by brett.wa...@gmail.com on 6 Nov 2013 at 6:58

GoogleCodeExporter commented 9 years ago
It's very hard for us to help you if we cannot reproduce the problem.

At first I suggest you to use 1.0.3 because it provides dumper feature that it 
could help you to dump the report (see 
https://code.google.com/p/xdocreport/wiki/XDocReportDumper)

The stack trace shows that an attribute value is null (how is it possible?). 
The thing that I don't understand is that you tell me it works while few hours 
and after you have the error? By default XDocReport loads the report the first 
time (preprocessor are executed) and cache it the IXDocReport instance. The 
second generation of the report use the cached IXDocReport instance and 
preprocessor are not executed.

Perhaps you have a process which disable this cache and the docx is updated too?

I suggest you when client has the problem that he send you the docx/odt which 
causes the problem.

It's shame that you have not used the XDocReport servlet because it provides 
several features like download the odt/docx template of the report,dump, 
download some entries of the docx/odt etc

I'm sorry, it's very hard for me to help you more with your little information.

Original comment by angelo.z...@gmail.com on 6 Nov 2013 at 8:42

GoogleCodeExporter commented 9 years ago
Just one idea to try to find out the problem, you could do try catch the NPE 
error when IXDocReport is loaded and send you an email with the docx which 
causes the problem.

If you switch to 1.0.3, you could generate a dump report to retrieve the data 
model used too.

In this try/catch you could reload the IXDocReport to avoid having the NPE 
problem by waiting for we fix this problem.

Hope it will help you.

Regards Angelo

Original comment by angelo.z...@gmail.com on 6 Nov 2013 at 1:24

GoogleCodeExporter commented 9 years ago
Have you find some explanation about this trouble?

Original comment by angelo.z...@gmail.com on 18 Feb 2014 at 1:51