Re: MariaDB Connector Issues

2015-06-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Nicholas,

On 6/1/15 4:24 PM, Cuneo, Nicholas wrote:
 We’ve been running for a while now using embedded Jetty but due to
 some upcoming infrastructure changes we’re migrating to Tomcat 7.

Migrate to Tomcat 8 instead. It's going to have much longer support
and has some nice new features.

 I’m having an issue getting my servlet to recognize the mariadb 
 connector
 
 *No suitable driver found for jdbc:mariadb://*
 
 * *
 
 This has been running in the past with Jetty, so I haven’t made any
 code changes.  I’ve dropped the mariadb-java-client-1.1.8.jar in
 the tomcathome/lib directory as in my experience in the past this
 was all I needed to do.  However since I’m still getting this
 exception I’m not sure how to debug further.  I’ve tried running
 tomcat with the debug option
 
 *bin/catalina.bat debug *
 
 but I’m not really sure how to  use it properly other than running
 my servlet and viewing the classpath.
 
 Any assistance on the matter would be helpful.
 
 [Update]
 
 Apparently with Tomcat7/8 and Java 7+ (we are using java8) you
 must explicitly add the driver in the code:
 
 Class.forName(org.mariadb.jdbc.Driver).newInstance();
 
 I feel like this is a bug with Tomcat7/8 since after Java 6 this
 was no longer required (and indeed worked in Tomcat5 and 6).
 Anyway, if anyone else runs into that problem they can resolve it.

You should not have to call Class.forName yourself; the connection
pool should be doing this for you.

What does your Resource element look like, and where are you
configuring your DataSource?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVbdVfAAoJEBzwKT+lPKRYM24QAMpNQUav9QKDl9KqkYdKp/0i
jYnSs/6PPmDZJxb1M6yY89LiJ32HQ/HA9e8lyM26wPfIWALjwECDye9keT/lhQjr
qm8PC/Zh8OHAQvNgT3IITOejmAf1cGC3N/KZcLVVSCx2POAq576QGzSLaeXCwlvr
5dLbarttld9YswHDzejGx3GHLN+dywDUfGshFRRgVbStUhrVZCoGSFGkmM4SmXHN
+s3S9i56RLYQMXGY8rQRzt5criyphknrBYRqrjehDiy47gdE5D1v9ZnqTt+HceuK
JP+3PjC9L+JS4tJdf/bvvnoH735eYUt9jCuilohBy/LCwKkVSSQGkhUdTUEqSvgO
vTDss9oYi8D3GOwpKo7HXP4ISAahAGRLhLuEouDyiUf4Ttxun97OXT9IEOUgUQ6x
fInMIVBEFss5SZZs+q2rpfXlFBjyRcYYJBGU9Li+EPU9XuN5YZha73hG8nI64MYA
CDGqNDiwNh2bLAV55M4s7rjtn3WJtME9gIrd8TC8HgPOmT1y1a+ZooOHf3d/DLXM
4zEEASA9smmKiC5UtjInd49r2nOxle04JhTb7hJFqu+GMPIC8ao7vNz/AYRFzKZe
wkidXengZY9iEyZItwCYNLfhr0+Nj0dTgf6NX11G1nzfmgrlGjMiPscfhsSfHKu0
VOPRsa0NP/MNdM6YnqHQ
=FlzG
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



MariaDB Connector Issues

2015-06-01 Thread Cuneo, Nicholas
Hi,

We've been running for a while now using embedded Jetty but due to some 
upcoming infrastructure changes we're migrating to Tomcat 7.  I'm having an 
issue getting my servlet to recognize the mariadb connector
No suitable driver found for jdbc:mariadb://

This has been running in the past with Jetty, so I haven't made any code 
changes.  I've dropped the mariadb-java-client-1.1.8.jar in the tomcathome/lib 
directory as in my experience in the past this was all I needed to do.  However 
since I'm still getting this exception I'm not sure how to debug further.  I've 
tried running tomcat with the debug option
bin/catalina.bat debug
but I'm not really sure how to  use it properly other than running my servlet 
and viewing the classpath.

Any assistance on the matter would be helpful.

Thanks,

Nick Cuneo  /  Software Engineer, Cloud  /  Enterprise Software
Tel: +1 949 517 4802  /  Mobile: +1 949 243 4952
3 Ada  /  Irvine, CA 92618  /  USA
ncu...@tycoint.com  /  www.tyco.com
[cid:image001.png@01D09C6E.3CAA8C50]


This email (including any attachments) may contain information that is private 
or business confidential. If you received this email in error, please delete it 
from your system without copying it and notify sender by reply email so that 
our records can be corrected




This e-mail contains privileged and confidential information intended for the 
use of the addressees named above. If you are not the intended recipient of 
this e-mail, you are hereby notified that you must not disseminate, copy or 
take any action in respect of any information contained in it. If you have 
received this e-mail in error, please notify the sender immediately by e-mail 
and immediately destroy this e-mail and its attachments.


RE: MariaDB Connector Issues

2015-06-01 Thread Cuneo, Nicholas
Apparently with Tomcat7/8 and Java 7+ (we are using java8) you must explicitly 
add the driver in the code:

Class.forName(org.mariadb.jdbc.Driver).newInstance();

I feel like this is a bug with Tomcat7/8 since after Java 6 this was no longer 
required (and indeed worked in Tomcat5 and 6).  Anyway, if anyone else runs 
into that problem they can resolve it.

Thanks,
Nick

From: Cuneo, Nicholas [mailto:ncu...@tycoint.com]
Sent: Monday, June 01, 2015 1:24 PM
To: Tomcat Users List
Subject: MariaDB Connector Issues

Hi,

We've been running for a while now using embedded Jetty but due to some 
upcoming infrastructure changes we're migrating to Tomcat 7.  I'm having an 
issue getting my servlet to recognize the mariadb connector
No suitable driver found for jdbc:mariadb://

This has been running in the past with Jetty, so I haven't made any code 
changes.  I've dropped the mariadb-java-client-1.1.8.jar in the tomcathome/lib 
directory as in my experience in the past this was all I needed to do.  However 
since I'm still getting this exception I'm not sure how to debug further.  I've 
tried running tomcat with the debug option
bin/catalina.bat debug
but I'm not really sure how to  use it properly other than running my servlet 
and viewing the classpath.

Any assistance on the matter would be helpful.

Thanks,

Nick Cuneo  /  Software Engineer, Cloud  /  Enterprise Software
Tel: +1 949 517 4802  /  Mobile: +1 949 243 4952
3 Ada  /  Irvine, CA 92618  /  USA
ncu...@tycoint.commailto:ncu...@tycoint.com  /  
www.tyco.comhttp://www.tyco.com
[cid:image001.png@01D09C6E.3CAA8C50]

This email (including any attachments) may contain information that is private 
or business confidential. If you received this email in error, please delete it 
from your system without copying it and notify sender by reply email so that 
our records can be corrected




This e-mail contains privileged and confidential information intended for the 
use of the addressees named above. If you are not the intended recipient of 
this e-mail, you are hereby notified that you must not disseminate, copy or 
take any action in respect of any information contained in it. If you have 
received this e-mail in error, please notify the sender immediately by e-mail 
and immediately destroy this e-mail and its attachments.



This e-mail contains privileged and confidential information intended for the 
use of the addressees named above. If you are not the intended recipient of 
this e-mail, you are hereby notified that you must not disseminate, copy or 
take any action in respect of any information contained in it. If you have 
received this e-mail in error, please notify the sender immediately by e-mail 
and immediately destroy this e-mail and its attachments.