On Wed, Aug 11, 2004 at 08:07:36PM -0000, [EMAIL PROTECTED] wrote:
> jlaskowski    2004/08/11 16:07:36
> 
>   Modified:    modules/core/src/java/org/openejb/resource/jdbc
>                         JdbcManagedConnectionFactory.java
>   Log:
> 
>   Avoid NullPointerException when openejb.home is not set (Ensure 
> http://www.theserverside.com/articles/article.tss?l=ContainerDrivenTestingSeries&page=part2
>  proper execution)
>   
>            java.sql.Connection physicalConn;
>            String userDir = System.getProperty("user.dir");
>            try{
>   -            System.setProperty("user.dir",System.getProperty("openejb.home"));
>   +            // @TODO: Why is it done?
>   +            String openejbHome = System.getProperty("openejb.home");
>   +            if (openejbHome != null) {
>   +                System.setProperty("user.dir", openejbHome);
>   +            }
>                physicalConn = DriverManager.getConnection(jdbcUrl, 
> rxInfo.getUserName(), rxInfo.getPassword());        
>            }catch(java.sql.SQLException sqlE){

This is because InstantDB uses a relative filepath in its JDBC URL for
locating the InstantDB config file.  Castor does the same thing with
it's mapping.xml.  When those resources are loaded, we need to make
sure we are "relative" to the openejb.home directory where the actual
files are located.

-David

Reply via email to