struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Birch <ch...@artlas.net>
Subject Re: findDataSource
Date Fri, 30 Nov 2001 23:35:30 GMT
Tim,

I'm running MacOS X, Tomcat 4 too but with postgres RDBMS.  My 
datasource set-up in Struts config is diiferent though, I see yours is 
the same as the example given in the struts-example.  I lifted mine from 
the user guide and it works just fine.

   <data-sources>
     <data-source
         autoCommit="false"
         description="Data Source Configuration"
         driverClass="org.postgresql.Driver"
         maxCount="6"
         minCount="2"
         password="password"
         url="jdbc:postgresql://127.0.0.1:5432/myDB"
         user="user"
     />
   </data-sources>

I don't know which is valid or if they both should work.  (Still getting 
to grips with Struts1.0 so could be a feature of 1.1?).

Regards,
Chris.

On Friday, November 30, 2001, at 11:24  pm, Tim wrote:

> Here's my setup:
> MacOS X
> Tomcat 4 (but also happens with orion)
> MySQL 3.23.43
>
>     <data-sources>
>       <data-source>
>         <set-property property="driverClass" 
> value="org.gjt.mm.mysql.Driver" />
>         <set-property property="password" value="root" />
>         <set-property property="user" value="root" />
>         <set-property property="url" 
> value="jdbc:mysql://127.0.0.1:3306/eds" />
>       </data-source>
>     </data-sources>
>
> Everything works fine, until I run the following piece of code:
>
>       DataSource dataSource = servlet.findDataSource(null);
>       Connection conn = dataSource.getConnection();
>
> findDataSource gives me this error:
>
> 	java.lang.NullPointerException
>
> I presume it can't find the datasource. Howevere, I know that the mm 
> driver is working fine and it can contact the database, since the 
> application is at least able to startup.
>
> Can anyone figure out what's happening?
> --
> --
> To unsubscribe, e-mail:   <mailto:struts-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-user-
> help@jakarta.apache.org>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message