Reports not visible on JasperMobile with JasperServer 5.2

0

 

Hi,

We are using JasperServer CE 5.2.0 (20130708_1615) for development, and the latest version of JasperMobile for Android and also IOS.

We have a number of reports located in different folders in the hierarchy, all of which can be browsed and executed using the JasperServer web service UI (e.g. http://192.168.56.2/jasperserver/) by a JasperServer user 'test' (ROLE_USER).   All works as expected.

However when using the same 'test' user to access the reports via the JasperMobile application, no reports appear in either the Repository or Library views - the correct folder hierarchy appears in the repository, but no resources are shown.   If we connect as 'jasperadmin' then all reports appear and are runnable.

When browsing a repository folder containing some of the reports as the user 'test', catalina.out on the server contains this error once for each report in the repository:

2013-11-07 10:31:25,321 ERROR ResourcesListRemoteServiceImpl,http-80-2:153 - java.lang.NullPointerException

When trying to read the access the 'Library' page via JasperMobile it reports "400 - Bad Request. The request was invalid", and catalina.out on the server contains this hopefully more helpful stack trace:

 

2013-11-07 11:04:05,576 ERROR RESTServlet,http-80-2:222 - Error executing a REST service
java.lang.ClassCastException: java.lang.String cannot be cast to com.jaspersoft.jasperserver.api.metadata.user.domain.User
at com.jaspersoft.jasperserver.search.service.impl.SearchSecurityResolverImpl.hasAccess(SearchSecurityResolverImpl.java:45)
at com.jaspersoft.jasperserver.search.common.RepositorySearchConfiguration.getCustomFilters(RepositorySearchConfiguration.java:92)
at com.jaspersoft.jasperserver.search.common.RepositorySearchConfiguration$$FastClassByCGLIB$$1b0f7eb3.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
at com.jaspersoft.jasperserver.search.common.RepositorySearchConfiguration$$EnhancerByCGLIB$$778a8248.getCustomFilters(<generated>)
at com.jaspersoft.jasperserver.search.service.impl.RepositorySearchServiceImpl.getRestrictionsFilters(RepositorySearchServiceImpl.java:265)
at com.jaspersoft.jasperserver.search.service.impl.RepositorySearchServiceImpl.createAllFiltersList(RepositorySearchServiceImpl.java:257)
at com.jaspersoft.jasperserver.search.service.impl.RepositorySearchServiceImpl.getLookups(RepositorySearchServiceImpl.java:126)
at com.jaspersoft.jasperserver.search.service.impl.RepositorySearchServiceImpl.getResults(RepositorySearchServiceImpl.java:109)
at sun.reflect.GeneratedMethodAccessor325.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy39.getResults(Unknown Source)
at com.jaspersoft.jasperserver.remote.services.impl.ResourcesListRemoteServiceImpl.getResources(ResourcesListRemoteServiceImpl.java:240)
at com.jaspersoft.jasperserver.rest.services.RESTResources.doGet(RESTResources.java:141)
at com.jaspersoft.jasperserver.rest.RESTAbstractService.execute(RESTAbstractService.java:105)
at com.jaspersoft.jasperserver.rest.RESTServlet.service(RESTServlet.java:135)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.jaspersoft.jasperserver.war.StaticFilesCacheControlFilter.doFilter(StaticFilesCacheControlFilter.java:112)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:399)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
at com.jaspersoft.jasperserver.api.metadata.user.service.impl.PasswordExpirationProcessingFilter.doFilter(PasswordExpirationProcessingFilter.java:85)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
at com.jaspersoft.jasperserver.api.metadata.user.service.impl.JIPortletAuthenticationProcessingFilter.doFilter(JIPortletAuthenticationProcessingFilter.java:81)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
at com.jaspersoft.jasperserver.api.logging.filter.BasicLoggingFilter.doFilter(BasicLoggingFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:188)
at org.springframework.security.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:99)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.jaspersoft.jasperserver.war.util.SessionDecoratorFilter.doFilter(SessionDecoratorFilter.java:43)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.jaspersoft.jasperserver.war.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:67)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.jaspersoft.jasperserver.war.P3PFilter.doFilter(P3PFilter.java:43)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:558)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)

 

Thoughts on the cause of this are greatly appreciated...we would like to promote the use of the JasperMobile application to run our reports, but right now this problem is stopping us from doing that :-)

 

andy.c's picture
6
Joined: Nov 7 2013 - 2:36am
Last seen: 5 years 5 months ago

1 Answer:

0

I believe that this is related to our use of an 'old' external authentication mechanism - covered by this previous issue:

http://community.jaspersoft.com/wiki/upgrading-custom-external-authentic...

For the record I have added the 'JIAuthenticationSynchronizer' before the 'anonymousProcessingFilter' on the '/rest/**' and '/rest_v2/**' filters of the applicationContext-security-web.xml file, and all of a sudden the reports appeared for my user and started to run.

However it would be great to get some confirmation that my solution is acceptable, and that I have indeed added 'JIAuthenticationSynchronizer' in the correct locations for these filters.

andy.c's picture
6
Joined: Nov 7 2013 - 2:36am
Last seen: 5 years 5 months ago
Feedback
randomness