Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
RunAndRender - Null Pointer Exception
bkabka
Hello, <br />
<br />
Two days ago it was my first attempt of deploying grails aplication (Birt plugin included) on Tomcat server. While deploying my application on STS embedded TC Server (local host) there werent any problems doing it. The story turns out different when I produce a war file (-grails war) and deploy it on remote Tomcat server. <br />
<br />
Application works well till it reaches the point where it has to generate html report with calling runAndRender method. <pre class='_prettyXprint _lang-auto _linenums:0'>birtReportService.runAndRender(reportName, reportParams, htmlOptions)</pre>
<br />
So I started debugging it and found out that the error happens in this line (Null Pointer Exception) : <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>task.run()</pre>
<br />
And here is the comparison of <strong class='bbc'>IRunAndRenderTask task </strong> structure from running application in local or remote mode:<br />
<br />
<strong class='bbc'>Local:</strong> <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
"task" (pending)
cancelFlag false
dataSource null
dataSourceReportlet null
defaultValues HashMap<K,V> (id=610)
emitterID "org.eclipse.birt.report.engine.emitter.html" (id=611)
engine ReportEngine (id=377)
executionContext ExecutionContext (id=612)
format "html" (id=614)
inputValues HashMap<K,V> (id=615)
layoutEngine HTMLReportLayoutEngine (id=616)
log Logger (id=619)
pageHandler null
pagination "page-break-pagination" (id=624)
parameterChanged false
platformContext null
progressMonitor null
renderOptions HTMLRenderOption (id=415)
resourceLocator ResourceLocatorWrapper (id=630)
runningStatus 2
runValues HashMap<K,V> (id=633)
statusHandler null
taskID 32
taskType 3
timeZone JavaTimeZone (id=637)
ulocale ULocale (id=641)
userAcls null
</pre>
<br />
<strong class='bbc'>Remote:</strong><br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
"task" (pending)
cancelFlag false
dataSource null
dataSourceReportlet null
defaultValues HashMap<K,V> (id=409)
emitterID null
engine ReportEngine (id=410)
executionContext ExecutionContext (id=413)
format null
inputValues HashMap<K,V> (id=415)
layoutEngine null
log Logger (id=416)
pageHandler null
pagination null
parameterChanged false
platformContext null
progressMonitor null
renderOptions HTMLRenderOption (id=379)
resourceLocator ResourceLocatorWrapper (id=419)
runningStatus 0
runValues HashMap<K,V> (id=421)
statusHandler null
taskID 18
taskType 3
timeZone JavaTimeZone (id=422)
ulocale ULocale (id=424)
userAcls null
</pre>
As you can see the difference is in EmitterID and format option.<br />
I am stuck right now because I have no idea what is going wrong and how to debug deeper, so I would really appreciate any help you guys can give me.
Find more posts tagged with
Comments
Yaytay
<blockquote class='ipsBlockquote' data-author="'bkabka'" data-cid="114868" data-time="1362673530" data-date="07 March 2013 - 09:25 AM"><p>
So I started debugging it and found out that the error happens in this line (Null Pointer Exception) : <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>task.run()</pre></p></blockquote>
The only way that line itself could be the source of a NullPointerException is if task were null, which it does not appear to be.<br />
So the exception must have come from inside the run method.<br />
Do you have any kind of stack trace (calling printStackTrace on he exception from inside the debugger might get you one)?<br />
<br />
Jim
bkabka
Thanks for a quick response. I did as you recommended and printed whole stack trace. As expected the error hides inside the task.run(), if I am correct reading the trace. Since full trace is quite big there is a .txt file appended with the reply.<br />
<br />
These are first few lines:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:196)
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
org.eclipse.birt.report.engine.api.IRunAndRenderTask$run.call(Unknown Source)
BirtReportService.runAndRender(BirtReportService.groovy:500)
sun.reflect.GeneratedMethodAccessor290.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:616)
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:231)
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:153)
BirtReportService.runAndRender(BirtReportService.groovy)
BirtReportService$runAndRender.call(Unknown Source)
ReportController$_closure6.doCall(ReportController.groovy:117)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:616)
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:231)
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
ReportController$_closure6.doCall(ReportController.groovy)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:616)
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1071)
groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
</pre>
bkabka
At the end it showed up there was wrong relative path for connection profile. Remote debugging really messed up my head because I could not get any information what could cause crash while showing reports.
You can close this discussion now since the problem is solved