[#4961] - NullPointer on execution

Category:
Bug report
Priority:
High
Status:
Feedback Requested
Project: Severity:
Critical
Resolution:
Fixed
Component: Reproducibility:
Always
Assigned to:
1

Hello,

When I try to execute a JasperReports with 6 parameters in JasperServer 6.1, I have the following error :

java.lang.NullPointerException at java.util.Hashtable.<init>(Hashtable.java:296) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.Log4jMdcCompatibleThreadPoolExecutor.execute(Log4jMdcCompatibleThreadPoolExecutor.java:55) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.fillReport(EngineServiceImpl.java:607) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.executeReportUnitRequest(EngineServiceImpl.java:1941) at com.jaspersoft.jasperserver.api.engine.jasperreports.domain.impl.ReportUnitRequest.execute(ReportUnitRequest.java:67) at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.execute(EngineServiceImpl.java:493) at com.jaspersoft.jasperserver.war.action.ViewReportAction.executeReport(ViewReportAction.java:635) at com.jaspersoft.jasperserver.war.action.ViewReportAction.executeReport(ViewReportAction.java:525) at com.jaspersoft.jasperserver.war.action.ViewReportAction.runReport(ViewReportAction.java:401) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.webflow.action.DispatchMethodInvoker.invoke(DispatchMethodInvoker.java:98) at org.springframework.webflow.action.MultiAction.doExecute(MultiAction.java:123) at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188) at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51) at org.springframework.webflow.action.EvaluateAction.doExecute(EvaluateAction.java:77) at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188) at org.springframework.webflow.execution.AnnotatedAction.execute(AnnotatedAction.java:145) at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51) at org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:101) at org.springframework.webflow.engine.State.enter(State.java:194) at org.springframework.webflow.engine.Transition.execute(Transition.java:227) at org.springframework.webflow.engine.impl.FlowExecutionImpl.execute(FlowExecutionImpl.java:393) at org.springframework.webflow.engine.impl.RequestControlContextImpl.execute(RequestControlContextImpl.java:214) at org.springframework.webflow.engine.TransitionableState.handleEvent(TransitionableState.java:119) at org.springframework.webflow.engine.Flow.handleEvent(Flow.java:555) at org.springframework.webflow.engine.impl.FlowExecutionImpl.handleEvent(FlowExecutionImpl.java:388) at org.springframework.webflow.engine.impl.RequestControlContextImpl.handleEvent(RequestControlContextImpl.java:210) at org.springframework.webflow.engine.ViewState.handleEvent(ViewState.java:232) at org.springframework.webflow.engine.ViewState.resume(ViewState.java:196) at org.springframework.webflow.engine.Flow.resume(Flow.java:545) at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:261) at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169) at sun.reflect.GeneratedMethodAccessor195.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy120.resumeExecution(Unknown Source) at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183) at org.springframework.webflow.mvc.servlet.FlowController.handleRequest(FlowController.java:174) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:855) at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.jaspersoft.jasperserver.war.StaticFilesCacheControlFilter.doFilter(StaticFilesCacheControlFilter.java:163) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) at com.jaspersoft.jasperserver.api.security.IPadSupportFilter.doFilter(IPadSupportFilter.java:67) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.war.common.JSSwitchUserProcessingFilter.doFilter(JSSwitchUserProcessingFilter.java:157) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.api.metadata.user.service.impl.MetadataAuthenticationProcessingFilter.doFilter(MetadataAuthenticationProcessingFilter.java:103) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.war.util.RequestParameterAuthenticationFilter.doFilter(RequestParameterAuthenticationFilter.java:99) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.war.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:217) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.war.NullFilter.doFilter(NullFilter.java:43) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.war.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:217) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.api.logging.filter.BasicLoggingFilter.doFilter(BasicLoggingFilter.java:57) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.api.security.JSCsrfGuardFilter.doFilter(JSCsrfGuardFilter.java:83) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.api.security.WebAppSecurityFilter.doFilter(WebAppSecurityFilter.java:80) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.war.MultipartRequestWrapperFilter.doFilter(MultipartRequestWrapperFilter.java:95) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:100) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at com.jaspersoft.jasperserver.api.security.encryption.EncryptionFilter.doFilter(EncryptionFilter.java:150) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.jaspersoft.jasperserver.war.util.SessionDecoratorFilter.doFilter(SessionDecoratorFilter.java:63) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.jaspersoft.jasperserver.war.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:67) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.jaspersoft.jasperserver.war.P3PFilter.doFilter(P3PFilter.java:43) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

Have you an idea ?
Thanks in advance.
Thomas

v6.1
thomas.bedouin's picture
Joined: Sep 8 2014 - 1:39am
Last seen: 1 week 5 days ago

16 Comments:

#1

I have same issue in 6.1 but without using parameter. And after doing many retries (refresh), sometimes the error disappears and the report displays.

Nicolas

#2
  • Priority:Normal» High
  • Severity:Minor» Critical
  • Reproducibility:N/A» Always

I am having the same problem - it is reproducible for me when I have the reports server configured to allow pre-authenticated access via a token (applicationContext-externalAuth-preAuth-mt.xml). This was working in 5.6 and I have updated the differences in this file templates between the 2 versions. I get the error even when I log on to the report server directly and run any report (even the built in reports).

#3

I have the same issue in 6.1 but it happens regardless of parameter count. This seems to be linked to the proxyAuthenticationFilter used when external authentication is setup. If you just add the applicationContext-externalAuth-template.xml file from the sample folder into the WEB-INF folder then you will see this issue.

Simon, if you're using the preauth-mt.xml file, then according to this you can fix it by commenting out a line: http://community.jaspersoft.com/wiki/sso-not-working-expected-jaspersoft...

I have also come up with a workaround that seems to work for me. Looking at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.Log4jMdcCompatibleThreadPoolExecutor.execute(Log4jMdcCompatibleThreadPoolExecutor.java:55), the null pointer happens when the hashtable is initialized with null (MDC.getContext() returning null).

So in the AuthenticationProcessingFilter class of my authentication bean, I added these lines to doFilter:

if (MDC.getContext() == null) {
MDC.put("test","test");
MDC.remove("test");
}

This initializes the context so when it gets to Lpg4jMdcCompatibleThreadPoolExecutor, MDC.getContext() won't return null.

#4

Jason, Were you able to make your authentication working using applicationContext-externalAuth-template.xml? I am not able to make it working in 6.1 or in 6.0.1 it is working till 5.6.1. I have updated all spring reference but authentication call doesn't go to dofilter in my authentication processing filter class. So i am not able to run it stand alone or with external authentication. Any suggestion would help.

#5

Achandarana , external authentication is working for me, the only modification I made to applicationContext-externalAuth-template.xml was on the line "<bean id="proxyAuthenticationProcessingFilter" class="<my processing filter class>" parent="authenticationProcessingFilter">".

It passes through my filter, although I have had issues with logs since 6.1 so it was hard to tell. Since 6.1 I had to output the logs to a different file to see them. In the WEB-INF/log4j.properties file I added my class to the logs as "log4j.logger.TokenAuthenticationProcessingFilter=debug, jasperanalysis", outputting to the jasperanalysis.log file. For some reason the logs for my custom classes won't show up in jasperserver.log anymore unless I set the root logger to debug.

If your server starts up without complaining about your spring configurations then my first thought is that maybe the logs just aren't showing up. I assume you have some sort of log.debug("doFilter reached") message in the doFilter? Set the rootLogger in log4j.properties to DEBUG, restart the server and log in. Then see if that shows up in jasperserver.log.

#6
#7

Thanks Jason - this worked in terms of being able to run the reports in the server, unfortunately they still aren't coming back when called through visualise.js (I had hoped it was the same root cause - back to the drawing board)

#8

Check the permissions on the directory of the Apache Tomcat logs. My logs were "read only" and couldn't be written to, after I set them to read/write/execute for all users (including tomcat), this error went away. Someone else commented they've been having trouble with their logs, this may be related.

#9

Does there by chance exist a work-around for applicationContext-externalAuth-LDAP too?

Edit:
Wouldn't it be worth to mention this issue here too?
http://community.jaspersoft.com/wiki/tibco-jasperreports-server-v610-rel...

Edit2:
Cross-reference to pot. duplicate of this issue (but for LDAP)
http://community.jaspersoft.com/jasperreports-server/issues/4991

#10

I've recompiled 6.1.0 problematic JAR and now it works with all kind of ext auth
Simple, remove the old 6.1.0 webapps/jasperserver/WEB-INF/lib/jasperserver-api-engine-impl-6.1.0.jar and put this one

AttachmentSize
jasperserver-api-engine-impl-6.1.0.jar761.94 KB
#11

Alberto's jar worked for me.

#12

Alberto,
Can you please tell what exactly did you change in the jar.
Thanks.

#13

Thanks Albert, that Jar work for me and save alot of time.

Please help to share on what you did on that jar.

Thank you

#14
  • Priority:High» None
  • Resolution:Open» Fixed
  • Status:New» Feedback Requested

I've imported reports from JasperServer 4.5.1 into Jasper 6.1 and faced with same error.
Alberto's jar fixed my issue, thanks!

#15
  • Priority:None» High

=== EDIT ====
Looks like this was fixed in 6.2.0 version of the jar. No Alberto jar needed this time around.
===========

Where/How can we get a new version Alberto's recompiled jar for 6.2? I've already tried renaming:
jasperserver-pro/WEB-INF/lib/jasperserver-api-engine-impl-6.1.0.jar -> jasperserver-pro/WEB-INF/lib/jasperserver-api-engine-impl-6.2.0.jar

However, I'm fairly certain there are class definitions or other hard coded references to 6.1 as I get several errors similar to the following error when the another class tries to load it as a dependency:

======================
org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.jaspersoft.jasperserver.war.cascade.handlers.converters.DataConverterServiceImpl] for bean with name 'dataConverterService' defined in URL [jar:file:/var/lib/tomcat7/webapps/jasperserver-pro/WEB-INF/lib/jasperserver-war-jar-6.2.0.jar!/com/jaspersoft/jasperserver/war/cascade/handlers/converters/DataConverterServiceImpl.class]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: com/jaspersoft/jasperserver/api/engine/jasperreports/service/impl/GlobalDefaultValueProvider
======================

#16

Thanks Alberto for JAR file. It worked.

Feedback
randomness