Re: DBCP datasource works on 5.0.28 but fails on 5.5.9

2005-05-23 Thread Lutz Zetzsche
Hi Steve,

Am Montag, 23. Mai 2005 00:39 schrieb Steve Kirk:
 I started replying to yr post including my full config, had nearly
 finished, then saw the problem - I had a leading space in the 'url'
 value within the Resource tag of my context.xml file.  Grrr!  I

[...]

 Thanks very much to both of you for your patient help.  Without your
 prompting, I was ready to start first thing Monday by writing off 3
 days' upgrade effort by rolling back to 5.0.28, but now tomorrow is
 now looking like being productive :)

Great. :-) So, your new favourite song is I like Mondays!. ;-)

It would have been annoying to downgrade back, having lost all the time 
and knowing that you have to upgrade sometime again nevertheless. Typing 
errors are the worst errors to find as everything seems to be right, 
but what is thought to be right doesn't work.

So you can now finally have joy. :-)))


Best wishes

Lutz

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



RE: DBCP datasource works on 5.0.28 but fails on 5.5.9

2005-05-22 Thread Steve Kirk

Thanks again Nix, but latest mysql driver is *definitely* in
%catalina_home%\common\lib : 

C:\dir %catalina_home%\common\lib
 Volume in drive C is BOOT
 Volume Serial Number is D4DF-165E

 Directory of c:\jakarta-tomcat-5.5.9\common\lib

19/05/2005  19:25DIR  .
19/05/2005  19:25DIR  ..
11/05/2004  12:5454,829 activation.jar
26/03/2005  14:22   112,341 commons-el.jar
26/03/2005  14:22   918,743 jasper-compiler-jdt.jar
26/03/2005  14:22   383,134 jasper-compiler.jar
26/03/2005  14:2276,664 jasper-runtime.jar
26/03/2005  14:2250,493 jsp-api.jar
12/10/2004  13:20   347,137 mail.jar
14/04/2005  22:44   409,191 mysql-connector-java-3.1.8-bin.jar
26/03/2005  14:22   154,101 naming-factory-dbcp.jar
26/03/2005  14:2236,333 naming-factory.jar
26/03/2005  14:2246,606 naming-resources.jar
26/03/2005  14:2297,693 servlet-api.jar
  12 File(s)  2,687,265 bytes
   2 Dir(s)   2,182,369,280 bytes free



OK, so now I'm struggling.

So I'm going to take a punt and say that I think there may be some kind of
class loading problem.  I say this because:

- I have fresh installed TC, mysql and jdk; 
- mysql works from the command line using my datasource username/pw; 
- I have checked and rechecked my config a thousand times; 
- the mysql driver is in the right folder; 
- the error is suggestive of the fact that TC can't find the driver.

However, the driver it is there in the common/lib folder, plain for anyone
to see.  I can only assume this is to do with security/classloading.  I've
eliminated security, because TC runs as a service under the system account,
and I've checked that this account has read access to the file.

I'm almost tired of looking - if I can't solve it tomorrow, I'll be (very
reluctantly) setting aside TC 5.5 and carrying on with 5.0.28.  I don't want
to do that, because 5.0.28 has some sesssion management bugs I'd like to get
past, and also because I've now spent 3 days trying to make 5.5 work.

So, any help would be most gratefully received :)

Original post here for those that missed it: 
http://marc.theaimsgroup.com/?l=tomcat-userm=111660199623420w=2  

 -Original Message-
 From: Nikola Milutinovic [mailto:[EMAIL PROTECTED] 
 Sent: Saturday 21 May 2005 13:42
 To: Tomcat Users List
 Subject: Re: DBCP datasource works on 5.0.28 but fails on 5.5.9
 
 
 Steve Kirk wrote:
 
 Thanks nix.
 
   
 
 Could it be that you've missed the fact that 
 DataSource JNDI resource setup definition has changed in TC 
 5.5? It is 
 no longer with those 
 parametername.../namevalue.../value/parameter. 
 
 
 
 Yes I already changed that.  I used to use the approach you 
 mention in
 5.0.28, i.e.:
 
  ResourceParams name=jdbc/myResource
  parameter
  nameusername/name
  value.../value
  /parameter
  parameter
  namepassword/name
  value.../value
  /parameter
 
  etc
 
  /ResourceParams
 
 But noticed that the new 5.5 DBCP example used this approach:
 
 Resource username= password=...  etc /
 
 So I switched to that, but still no joy.
 
 PS does it actually say in the docs anywhere that the
 parametername.../namevalue.../value/parameter 
 approach is *NOT*
 valid in 5.5?  If so then I've missed some docs somewhere, 
 maybe there is
 other new stuff that I haven't seen.
   
 
 
 It definitely does not work in 5.5. I've used the config from 
 the docs 
 page with PostgreSQL and it worked. Other possible problem is 
 that the 
 driver class didn't load. Where have you placed the JDBC JAR? It goes 
 either in ${CATALINA_HOME}/common/lib since it must be 
 accessable to TC.
 
 Nix.
 
 -
 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]



Re: DBCP datasource works on 5.0.28 but fails on 5.5.9

2005-05-22 Thread Lutz Zetzsche
Hi Steve,

Am Sonntag, 22. Mai 2005 22:58 schrieb Steve Kirk:
 Thanks again Nix, but latest mysql driver is *definitely* in
 %catalina_home%\common\lib :

Did you check that the MySQL driver is only there and not additionally 
in a second directory, i.e. WEB-INF/lib, which could confuse Tomcat?


 - mysql works from the command line using my datasource username/pw;

Are you really using the correct URL to connect to the database? Are 
host name, port and database name ok? I.e. the database name is 
case-sensitive (at least on Linux, check it on Windows)!

Are you running Tomcat with Security Manager? Then you may have missed 
to set the necessary security rules for connecting.


 I'm almost tired of looking - if I can't solve it tomorrow, I'll be
 (very reluctantly) setting aside TC 5.5 and carrying on with 5.0.28. 
 I don't want to do that, because 5.0.28 has some sesssion management
 bugs I'd like to get past, and also because I've now spent 3 days
 trying to make 5.5 work.

Perhaps you can post your exact configuration here, anonymizing user and 
password values. What did you configure where? I.e. where is the 
context file in which you did the relevant entry? Etc.


Bet wishes

Lutz

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



RE: DBCP datasource works on 5.0.28 but fails on 5.5.9

2005-05-22 Thread Steve Kirk
Lutz,

I started replying to yr post including my full config, had nearly finished,
then saw the problem - I had a leading space in the 'url' value within the
Resource tag of my context.xml file.  Grrr!  I must have included it by
accident when converting from the nested
ResourceParamsparameter/parameter/ResourceParams approach used in
TC5.0 to the single Resource/ tag approach favoured in TC5.5.

So basically Nix was right in his first post...

Thanks very much to both of you for your patient help.  Without your
prompting, I was ready to start first thing Monday by writing off 3 days'
upgrade effort by rolling back to 5.0.28, but now tomorrow is now looking
like being productive :)

 -Original Message-
 From: Lutz Zetzsche [mailto:[EMAIL PROTECTED] 
 Sent: Sunday 22 May 2005 22:42
 To: Tomcat Users List
 Subject: Re: DBCP datasource works on 5.0.28 but fails on 5.5.9
 
 
 Hi Steve,
 
 Am Sonntag, 22. Mai 2005 22:58 schrieb Steve Kirk:
  Thanks again Nix, but latest mysql driver is *definitely* in
  %catalina_home%\common\lib :
 
 Did you check that the MySQL driver is only there and not 
 additionally 
 in a second directory, i.e. WEB-INF/lib, which could confuse Tomcat?
 
 
  - mysql works from the command line using my datasource username/pw;
 
 Are you really using the correct URL to connect to the database? Are 
 host name, port and database name ok? I.e. the database name is 
 case-sensitive (at least on Linux, check it on Windows)!
 
 Are you running Tomcat with Security Manager? Then you may 
 have missed 
 to set the necessary security rules for connecting.
 
 
  I'm almost tired of looking - if I can't solve it tomorrow, I'll be
  (very reluctantly) setting aside TC 5.5 and carrying on 
 with 5.0.28. 
  I don't want to do that, because 5.0.28 has some sesssion management
  bugs I'd like to get past, and also because I've now spent 3 days
  trying to make 5.5 work.
 
 Perhaps you can post your exact configuration here, 
 anonymizing user and 
 password values. What did you configure where? I.e. where is the 
 context file in which you did the relevant entry? Etc.
 
 
 Bet wishes
 
 Lutz
 
 -
 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]



Re: DBCP datasource works on 5.0.28 but fails on 5.5.9

2005-05-21 Thread Nikola Milutinovic

Steve Kirk wrote:


Thanks nix.

 

Could it be that you've missed the fact that 
DataSource JNDI resource setup definition has changed in TC 
5.5? It is 
no longer with those 
parametername.../namevalue.../value/parameter. 
   



Yes I already changed that.  I used to use the approach you mention in
5.0.28, i.e.:

ResourceParams name=jdbc/myResource
parameter
nameusername/name
value.../value
/parameter
parameter
namepassword/name
value.../value
/parameter

etc

/ResourceParams

But noticed that the new 5.5 DBCP example used this approach:

Resource username= password=...  etc /

So I switched to that, but still no joy.

PS does it actually say in the docs anywhere that the
parametername.../namevalue.../value/parameter approach is *NOT*
valid in 5.5?  If so then I've missed some docs somewhere, maybe there is
other new stuff that I haven't seen.
 



It definitely does not work in 5.5. I've used the config from the docs 
page with PostgreSQL and it worked. Other possible problem is that the 
driver class didn't load. Where have you placed the JDBC JAR? It goes 
either in ${CATALINA_HOME}/common/lib since it must be accessable to TC.


Nix.

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



Re: DBCP datasource works on 5.0.28 but fails on 5.5.9

2005-05-20 Thread Nikola Milutinovic
Steve Kirk wrote:
When TC starts up, the webapp deploys OK from its war file, and the
context.xml is copied to the /conf/[engine]/[host]/ folder OK, without any
parsing errors logged.  The connection pool initially seems to work, in the
sense that this code executes OK: 
	Context ctx = new InitialContext();
	String resourceString = java:comp/env/jdbc/ +
config.getString(ConfigConstants.JNDI_DATABASE_RESOURCE_NAME);
	DataSource pool = (DataSource)ctx.lookup(resourceString);

However, an Exception is thrown the first time that I do this: 
	Connection conn = pool.getConnection();
 

This doens't mean much. You will get a DBCP object event if connection 
data is wrong. It will however fail on attempting to obtain a 
connection. In my oppinion it would be nice if it failed during web app 
deployment, thus not leading us to believe all is OK. Although it would 
be yet another source of frustration. And I can see an argument that 
failing to correctly setup a DataSource should not invalidate the entire 
web app, since it could be setup with N DataSources and inteligence to 
choose one that works.

-
Exception caught when establishing/testing database pool
cause[0]: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'
 

This most commonly means that the definition of the DataSource resource 
lacks driver definition. Could it be that you've missed the fact that 
DataSource JNDI resource setup definition has changed in TC 5.5? It is 
no longer with those 
parametername.../namevalue.../value/parameter. Check it out.

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


Re: DBCP datasource works on 5.0.28 but fails on 5.5.9

2005-05-20 Thread Lutz Zetzsche
Hi,

Am Freitag, 20. Mai 2005 17:22 schrieb Nikola Milutinovic:
 Steve Kirk wrote:
 This most commonly means that the definition of the DataSource
 resource lacks driver definition. Could it be that you've missed the
 fact that DataSource JNDI resource setup definition has changed in TC
 5.5? It is no longer with those
 parametername.../namevalue.../value/parameter. Check it
 out.

This is exactly what I would guess, too. From Tomcat 5.0 to 5.5, the 
Resource element syntax has changed. It is now like:

Resource
name=...
auth=Container
type=javax.sql.DataSource
driverClassName=...
url=jdbc:...
username=...
password=...
maxActive=20
maxIdle=10
maxWait=-1

removeAbandoned=true
removeAbandonedTimeout=300
logAbandoned=true /


Best wishes

Lutz

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



RE: DBCP datasource works on 5.0.28 but fails on 5.5.9

2005-05-20 Thread Steve Kirk
Thanks nix.

 Could it be that you've missed the fact that 
 DataSource JNDI resource setup definition has changed in TC 
 5.5? It is 
 no longer with those 
 parametername.../namevalue.../value/parameter. 

Yes I already changed that.  I used to use the approach you mention in
5.0.28, i.e.:

ResourceParams name=jdbc/myResource
parameter
nameusername/name
value.../value
/parameter
parameter
namepassword/name
value.../value
/parameter

etc

/ResourceParams

But noticed that the new 5.5 DBCP example used this approach:

Resource username= password=...  etc /

So I switched to that, but still no joy.

PS does it actually say in the docs anywhere that the
parametername.../namevalue.../value/parameter approach is *NOT*
valid in 5.5?  If so then I've missed some docs somewhere, maybe there is
other new stuff that I haven't seen.



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



RE: DBCP datasource works on 5.0.28 but fails on 5.5.9

2005-05-20 Thread Steve Kirk

Thanks lutz, that's in fact exactly how I now have it.  I have also deleted
the webapp (and the context xml file under /conf) and recompiled/restarted,
to make sure the new context config is loaded, but still no joy.

 -Original Message-
 From: Lutz Zetzsche [mailto:[EMAIL PROTECTED] 
 Sent: Friday 20 May 2005 16:59
 To: Tomcat Users List
 Subject: Re: DBCP datasource works on 5.0.28 but fails on 5.5.9
 
 
 Hi,
 
 Am Freitag, 20. Mai 2005 17:22 schrieb Nikola Milutinovic:
  Steve Kirk wrote:
  This most commonly means that the definition of the DataSource
  resource lacks driver definition. Could it be that you've missed the
  fact that DataSource JNDI resource setup definition has 
 changed in TC
  5.5? It is no longer with those
  parametername.../namevalue.../value/parameter. Check it
  out.
 
 This is exactly what I would guess, too. From Tomcat 5.0 to 5.5, the 
 Resource element syntax has changed. It is now like:
 
 Resource
 name=...
 auth=Container
 type=javax.sql.DataSource
 driverClassName=...
 url=jdbc:...
 username=...
 password=...
 maxActive=20
 maxIdle=10
 maxWait=-1
 
 removeAbandoned=true
 removeAbandonedTimeout=300
 logAbandoned=true /
 
 
 Best wishes
 
 Lutz



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