Hi,
I'm facing a very strange problem trying to install OpenEdit as a WAR
archive.
If I extract it under the main server webapps directory, it works fine.
But the application is for only one customer, so I need to get it
working under a virtual website.
It's a Windows box (Yes, I hate it too ;-) ) running Plesk with Tomcat
and JRE 1.5. Using the Plesk interface, installing WAR archives is very
simple. When I try to install the OpenEdit WAR archive under any user
account/virtual site, I get the following error (From TomCat's log):
------------------------------------------------------------------------
INFO: Deploying web application archive cms.war
Aug 14, 2006 12:56:56 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Exception starting filter OEFilter
java.lang.NullPointerException
at java.io.File.<init>(Unknown Source)
at com.openedit.servlet.OpenEditFilter.init(OpenEditFilter.java:85)
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:225)
at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:308)
at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:79)
at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3502)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4071)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:755)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:777)
at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:672)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1142)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:292)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1293)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1553)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1562)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1542)
at java.lang.Thread.run(Unknown Source)
------------------------------------------------------------------------
Tracing back the problem, I guess it is related to this:
------------------------------------------------------------------------
String rootPath = servletContext.getRealPath("/");
BaseWebServer server = new BaseWebServer();
server.setRootDirectory(new File(rootPath)); <== LINE 85
------------------------------------------------------------------------
Looks like under a virtual host, getRealPath("/") is returning NULL, so
when the variable is used on LINE 85 the exception is raised.
These lines comes from a compiled .class archive, so changing the code
is somehow out of question.
Is there anything that I can try to do in the TomCat's configuration
files to get it working, without having to try to decompile and
recompile the code ?
Thanks in advance,
Antonio