• Hint if you wanna upgrade to tomcat 8.0.x

  • 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.
 #29891  by Catscratch
 
Hi,

I'm using OpenKM 6.3 on Tomcat 8.0.9 and a strange error costs me several hours of time until I noticed the reason.

If you want to run OpenKM in Tomcat 8.0.x you will get the following exception on startup:
Code: Select all
2014-09-12 15:28:55,986 [localhost-startStop-1] INFO  com.openkm.servlet.RepositoryStartupServlet- *** Initialize property groups... ***
2014-09-12 15:28:55,990 [localhost-startStop-1] INFO  com.openkm.util.FormUtils$LocalResolver- new LocalResolver(null)
2014-09-12 15:28:55,991 [localhost-startStop-1] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/]- StandardWrapper.Throwable
java.lang.ExceptionInInitializerError
	at com.openkm.servlet.RepositoryStartupServlet.init(RepositoryStartupServlet.java:110)
	at javax.servlet.GenericServlet.init(GenericServlet.java:158)
	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1241)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1154)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1041)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4932)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5218)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at java.io.File.<init>(File.java:277)
	at com.openkm.util.FormUtils$LocalResolver.<init>(FormUtils.java:845)
	at com.openkm.util.FormUtils.<clinit>(FormUtils.java:73)
	... 14 more
Long story short. There was a change in the servlet API in tomcat.

The method
Code: Select all
String javax.servlet.ServletContext.getRealPath(String path)
does no longer allow passing a parameter without a leading "/". So you have to correct the OpenKM sources in the Config.java on line 578 and 582 to look like the following.
Code: Select all
578: DTD_BASE = sc.getRealPath("/WEB-INF/classes/dtd");
582: LANG_PROFILES_BASE = sc.getRealPath("/WEB-INF/classes/lang-profiles");
Without a leading "/" the ServletContext will return null and then the whole OpenKM startup process fails.

So if you plan to upgrade to a newer tomcat version, keep this in mind.
Last edited by Catscratch on Mon Sep 15, 2014 2:55 pm, edited 3 times in total.
 #29920  by pavila
 
Thanks for the info. This error is quite weird! I'm not sure if it's a Tomcat 8 issue.

I've added a couple of comments to remember it when needed.

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.