I run roller unpacked via an Eclipse project using WST and deployed to Tomcat 
all the time.

-----Original Message-----
From: mclovis [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 04, 2008 11:17 AM
To: [email protected]
Subject: RE: Roller as unPacked war


Nathan,
  This is in org.apache.roller.weblogger.ui.core 
 RollerContext

That was my original point. 
if you change the code to check for a null reference (because this class is
seemingly trying to anticipate roller properties), it then does not bomb and
you can use the roller-custom.properties to set values OUTSIDE of the war.
However Dave has noted that he has ran roller as an UNPACKED war with no
code changes and no difficulties. So I am a little baffled. I am not a
developer on roller and therefore am not familiar with all the code base. 



Nathan Beyer (Cerner) wrote:
> 
> Where is this at in the codebase? Without knowing much of the context,
> that's not the best way to determine the 'context path', as it is possible
> for null be returned, though according to the javadoc, that generally only
> happens when the WAR isn't unpacked [1]. If you want the 'context path',
> generally you use 'getContextPath' [2], but I don't know exactly what this
> code is attempting to do. As I understand 'getRealPath', the intent is to
> get a OS-specific/filesystem-specific path to a resource, which is why the
> code below uses 'File.separator'. For example, you might pass
> "WEB-INF/web.xml" and it would return
> "/opt/tomcat/webapps/myapp/WEB-INF/web.xml" on a linux deploy.
> 
> -Nathan
> 
> [1]
> http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String)
> [2]
> http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html#getContextPath()
> 
> 
> -----Original Message-----
> From: mclovis [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 04, 2008 10:40 AM
> To: [email protected]
> Subject: Re: Roller as unPacked war
> 
> 
> Dave,
>   RollerContext without being modified looks like the following
> 
> 
>         
>         // get the *real* path to <context>/resources
>         String ctxPath= servletContext.getRealPath("/");
>         //log.info(ctxPath);
>         if(!ctxPath.endsWith(File.separator))
>             ctxPath += File.separator + "resources";
>         else
>             ctxPath += "resources";
> 
> And ctxPath in an unPacked War returns null and the String test .endsWith
> results in an NullPointerException. This can be found in catalina.out when
> ran with Tomcat. It will not run properly for me then. Am I missing
> something?
> 
> 
> 
> 
> 
> Dave Johnson-8 wrote:
>> 
>> On Mon, Aug 4, 2008 at 9:51 AM, mclovis <[EMAIL PROTECTED]> wrote:
>>>
>>> Does anyone know has any thought been given to running roller as an
>>> unPacked
>>> war. If you changed the code in RollerContext as follows:
>>>
>>>  String ctxPath ="";
>>>
>>>        // get the *real* path to <context>/resources
>>>        ctxPath= servletContext.getRealPath("/");
>>>
>>> It will allow it to run until other issues arise.
>>>
>>> I need to see if this option has been explored before.
>> 
>> I'm able to run Roller as a WAR or as an unpacked WAR without any code
>> changes.
>> 
>> Perhaps you are running into some other problem?
>> 
>> - Dave
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Roller-as-unPacked-war-tp18811688s12275p18813719.html
> Sent from the Roller - User mailing list archive at Nabble.com.
> 
> ----------------------------------------------------------------------
> CONFIDENTIALITY NOTICE This message and any included attachments are from
> Cerner Corporation and are intended only for the addressee. The
> information contained in this message is confidential and may constitute
> inside or non-public information under international, federal, or state
> securities laws. Unauthorized forwarding, printing, copying, distribution,
> or use of such information is strictly prohibited and may be unlawful. If
> you are not the addressee, please promptly delete this message and notify
> the sender of the delivery error by e-mail or you may call Cerner's
> corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Roller-as-unPacked-war-tp18811688s12275p18814476.html
Sent from the Roller - User mailing list archive at Nabble.com.

Reply via email to