Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring jdbc:embedded-database not able to access jdbc driver on JBoss AS 7

I'm using Spring's <jdbc:embedded> to run integration and acceptance tests using HSQLDB. If I include the hsqldb.jar on the application's classpath then everything works but moving the driver to JBoss as a module I get the following exception:

PropertyAccessException 1: org.springframework.beans.MethodInvocationException: 
Property 'databaseType' threw exception; 
nested exception is java.lang.IllegalStateException: 
Driver for test database type [HSQL] is not available in the classpath

JBoss can see the driver as I can configure a datatsource on JBoss using the it but can't figure out why it's not on my application classpath. Are jdbc drivers only available through a configured datasource on Jboss or is there something else i need to do to make it available?

like image 320
blank Avatar asked Oct 08 '22 09:10

blank


1 Answers

I had same problem in using Spring's but with H2 database. There are 2 possibilities, you can put the corresponding .jar to your database in the lib folder of your server. Or you can put it in your webApp. i have chosen the latest possibility, so i put this dependency in my pom.xml:

<dependency>
   <groupId>com.h2database</groupId>
   <artifactId>h2</artifactId>
   <version>XXXXXX</version>

like image 62
gibers Avatar answered Oct 13 '22 02:10

gibers