-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Jakub,

On 1/28/14, 4:52 PM, Ja kub wrote:
> Hallo
> 
> I try to define database resource in tomcat/conf/context.xml
> 
> <Resource name="jdbc/petclinic" auth="Container" 
> type="javax.sql.DataSource" username="root" password="xxx" 
> driverClassName="net.sf.hajdbc.sql.Driver" 
> url="jdbc:ha-jdbc:cluster-petclinic"/>
> 
> when I put ha-jdbc-3.0.jar into lib directory class 
> net.sf.hajdbc.sql.Driver is found, but when I put
> ha-jdbc-2.0.16.jar into lib directory I get
> 
> Caused by: java.lang.NoClassDefFoundError: Could not initialize
> class net.sf.hajdbc.sql.Driver at java.lang.Class.forName0(Native
> Method) ~[na:1.6.0_37] at java.lang.Class.forName(Class.java:169)
> ~[na:1.6.0_37] at 
> org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1415)
>
> 
~[tomcat-dbcp.jar:7.0.50]
> ... 34 common frames omitted
> 
> 
> although this class for shure is in this jar, and works if jar is
> in my petclinic/WEB-INF/lib
> 
> any idea what can be the cause ?
> 
> my suspision is:
> 
> ha-jdbc-3.0.jar has META-INF/services , and there is
> java.sql.Driver file which contains net.sf.hajdbc.sql.Driver
> 
> ha-jdbc-2.0.16.jar has no META-INF/services
> 
> Is it the cause ? If so, what mechanism is it? But other jars in
> tomcat/lib also don't have META-INF/services.

I can't make head or tail out of all this information you gave.

What do these commands print:

$ unzip -v ha-jdbc-3.0.jar  | grep net.sf.hajdbc.sql.Driver

and

$ unzip -v ha-jdbc-2.0.16.jar  | grep net.sf.hajdbc.sql.Driver

Have you put both JAR files in lib/ at once?

What is a "jar directory class"?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJS6C8AAAoJEBzwKT+lPKRYHJcP/2I23wvcqIjNwsfF2L9xPJdL
FFQDkMPM5bXw+E491wVMAWCCH0tG9expiyOR2fMAJ9ROc+jY/PHsbNOAdh9HE6Ws
VGb6WczOCo+pic+qfppNoJ/UsH6tmOehBWPeCIuPjyXiuHF//Mg+hf5fikC20dsP
+GykNwb2nc7QgdQojsQ2lAPGIb5P6pFlX+bNh4bBrzzQbGCjGSrmE5v7NpypLDSa
dMeHB8PYTnqY6J4sAbER+NAqz1iSHXfileyhISoikjzrZkqcrEZhgfcepuf+1H9K
sZ6tlH80to/w7hiY1R6KhT8h1uEAjBr3bTHjzgXsOrR5h5ttha6VowWKmfprpXve
b1JQBw+Vhs4DUtGdk48NlJv4FsMdeDNVQM5lIvgyXmndpVoH8MAh8DBKz20ibNqe
PJS+p8QOzsfR3ye0ltUWn7/UskLdZb0WjyZa4TItDVmQajUdB9OIANTnMtvaZ1QW
rdVWM+savu3oBGKp9EQp3KPjCPG/Q06iQzKRRGivrkKunzl7oCDwZ3nrQBj3fA+j
Lh0u4cJKYmn76pLB3NCbQtDX6CCLoR9gVIKdmiZhCtZH+nq7JVx+xGMejpMd5LR7
t0Kagw2S255cQRjIvGJD8mvWWMwd+S+pNNobR7cARFxZJWISXgJ4UdMXzBkwWzVE
MzLNDtBCDrnNxbMAN45q
=TWY8
-----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