Page 1 of 1

NullPointerException when two users are connected

PostPosted:Sat Jul 09, 2011 1:47 pm
by ilagi
Hi,
Using webservices we created a front-end, where all folders a read and displayed. It works fine, if we have only one user connected, but if two users (from two different PCs) opens this up about the same time then both get stopped and the server shows NullPointerException.
We are using OpenKM version 4.1. The two users are connecting to OpenKM with different usernames.

Both users get 'stuck', the server drops the below error message and then they need to wait until their user times out 30 mins later and then try again.

I did some more testing and realized that the exact same is happening if one user is connecting via web services, reading through the folder structure and at the same time an adminsitrator goes to the Repository menu under the Admin tools. Is it possible that the repository cannot handle two connections at the same time from web services?

Any idea what might be wrong?
Thanks

Error message from server log:
Code: Select all
2011-07-09 09:32:40,387 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/OpenKM].[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
	at org.apache.jsp.admin.repository_005fview_jsp._jspService(repository_005fview_jsp.java:167)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	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:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
	at java.lang.Thread.run(Thread.java:619)
2011-07-09 09:32:40,403 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost]] Exception Processing ErrorPage[exceptionType=java.lang.Exception, location=/error.jsp]
org.apache.jasper.JasperException: java.lang.ClassCastException: java.lang.NullPointerException cannot be cast to es.git.openkm.frontend.client.OKMException
	at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:415)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:447)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
	at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:423)
	at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:270)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException: java.lang.NullPointerException cannot be cast to es.git.openkm.frontend.client.OKMException
	at org.apache.jsp.error_jsp._jspService(error_jsp.java:97)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
	... 20 more

Re: NullPointerException when two users are connected

PostPosted:Sat Jul 09, 2011 3:39 pm
by jllort
1- First I suggest upgrade to 5.0.x version, because 4.1 is and older version that on nearly future will not yet be supported.
2- Repository_view is a low level utility that might not be used, except in exceptional cases.

I would like understanding how to reproduce it, explain better the case ( for example user A login from browser and goes .... meanwhile userB etc... ), explain with more detail how can reproduce the error.

Re: NullPointerException when two users are connected

PostPosted:Sat Jul 09, 2011 5:17 pm
by ilagi
Ok, so let me explain it in more details. I actually has two ways to reproduce the same issue:

1. Two users are logging into our Web Services at the same time. The web services reads the completed folder structure by running recursive $OKMFolder->getChilds($token, $path);. It takes about 10-15 sec to read the whole folder structure. If the two users run this at the same time then the below quoted error message will get generated and none of them will get the results. They both get locked out for 30 mins.

2. Second way of reproducing it is to have only one user (user A) running Web services and building the folder structure on the way as it is explained at step #1. The second user (user B) is an admin, who logged into OpenKM and in the administrative Module went to Repository / okm:root at the same time when user A was reading the folder structure via the web services.
Same error gets generated and user A will not get the folder structure and will get locked out for 30 mins.

If a user builds the folder structure via web services when nobody else is trying to do the same, then there is not problem.

I hope this helps.

Re: NullPointerException when two users are connected

PostPosted:Tue Jul 12, 2011 8:16 am
by pavila
Can you reproduce the issue with the last OpenKM release (5.1.6)?

Re: NullPointerException when two users are connected

PostPosted:Tue Jul 12, 2011 2:34 pm
by jllort
Curious problem, seems to be a lock in one of the core methods, the error you posted is the first error appearing on log or there's something before it ?

I suggest as I said in other post upgrade to version 5.0.X , 4.1 is really order and we'll declare early as a non soported version ( obsolete ). Refer in our wiki about migration guide.

Re: NullPointerException when two users are connected

PostPosted:Tue Jul 12, 2011 2:40 pm
by ilagi
Yes, the above listed error is the first appearing in the server log.

We are planning a migration to 5.1 in a few months, but we have a fairly complicated setup including a php site using web services, MySQL used for database, big repository, etc, so it will require lot of testing of the new version to make sure everything is working before we can move to the new version.

I hoped we can identify what might be causing this issue in 4.1

Re: NullPointerException when two users are connected

PostPosted:Tue Jul 12, 2011 3:51 pm
by pavila
4.1.x branch is not maintained anymore, unless a customer request it. But in any case, we do not plan to make any Community 4.1.x release. So my recommendations are:

* Become a customer (http://www.openkm.com/Contact/)
* Migrate to a more recent OpenKM release