-----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

Reply via email to