You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by "Glen Mazza (JIRA)" <ji...@apache.org> on 2014/07/09 13:43:05 UTC

[jira] [Resolved] (ROL-1948) getRealPath() null not handled

     [ https://issues.apache.org/jira/browse/ROL-1948?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Glen Mazza resolved ROL-1948.
-----------------------------

    Resolution: Fixed

NPE check put in:
        String ctxPath = servletContext.getRealPath("/");
        if (ctxPath == null) {
            log.fatal("Roller requires an exploded WAR file to run.");
            return;
        }

Still, I could not replicate this issue using Tomcat 7:
A roller.xml with an already exploded roller.war in deplocation worked if I did this in my roller.xml:
<Context path="/roller" docBase="/work/opensource/deplocation"/>

Tomcat would use the exploded WAR from the above folder.

A roller.xml with an unexploded roller.war works with this configuration:
<Context path="" docBase="/work/opensource/deplocation/roller.war"/>

.. in which case Tomcat explodes the WAR into its own webapps directory.

Your situation, of using a roller.war but with the first roller.xml configuration meant for already expanded warfile resulted in Tomcat 7 just ignoring the war and acting like no webapp was available.

> getRealPath() null not handled
> ------------------------------
>
>                 Key: ROL-1948
>                 URL: https://issues.apache.org/jira/browse/ROL-1948
>             Project: Apache Roller
>          Issue Type: Bug
>          Components: Installation & Configuration
>    Affects Versions: 5.0
>            Reporter: Jürgen Weber
>            Assignee: Roller Unassigned
>
> I tryed to deploy the roller war file by putting a roller.xml into conf/Catalina/localhost
> <Context path="/roller" docBase="/roller-weblogger-5.0.1-tomcat/webapp/roller-5.0.1-tomcat"
> Roller dies without any log entries, there is only on the console
> Nov 14, 2012 1:17:40 PM org.apache.catalina.core.StandardContext startInternal
> SEVERE: Error listenerStart
> in logs/localhost.2012-11-14.log there is
> java.lang.NullPointerException
>         at org.apache.roller.weblogger.ui.core.RollerContext.contextInitialized(RollerContext.java:112)
> This is because String ctxPath = servletContext.getRealPath("/"); is null
> and the next line is
>         if(!ctxPath.endsWith(File.separator))
> which results in NPE
> This should be handled.



--
This message was sent by Atlassian JIRA
(v6.2#6252)