• NullPointerException when two users are connected

  • Do you want to create a native client or integrate with third party applications: webservices are the solution.
Do you want to create a native client or integrate with third party applications: webservices are the solution.
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.
 #11508  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
 #11511  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.
 #11514  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.
 #11532  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.
 #11534  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

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.