0 Replies Latest reply on Jan 28, 2006 4:11 PM by shrummy_1980

    JBoss does not use specified MySQL DB

    shrummy_1980

      I am using JBoss AS 4.0.3 SP1 and I want the AS to use a MySQL DB for a certain application.

      When starting JBoss it recognizes the DB correctly:

      [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=MySQLDS' to JNDI name 'java:MySQLDS'


      When deploying my application, the server recognizes my persistence.xml and my hibernate.properties files. But it seems, it does not apply them:

      [Ejb3Deployment] Found persistence.xml file in EJB3 jar
      ...
      [Environment] Hibernate 3.1
      [Environment] loaded properties from resource hibernate.properties: {hibernate.cglib.use_reflection_optimizer=true, hibernate.dialect=org.hibernate.dialect.MySQLDialect, hibernate.connection.datasource=java:/MySQLDS, hibernate.hbm2ddl.auto=create}
      ...
      [InjectedDataSourceConnectionProvider] Using provided datasource
      [SettingsFactory] RDBMS: HSQL Database Engine, version: 1.8.0
      [SettingsFactory] JDBC driver: HSQL Database Engine Driver, version: 1.8.0
      [Dialect] Using dialect: org.hibernate.dialect.HSQLDialect


      This is my persistence.xml file:

      <persistence>
       <persistence-unit name="manager1">
       <jta-data-source>java:/MySQLDS</jta-data-source>
       <properties>
       <property name="hibernate.connection.datasource" value="java:/MySQLDS" />
       <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
       <property name="hibernate.hbm2ddl.auto" value="create"/>
       </properties>
       </persistence-unit>
      </persistence>


      And this is the hibernate.properties file:

      hibernate.hbm2ddl.auto=create
      hibernate.connection.datasource=java:/MySQLDS
      hibernate.dialect=org.hibernate.dialect.MySQLDialect


      Can somebody tell me, what I am doing wrong?