Report execution cleanup fails

When running a report with visualize.js I get a stack trace when report execution runs. The stack trace occurs when the server is shutdown or the session times out.

org.springframework.security.authentication.AuthenticationCredentialsNotFoundException: An Authentication object was not found in the SecurityContext
        at org.springframework.security.access.intercept.AbstractSecurityInterceptor.credentialsNotFound(AbstractSecurityInterceptor.java:339)

I'm using a custom filter that authenticates the user based off of a token passed in through the url. (ex. https://[jasperserverurl]/jasperserver-pro?ticket=eb802b8a-8f09-4301-9c3d-3799cd10cef5) Visualize.js is authenticating using a custom login function

var jasperConfig = {
	auth: {
		loginFn: function (properties, request) {
			return request({
				url: "//[jasperserverurl]/jasperserver-pro?ticket=eb802b8a-8f09-4301-9c3d-3799cd10cef5"
			});
		}
	}
}
 
visualize.config(jasperConfig);

After running a report using the setup above and waiting for the session to time out or shutting down tomcat the stack trace is produced. This is causing problems because tomcat doesn't shutdown all the way and the server ends up having multiple instances of tomcat running.

If I browse to the url manually with the provided token and run reports in the jasper server no stack trace is produced. I can't figure out whats going on. I've spent a lot of time trying to track down the issue. Any help would be appreciated.

tyson.decker's picture
Joined: Nov 13 2014 - 2:27pm
Last seen: 6 years 10 months ago

Heres the full stack trace

org.springframework.security.authentication.AuthenticationCredentialsNotFoundException: An Authentication object was not found in the SecurityContext at org.springframework.security.access.intercept.AbstractSecurityInterceptor.credentialsNotFound(AbstractSecurityInterceptor.java:339) at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:198) at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:60) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy119.cancelExecution(Unknown Source) at com.jaspersoft.jasperserver.remote.services.impl.RunReportServiceImpl.cancelReportExecution(RunReportServiceImpl.java:536) at com.jaspersoft.jasperserver.remote.services.impl.RunReportServiceImpl.destroy(RunReportServiceImpl.java:549) at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:239) at org.springframework.beans.factory.support.DisposableBeanAdapter.run(DisposableBeanAdapter.java:215) at org.springframework.web.context.request.DestructionCallbackBindingListener.valueUnbound(DestructionCallbackBindingListener.java:52) at org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1816) at org.apache.catalina.session.StandardSession.expire(StandardSession.java:880) at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:670) at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:533) at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:518) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1317) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1496) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1506) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1506) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1485) at java.lang.Thread.run(Thread.java:745) 

tyson.decker - 7 years 9 months ago

0 Answers:

No answers yet
Feedback