SV: Global DataSource

2003-03-12 Thread Fredrik Larsson
Hi again.

I just solved my problem with global datasources in Tomcat.
Instead of putting my  and  in
 (which gave me lot's of
trouble and exceptions) I put it in the 
and removed  from my web.xml.

I don't know if this is a neat solution but hey, it works. :-)

/Fredrik

-Ursprungligt meddelande-----
Från: Fredrik Larsson [mailto:[EMAIL PROTECTED]
Skickat: den 11 mars 2003 14:39
Till: [EMAIL PROTECTED]
Ämne: Global DataSource


Hi all.

I'm trying to set up a global DataSource on my Tomcat 4.1.18 standalone to
be available to all of my applications installed on the server.

But... I just can't get this to work. I've been following the instructions
in the tomcat documentation but it doesn't help.

I can start the server without any problems and view the global datasource
in the Administration Tool but as soon as I'm trying to access the
datasource from a servlet i get the following exception:
java.sql.SQLException: Cannot load JDBC driver class 'null'.

I've tried to set up the datasource for just one application context and
that works... but that's not what I want.

Another thing is that when I'm trying to view the datasources for one
specific application-context that should use this global datasource I get
this exception:
org.apache.jasper.JasperException: Exception retrieving attribute
'driverClassName'

Has anyone got a clue?

Thanks!
/Fredrik


This is what my conf-files look like:

SERVER.XML
  





factory
org.apache.commons.dbcp.BasicDataSourceFactory



maxActive
100



maxIdle
30



maxWait
1



username
myusername


password




driverClassName
org.gjt.mm.mysql.Driver



url
jdbc:mysql://localhost:3306/mydb



  

WEB.XML

DB Connection
jdbc/MyDB
javax.sql.DataSource
Container



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



SV: Global DataSource

2003-03-11 Thread Fredrik Larsson
Hi Pratt.

No, I'm doing the look-up from a utility class used by my Action class
(org.apache.struts.action.Action)

/Fredrik

-Ursprungligt meddelande-
Från: Tomcat-RND [mailto:[EMAIL PROTECTED]
Skickat: den 11 mars 2003 17:55
Till: Tomcat Users List
Ämne: Re: Global DataSource


Hi,

Are looking up the data source in a load-on-startup servlet?

Regards,
Pratt.


- Original Message -
From: "Fredrik Larsson" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, March 11, 2003 9:46 PM
Subject: SV: Global DataSource


> I just tried to install the 4.1.21 beta but it didn't help.
>
> Thanks anyway.
>
> /Fredrik
>
> -Ursprungligt meddelande-
> Från: Klaasjan Brand [mailto:[EMAIL PROTECTED]
> Skickat: den 11 mars 2003 16:26
> Till: Tomcat Users List
> Ämne: Re: Global DataSource
>
>
> On Tue, 2003-03-11 at 14:39, Fredrik Larsson wrote:
> > Hi all.
> > I can start the server without any problems and view the global
datasource
> > in the Administration Tool but as soon as I'm trying to access the
> > datasource from a servlet i get the following exception:
> > java.sql.SQLException: Cannot load JDBC driver class 'null'.
> >
> > I've tried to set up the datasource for just one application context and
> > that works... but that's not what I want.
>
> I had lots of trouble with JNDI datasources too; it seems there's been
> done some work on this:
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16316
>
> I'd try the 4.1.21 beta to see if it still gives trouble...
>
> Klaasjan
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



SV: Global DataSource

2003-03-11 Thread Fredrik Larsson
I just tried to install the 4.1.21 beta but it didn't help.

Thanks anyway.

/Fredrik

-Ursprungligt meddelande-
Från: Klaasjan Brand [mailto:[EMAIL PROTECTED]
Skickat: den 11 mars 2003 16:26
Till: Tomcat Users List
Ämne: Re: Global DataSource


On Tue, 2003-03-11 at 14:39, Fredrik Larsson wrote:
> Hi all.
> I can start the server without any problems and view the global datasource
> in the Administration Tool but as soon as I'm trying to access the
> datasource from a servlet i get the following exception:
> java.sql.SQLException: Cannot load JDBC driver class 'null'.
>
> I've tried to set up the datasource for just one application context and
> that works... but that's not what I want.

I had lots of trouble with JNDI datasources too; it seems there's been
done some work on this:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16316

I'd try the 4.1.21 beta to see if it still gives trouble...

Klaasjan


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Global DataSource

2003-03-11 Thread Fredrik Larsson
Hi all.

I'm trying to set up a global DataSource on my Tomcat 4.1.18 standalone to
be available to all of my applications installed on the server.

But... I just can't get this to work. I've been following the instructions
in the tomcat documentation but it doesn't help.

I can start the server without any problems and view the global datasource
in the Administration Tool but as soon as I'm trying to access the
datasource from a servlet i get the following exception:
java.sql.SQLException: Cannot load JDBC driver class 'null'.

I've tried to set up the datasource for just one application context and
that works... but that's not what I want.

Another thing is that when I'm trying to view the datasources for one
specific application-context that should use this global datasource I get
this exception:
org.apache.jasper.JasperException: Exception retrieving attribute
'driverClassName'

Has anyone got a clue?

Thanks!
/Fredrik


This is what my conf-files look like:

SERVER.XML
  





factory
org.apache.commons.dbcp.BasicDataSourceFactory



maxActive
100



maxIdle
30



maxWait
1



username
myusername


password




driverClassName
org.gjt.mm.mysql.Driver



url
jdbc:mysql://localhost:3306/mydb



  

WEB.XML

DB Connection
jdbc/MyDB
javax.sql.DataSource
Container



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]