We are running a porject in Eclipse and use Wildfly as webserver. We have configurated wildfly and created a new mysql datasource that works. We have created a database and a new Connection in Eclipse to the database and created entities using the url provided by Wildfly. So Everything is good this far.
The problem we have now is that when we run the application and try to persist an entity we get an error saying "Caused by: org.h2.jdbc.JdbcSQLException: Table "USER" not found; SQL statement..."
After gooling it we found out that we have to alter the standalone.xml and did so.
<datasource jta="false" jndi-name="java:jboss/fakebook" pool-name="mysql" enabled="true" use-ccm="false">
<connection-url>jdbc:mysql://localhost:3306/fakebook</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>mysql</driver>
<security>
<user-name>root</user-name>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
<statement>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
<drivers>
<driver name="com.mysql" module="mysql.mysql-connector-java">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
<driver name="mysql" module="org.mysql">
<driver-class>com.mysql.jdbc.Driver</driver-class>
</driver>
</drivers>
Restarted the server but got the same problem with the same exception. When we opened standalone it had changed back to default value:
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="mysql" module="org.mysql">
<driver-class>com.mysql.jdbc.Driver</driver-class>
</driver>