I am attempting a new v15.1 server installation on MacOS X and when I try to use Tomcat 8 (8.0.23) it fails to start the labkey webapp:
catalina.out:
02-Jul-2015 10:03:16.729 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more Filters failed to start. Full details will be found in the appropriate container log file
02-Jul-2015 10:03:16.729 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/labkey] startup failed due to previous errors
labkey.log:
ERROR ModuleLoader 2015-07-02 10:03:16,726 localhost-startStop-1 : Failure occurred during ModuleLoader init.
java.lang.NullPointerException
at java.io.File.<init>(File.java:277)
at org.labkey.api.module.ModuleLoader.webappFilesExist(ModuleLoader.java:449)
at org.labkey.api.module.ModuleLoader.verifyProductionModeResources(ModuleLoader.java:433)
at org.labkey.api.module.ModuleLoader.doInit(ModuleLoader.java:313)
at org.labkey.api.module.ModuleLoader.init(ModuleLoader.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4574)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5193)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:586)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1750)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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)
The version of Java is 1.8.0_25.
The problem does not occur if I use a Tomcat 7 instance instead of the Tomcat 8.
Digging in the Tomcat 8 source code for org.apache.catalina.core.StandardContext it appears that this may be due to sending Strings (specified in ModuleLoader's verifyProductionModeResources()) to getRealPath() that are not prepended with a '/' and hence result in it returning null:
4443 public String More ...getRealPath(String path) {
4444 // The WebResources API expects all paths to start with /. This is a
4445 // special case for consistency with earlier Tomcat versions.
4446 if ("".equals(path)) {
4447 path = "/";
4448 }
4449 if (resources != null) {
4450 try {
4451 return resources.getResource(path).getCanonicalPath();
4452 } catch (IllegalArgumentException iae) {
4453 // ServletContext.getRealPath() does not allow this to be thrown
4454 }
4455 }
4456 return null;
4457 }
Are there plans to add Tomcat 8 compatibility?
Regards,
Alex