• OpenKM Exception while dispatching incoming RPC call

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #44211  by vhlen
 
I've got an issue with login-logout-login scenarios. When I login to the system, sometime it redirects to wrong page.
I think the problem is the spring filter stores the last requested URL and uses that value as the target to redirect after login.
Can you help me resolve this problem?
Code: Select all
2017-07-02 21:53:20,851 [http-bio-0.0.0.0-8080-exec-1] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/OpenKM]- Exception while dispatching incoming RPC call
javax.servlet.ServletException: Content-Type was '(null)'. Expected 'text/x-gwt-rpc'.
	at com.google.gwt.user.server.rpc.RPCServletUtils.checkContentTypeIgnoreCase(RPCServletUtils.java:427)
	at com.google.gwt.user.server.rpc.RPCServletUtils.readContent(RPCServletUtils.java:160)
	at com.google.gwt.user.server.rpc.RPCServletUtils.readContentAsGwtRpc(RPCServletUtils.java:205)
	at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.readContent(AbstractRemoteServiceServlet.java:182)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:239)
	at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	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 org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
	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.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
	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 org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
	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.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	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 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:501)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Attachments
Screen Shot 2017-07-02 at 23.07.58.png
Screen Shot 2017-07-02 at 23.07.58.png (46.04 KiB) Viewed 4494 times
 #44219  by jllort
 
Yes, spring take in consideration the last URL what you have accessed. If you logout correctly ( with the menu option ) this issue should not happens.
 #44222  by vhlen
 
Thanks jllort for your reply.
I logout correctly ( with the menu option ) but the issue will be appear if I was working multiple OpenKM tab on the browser.
It seems the spring stored last URL and redirected me to wrong page after I login.
I can reproduce this issue with demo web version (https://demo.openkm.com)
  • Step 3: On tab 2, We logout with the menu option (Click File -> Exit). It will show us the popup say that "The OpenKM has closed correctly". And then click "Close" button to go to the login page.
  • Step 4: Switch to tab 1, Click something on the website (Such as we click a file or a folder on the desktop dashboard) The website will show an error popup "Error when communicating with server".
  • Step 5: Switch to tab 2, Login again with an user/pass. It will redirect to wrong page with an error message: "The call failed on the server; see server log for details"
I think the root cause is on the step 4. The Spring was stored the last URL on this step and redirect us to the URL request after login.
In reality, the Users need to use multiple tabs in some cases. It would be nice if we can fix it.
Attachments
Screen Shot 2017-07-03 at 16.06.51.png
Screen Shot 2017-07-03 at 16.06.51.png (54.29 KiB) Viewed 4489 times
 #44239  by jllort
 
Working with 2 tabs are doing logout from one side and with another are trying to get protected resources, obviously in this scenario the last url have been tryed to accessing is from the tab where you have not logout, might be any of the url periodically used for refreshing data.
 #44257  by jllort
 
For my understanding is not possible, but we are open for a solution. I do not know if you have using other application and there is solved if you discover how to solve it, share with us and we will study it.
 #44431  by vhlen
 
Hi jllort,
After I did some researches, I have a temporary solution for this issue: We can force the website always redirect into index page when user login successfully.
Add bellow code:
Code: Select all
always-use-default-target="true"
into form-login tag on appContext.xml
Code: Select all
<security:form-login login-page="/login.jsp" authentication-failure-url="/login.jsp?error=1" always-use-default-target="true"/>
There is a small problem with this solution. If we use this configuration, the OpenKM will not redirect destination page when we are not logged the system. (Because we force the login form always redirect to index page).
I hope someone has better solution than this solution. We need to consider when we use this solution.
 #44440  by jllort
 
We are going to check the workaround and if it's going right we will update the source code. Thanks for sharing it.

If you want to apply the change in our github repository https://github.com/openkm/document-management-system ( create a new branch and ask for a merge to 6.3-DEV branh ) you are welcome.
 #44613  by pavila
 
I've tried and the solution has problems. If the user is not authenticated and access to OpenKM using an URL like this http://localhost:8080/OpenKM/index.jsp? ... 2828b9531b , it won't pass the uuid parameter after the login page and OpenKM won't jump to the document. I think this is what you said, but I didn't understand you :)

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.