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.
BR
Jakub