Hello,
I tried the "Java EE Process Applications" (
http://goo.gl/0nEzS8) tutorial which worked fine. But I had problems to use my own H2 database in this environment. In the tutorial the camunda database ProcessEngine is used with this persistence.xml:
-->
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="
http://java.sun.com/xml/ns/persistence" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="primary">
<jta-data-source>java:jboss/datasources/ProcessEngine</jta-data-source>
<properties>
<!-- Properties for Hibernate -->
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="true" />
</properties>
</persistence-unit>
</persistence>
<--
I tried now to use my own database with this persistence.xml:
-->
<?xml version="1.0" encoding="UTF-8"?>
<persistence
xmlns="
http://java.sun.com/xml/ns/persistence"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="tickets">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.connection.driver_class" value="org.h2.Driver" />
<property name="hibernate.connection.url" value="jdbc:h2:~/my-app-h2db"/>
<property name="hibernate.connection.username" value="sa" />
<property name="hibernate.connection.password" value="" />
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false"/>
</properties>
</persistence-unit>
</persistence>
<--
But this results in many errors when I try to deploy. I think the central errors are:
-->
Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: Specified JDBC Driver org.h2.Driver class not found
[...]
Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: Unable to load class [org.h2.Driver]
[...]
Caused by: java.lang.ClassNotFoundException: Could not load requested class : org.h2.Driver
<--
But I checked... the driver jar "h2-1.3.160.jar" is in "/Maven Dependencies" in my maven project.
So can you help me what I did wrong?
Many thanks!