Thanks for your patch. I will integrate it soon. One problem with your approach: The 
root directory is not a good choice for the
default value. 
I will change it so the the realPath will be null if you send a null value.

Regards,
Henner

> -----Urspr�ngliche Nachricht-----
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Im 
> Auftrag von Gutwin, Tom
> Gesendet: Donnerstag, 12. Februar 2004 00:32
> An: '[EMAIL PROTECTED]'
> Betreff: [dbforms] null pointer thrown when using dbForms in a war
> 
> 
> Hi,
> 
> 1st off... Fantastic implementation! You nailed it. I just
> started using dbForms today and like it alot. Your user guide 
> was good.
> 
> 
> One thing I ran into as I was configuring my web app to use
> dbForms was a null pointer thrown by my app server (jetty 4.2 
> on win2000) when I first loaded a dbForm page. dbForms 
> version:dbforms_2.0_20040124
> 
> It was showed up as a error message to the effect that the
> FileServlet could not get 
> the config object [dbformsConfig].
> 
> After further investigation I tracked it down to the fact that
> when ConfigServlet.initXMLConfigFile attempted to obtain a 
> real path for the web app.
> 
> String realPath = getServletContext().getRealPath("/");
> 
> This call returned a null because my webapp was in a war file
> and could not get an 
> actual path.
> 
> This null ended up being passed to DbFormsConfig.setRealPath(String
> realPath)
> end threw the NPE.
> 
> I added a check for a null by changing the
> DbFormsConfig.setRealPath(String
> realPath) 
> to the following:
> 
>    /**
>     *  Sets the realPath.
>     *
>     * @param realPath The realPath to set
>     */
>    public void setRealPath(String realPath)
>    {
>      System.out.println("\n\nDbFormsConfig.setRealPath
> realPath="+realPath);
> 
>      if (realPath != null && !realPath.equals(""))
>        this.realPath = realPath.replace('\\', '/');
>      else
>        realPath = "/";
>    }
> 
> 
> It fixed the problem.
> Now I will build up my app... I will probably have more questions.
> 
> 
> Thanks for building dbForms.
> 
> tom
> --
> ------------------
> Tom Gutwin P.Eng.                       
> Sr. Engineer, System Performance Analysis
> 
> Bentall 4 - 10th floor
> BC Transmission Corporation - BCTC
> Local - 77345      External - 604 699 7345 
> [EMAIL PROTECTED]
> 
> 
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and 
> deploy apps & Web services for Linux with a free DVD software kit from 
> IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438> 
> &op=click
> 
> _______________________________________________
> 
> DbForms Mailing List
> 
http://www.wap-force.net/dbforms



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to