You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Antonio F. Tornisiello" <ni...@bavs.com.br> on 2006/08/15 01:32:40 UTC

NullPointerException

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





Re: NullPointerException

Posted by Steve R Burrus <bu...@swbell.net>.
Please forgive my rather "dumb naivete" but what exactly is OpenEdit 
supposed to be anyway? I don't believe that I have ever heard of it 
before!!

Antonio F. Tornisiello wrote:

> 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
>
>
>
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: NullPointerException

Posted by "Antonio F. Tornisiello" <ni...@bavs.com.br>.
Mark,

You seen to have located the problem :D
On the main server the option to unpack WAR files was set to true but 
not in the virtual site section.
It seens to have solved my problem.

Thanks a lot :D
[]'s
Antonio

Mark Thomas wrote:
> This is expected with a WAR file. It looks like the app expects to be
> expanded. Any reason you can't configure it as an expanded WAR?
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: NullPointerException

Posted by Mark Thomas <ma...@apache.org>.
Antonio F. Tornisiello wrote:
> 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.

<snip/>

> Looks like under a virtual host, getRealPath("/") is returning NULL, so
> when the variable is used on LINE 85 the exception is raised.

This is expected with a WAR file. It looks like the app expects to be
expanded. Any reason you can't configure it as an expanded WAR?


> 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 ?

Short of expanding it, there isn't any functionality in Tomcat that
would help you as far as I am aware.

Mark

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org