2 Replies Latest reply on Nov 21, 2007 4:16 PM by Ronald van Kuijk

    Hibernate Dialect -must be explicitly set

    Anamica rama Newbie

      Hi,
      While trying to deploy the par file from eclipse3.1 (using JBPM 3.0.2), i am getting the exception as


      [deploypar] 15:34:47,129 [main] INFO Environment : Hibernate 3.1 beta 3
      [deploypar] 15:34:47,161 [main] INFO Environment : loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=org.hsqldb.jdbcDriver, hibernate.cglib.use_reflection_optimizer=true, hibernate.c3p0.max_size=3, hibernate.dialect=org.hibernate.dialect.HSQLDialect, hibernate.c3p0.min_size=1, hibernate.connection.username=sa, hibernate.connection.url=jdbc:hsqldb:hsql://localhost:9001;sql.enforce_strict_size=true, hibernate.show_sql=true, hibernate.connection.password=****}
      [deploypar] 15:34:47,161 [main] INFO Environment : using CGLIB reflection optimizer
      [deploypar] 15:34:47,176 [main] INFO Environment : using JDK 1.4 java.sql.Timestamp handling
      [deploypar] 15:34:47,442 [main] INFO Configuration : configuring from resource: hibernate.cfg.xml
      [deploypar] 15:34:47,457 [main] INFO Configuration : Configuration resource: hibernate.cfg.xml
      [deploypar] 15:34:47,692 [main] INFO Configuration : Reading mappings from resource: org/jbpm/identity/User.hbm.xml
      [deploypar] 15:34:48,082 [main] INFO HbmBinder : Mapping class: org.jbpm.identity.User -> JBPM_ID_USER
      -------
      ---------
      ----------

      15:34:51,378 [main] INFO Configuration : processing foreign key constraints
      [deploypar] 15:34:51,612 [main] WARN UserSuppliedConnectionProvider : No connection properties specified - the user must supply JDBC connections
      [deploypar] org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
      [deploypar] at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
      [deploypar] at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
      [deploypar] at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:378)
      [deploypar] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:110)
      [deploypar] at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1797)
      [deploypar] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1125)
      [deploypar] at org.jbpm.db.JbpmSessionFactory.buildSessionFactory(JbpmSessionFactory.java:138)
      [deploypar] at org.jbpm.db.JbpmSessionFactory.(JbpmSessionFactory.java:77)
      [deploypar] at org.jbpm.ant.AntTaskJbpmSessionFactory.createJbpmSessionFactory(AntTaskJbpmSessionFactory.java:77)
      [deploypar] at org.jbpm.ant.AntTaskJbpmSessionFactory.getJbpmSessionFactory(AntTaskJbpmSessionFactory.java:38)
      [deploypar] at org.jbpm.ant.DeployParTask.execute(DeployParTask.java:32)
      [deploypar] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      [deploypar] at org.apache.tools.ant.Task.perform(Task.java:364)
      [deploypar] at org.apache.tools.ant.Target.execute(Target.java:341)
      [deploypar] at org.apache.tools.ant.Target.performTasks(Target.java:369)
      [deploypar] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
      [deploypar] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
      [deploypar] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
      [deploypar] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
      [deploypar] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
      [deploypar] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
      [deploypar] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
      [deploypar] couldn't create JbpmSessionFactory: Hibernate Dialect must be explicitly set
      [deploypar] at org.jbpm.ant.AntTaskJbpmSessionFactory.createJbpmSessionFactory(AntTaskJbpmSessionFactory.java:81)
      [deploypar] at org.jbpm.ant.AntTaskJbpmSessionFactory.getJbpmSessionFactory(AntTaskJbpmSessionFactory.java:38)
      [deploypar] at org.jbpm.ant.DeployParTask.execute(DeployParTask.java:32)
      [deploypar] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      [deploypar] at org.apache.tools.ant.Task.perform(Task.java:364)
      [deploypar] at org.apache.tools.ant.Target.execute(Target.java:341)
      [deploypar] at org.apache.tools.ant.Target.performTasks(Target.java:369)
      [deploypar] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
      [deploypar] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
      [deploypar] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
      [deploypar] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
      [deploypar] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
      [deploypar] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
      [deploypar] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)



      I verified the hibernate.properties. it contains,

      hibernate.dialect=org.hibernate.dialect.HSQLDialect


      also the hibernate.cfg.xml contains

      <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>



      Can anyone help me to resolve the above issue.

      Thanks,
      Anamica

        • 1. Re: Hibernate Dialect -must be explicitly set
          kushal Karanjkar Newbie

          Hello all ,

          I am getting following error .. .when I try to run my EJB application ..

          I am using Jboss 4.0.4 , neatbeans 5.5 and mysql5 ..


          ObjectName: persistence.units:ear=simplyRent.ear,jar=simplyRent-ejb.jar,unitName=simplyRent-ejbPU
          State: FAILED
          Reason: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
          I Depend On:
          jboss.jca:service=ManagedConnectionFactory,name=MySqlDS
          Depends On Me:
          jboss.j2ee:ear=simplyRent.ear,jar=simplyRent-ejb.jar,name=LocationMasterFacade,service=EJB3
          jboss.j2ee:ear=simplyRent.ear,jar=simplyRent-ejb.jar,name=LocationMasterMessage,service=EJB3

          ObjectName: jboss.j2ee:ear=simplyRent.ear,jar=simplyRent-ejb.jar,name=LocationMasterFacade,service=EJB3
          State: NOTYETINSTALLED
          I Depend On:
          persistence.units:ear=simplyRent.ear,jar=simplyRent-ejb.jar,unitName=simplyRent-ejbPU

          ObjectName: jboss.j2ee:ear=simplyRent.ear,jar=simplyRent-ejb.jar,name=LocationMasterMessage,service=EJB3
          State: NOTYETINSTALLED
          I Depend On:
          persistence.units:ear=simplyRent.ear,jar=simplyRent-ejb.jar,unitName=simplyRent-ejbPU

          --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
          ObjectName: persistence.units:ear=simplyRent.ear,jar=simplyRent-ejb.jar,unitName=simplyRent-ejbPU
          State: FAILED
          Reason: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
          I Depend On:
          jboss.jca:service=ManagedConnectionFactory,name=MySqlDS
          Depends On Me:
          jboss.j2ee:ear=simplyRent.ear,jar=simplyRent-ejb.jar,name=LocationMasterFacade,service=EJB3
          jboss.j2ee:ear=simplyRent.ear,jar=simplyRent-ejb.jar,name=LocationMasterMessage,service=EJB3

          ObjectName: jboss.jca:service=DataSourceBinding,name=DefaultDS
          State: NOTYETINSTALLED
          Depends On Me:
          jboss.ejb:service=EJBTimerService,persistencePolicy=database
          jboss.mq:service=StateManager
          jboss.mq:service=PersistenceManager



          My Mysql_ds.xml file is
          <?xml version="1.0" encoding="UTF-8"?>

          <!-- $Id: mysql-ds.xml 63175 2007-05-21 16:26:06Z rrajesh $ -->
          <!-- Datasource config for MySQL using 3.0.9 available from:
          http://www.mysql.com/downloads/api-jdbc-stable.html
          -->


          <local-tx-datasource>
          <jndi-name>MySqlDS</jndi-name>
          <connection-url>jdbc:mysql://localhost:3306/rentdb</connection-url>
          <driver-class>com.mysql.jdbc.Driver</driver-class>
          <user-name>root</user-name>
          root
          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
          <!-- should only be used on drivers after 3.22.1 with "ping" support
          <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
          -->
          <!-- sql to call when connection is created
          <new-connection-sql>some arbitrary sql</new-connection-sql>
          -->
          <!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers
          <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
          -->

          <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->

          <type-mapping>mySQL</type-mapping>

          </local-tx-datasource>



          My persistence.xml is
          <?xml version="1.0" encoding="UTF-8"?>
          <persistence version="1.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_1_0.xsd">
          <persistence-unit name="simplyRent-ejbPU" transaction-type="JTA">
          org.hibernate.ejb.HibernatePersistence
          <jta-data-source>MySqlDS</jta-data-source>
          ejb.user.UserMaster
          ejb.LocationMaster



          </persistence-unit>


          and my Jboss-ds.xml is

          <?xml version="1.0" encoding="UTF-8"?>

          <local-tx-datasource>
          <jndi-name>MySqlDS</jndi-name>
          <connection-url>jdbc:mysql://localhost:3306/rentdb</connection-url>
          <driver-class>com.mysql.jdbc.Driver</driver-class>
          <user-name>root</user-name>
          root
          <min-pool-size>5</min-pool-size>
          <max-pool-size>20</max-pool-size>
          <idle-timeout-minutes>5</idle-timeout-minutes>
          </local-tx-datasource>




          Could any body tell me wht is going wrong here ...
          I am not able to connect to mysql database while running




          • 2. Re: Hibernate Dialect -must be explicitly set
            Ronald van Kuijk Master

            wrong forum, this has nothing to do with jBPM, try e.g. the JBoss AS forum