2 Replies Latest reply on Oct 13, 2008 4:16 AM by Christoph K

    Hibernate JBoss 5 javax.persistence.PersistenceException

    Christoph K Newbie

      Hello, I am using JBoss 5.0.0. CR2, Netbeans 6.1 with Hibernate Plugin and Postgresql 8.3 database. I have 1 entity, 1 session bean and 1 servlet.

      Here is the source code:
      --------------------------------------------------------------------------------
      persistence.xml

      <?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="Quatron-ejbPU" transaction-type="JTA">
       <jta-data-source>java:/PostgreDS</jta-data-source>
       <properties>
       <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
       <property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>
       <property name="hibernate.show_sql" value="true"/>
       <property name="hibernate.current_session_context_class" value="thread"/>
       </properties>
       </persistence-unit>
      </persistence>
      


      --------------------------------------------------------------------------------
      Entity
      package entities;
      
      import java.io.Serializable;
      import javax.persistence.Column;
      import javax.persistence.Entity;
      import javax.persistence.Id;
      import javax.persistence.NamedQueries;
      import javax.persistence.NamedQuery;
      import javax.persistence.Table;
      
      @Entity
      @Table(name = "user_location")
      @NamedQueries({@NamedQuery(name = "UserLocation.findById", query = "SELECT u FROM UserLocation u WHERE u.id = :id"), @NamedQuery(name = "UserLocation.findByName", query = "SELECT u FROM UserLocation u WHERE u.name = :name")})
      public class UserLocation implements Serializable {
       private static final long serialVersionUID = 1L;
       @Id
       @Column(name = "id", nullable = false)
       private Integer id;
       @Column(name = "name", nullable = false)
       private String name;
      
       public UserLocation() {
       }
      
       public UserLocation(Integer id) {
       this.id = id;
       }
      
       public UserLocation(Integer id, String name) {
       this.id = id;
       this.name = name;
       }
      
       public Integer getId() {
       return id;
       }
      
       public void setId(Integer id) {
       this.id = id;
       }
      
       public String getName() {
       return name;
       }
      
       public void setName(String name) {
       this.name = name;
       }
      
       @Override
       public int hashCode() {
       int hash = 0;
       hash += (id != null ? id.hashCode() : 0);
       return hash;
       }
      
       @Override
       public boolean equals(Object object) {
       // TODO: Warning - this method won't work in the case the id fields are not set
       if (!(object instanceof UserLocation)) {
       return false;
       }
       UserLocation other = (UserLocation) object;
       if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
       return false;
       }
       return true;
       }
      
       @Override
       public String toString() {
       return "entities.UserLocation[id=" + id + "]";
       }


      --------------------------------------------------------------------------------
      Session Bean
      package session;
      
      import javax.ejb.Stateless;
      import javax.persistence.EntityManager;
      import javax.persistence.PersistenceContext;
      import entities.*;
      import javax.ejb.EJBException;
      
      @Stateless
      public class QuatronEJBBean implements QuatronEJBRemote {
      
       @PersistenceContext
       private EntityManager em;
      
      
       public String getText() {
       Integer id = new Integer(4);
       String name="NO";
       try {
       UserLocation loc = (UserLocation) em.find(UserLocation.class, id);
       name = loc.getName();
      
       } catch (Exception e) {
       throw new EJBException(e.getMessage());
       }
       return "TEST"+name;
       }
      
      }
      


      --------------------------------------------------------------------------------
      postgre-ds.xml

      <?xml version="1.0" encoding="UTF-8"?>
      
      <!-- ===================================================================== -->
      <!-- -->
      <!-- JBoss Server Configuration -->
      <!-- -->
      <!-- ===================================================================== -->
      
      <!-- $Id: postgres-ds.xml 41017 2006-02-07 14:26:14Z acoliver $ -->
      <!-- ==================================================================== -->
      <!-- Datasource config for Postgres -->
      <!-- ==================================================================== -->
      
      
      <datasources>
       <local-tx-datasource>
       <jndi-name>PostgreDS</jndi-name>
       <connection-url>jdbc:postgresql://localhost:5432/service</connection-url>
       <driver-class>org.postgresql.Driver</driver-class>
       <user-name>user</user-name>
       <password>secret</password>
       <!-- sql to call when connection is created. Can be anything, select 1 is valid for PostgreSQL
       <new-connection-sql>select 1</new-connection-sql>
       -->
      
       <!-- sql to call on an existing pooled connection when it is obtained from pool. Can be anything, select 1 is valid for PostgreSQL
       <check-valid-connection-sql>select 1</check-valid-connection-sql>
       -->
      
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
       <metadata>
       <type-mapping>PostgreSQL 7.2</type-mapping>
       </metadata>
       </local-tx-datasource>
      
      </datasources>
      


      Here is the error message:

      22:17:47,888 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@1953684 started
      22:17:47,890 INFO [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
      22:17:47,975 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
      22:17:48,463 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=PostgreDS' to JNDI name 'java:PostgreDS'
      22:17:48,473 INFO [TomcatDeployment] deploy, ctxPath=/, vfsUrl=ROOT.war
      22:17:48,520 INFO [TomcatDeployment] deploy, ctxPath=/jmx-console, vfsUrl=jmx-console.war
      22:17:49,960 INFO [JBossASKernel] Created KernelDeployment for: Quatron-ejb.jar
      22:17:49,968 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=Quatron.ear,jar=Quatron-ejb.jar,name=QuatronEJBBean,service=EJB3
      22:17:49,968 INFO [JBossASKernel] with dependencies:
      22:17:49,969 INFO [JBossASKernel] and demands:
      22:17:49,969 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
      22:17:49,969 INFO [JBossASKernel] persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU
      22:17:49,969 INFO [JBossASKernel] and supplies:
      22:17:50,365 INFO [JBossASKernel] jndi:Quatron/QuatronEJBBean/remote-session.QuatronEJBRemote
      22:17:50,365 INFO [JBossASKernel] jndi:Quatron/QuatronEJBBean/remote
      22:17:50,365 INFO [JBossASKernel] Class:session.QuatronEJBRemote
      22:17:50,365 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=Quatron.ear,jar=Quatron-ejb.jar,name=QuatronEJBBean,service=EJB3) to KernelDeployment of: Quatron-ejb.jar
      22:17:50,686 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU
      22:17:50,934 INFO [Version] Hibernate Annotations 3.4.0.GA
      22:17:50,952 INFO [Environment] Hibernate 3.3.1.GA
      22:17:50,961 INFO [Environment] hibernate.properties not found
      22:17:50,966 INFO [Environment] Bytecode provider name : javassist
      22:17:50,971 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
      22:17:51,059 INFO [Version] Hibernate Commons Annotations 3.1.0.GA
      22:17:51,064 INFO [Version] Hibernate EntityManager 3.4.0.GA
      22:17:51,827 WARN [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
      22:17:51,913 INFO [AnnotationBinder] Binding entity from annotated class: entities.UserLocation
      22:17:51,926 INFO [QueryBinder] Binding Named query: UserLocation.findById => SELECT u FROM UserLocation u WHERE u.id = :id
      22:17:51,926 INFO [QueryBinder] Binding Named query: UserLocation.findByName => SELECT u FROM UserLocation u WHERE u.name = :name
      22:17:51,969 INFO [EntityBinder] Bind entity entities.UserLocation on table user_location
      22:17:52,039 INFO [Version] Hibernate Validator 3.1.0.GA
      22:17:52,097 INFO [HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
      22:17:52,457 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
      22:17:52,461 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
      22:17:52,761 INFO [SettingsFactory] RDBMS: PostgreSQL, version: 8.2.9
      22:17:52,761 INFO [SettingsFactory] JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.1 JDBC3 with SSL (build 412)
      22:17:52,798 INFO [Dialect] Using dialect: org.hibernate.dialect.PostgreSQLDialect
      22:17:52,925 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU state=Create
      javax.persistence.PersistenceException: [PersistenceUnit: Quatron-ejbPU] Unable to build EntityManagerFactory
       at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
       at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
       at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:281)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
       at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
       at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
       at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
       at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:124)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1285)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1003)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1024)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1056)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:944)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:627)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:265)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:143)
       at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:409)
       at org.jboss.Main.boot(Main.java:209)
       at org.jboss.Main$1.run(Main.java:544)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: org.hibernate.HibernateException: Could not instantiate dialect class
       at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:107)
       at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:65)
       at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:460)
       at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:155)
       at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)
       at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
       at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
       ... 51 more
      Caused by: java.lang.ClassCastException: org.hibernate.dialect.PostgreSQLDialect cannot be cast to org.hibernate.dialect.Dialect
       at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:101)
       ... 58 more
      22:17:53,549 INFO [TomcatDeployment] deploy, ctxPath=/Quatron, vfsUrl=Quatron.ear/Quatron-war.war
      22:17:53,668 INFO [Ejb3JBoss5Deployment] Registration is not done -> stop
      22:17:53,672 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/jboss-5.0.0.CR2/server/all/deploy/Quatron-ejb.jar state=PreReal mode=Manual requiredState=Real
      org.jboss.deployers.spi.DeploymentException: Error deploying Quatron-ejb.jar: jboss.j2ee:jar=Quatron-ejb.jar,service=EJB3 already registered.
       at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:209)
       at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:108)
       at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1285)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1003)
      
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:944)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:627)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:265)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:143)
       at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:409)
       at org.jboss.Main.boot(Main.java:209)
       at org.jboss.Main$1.run(Main.java:544)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.management.InstanceAlreadyExistsException: jboss.j2ee:jar=Quatron-ejb.jar,service=EJB3 already registered.
       at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767)
       at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:236)
       at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
       at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1431)
       at java.security.AccessController.doPrivileged(Native Method)
       at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1426)
       at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:376)
       at org.jboss.ejb3.Ejb3Deployment.registerDeployment(Ejb3Deployment.java:454)
       at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:516)
       at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:195)
       ... 22 more
      22:17:53,928 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
      
      jboss.j2ee:ear=Quatron.ear,jar=Quatron-ejb.jar,name=QuatronEJBBean,service=EJB3
       -> <UNKNOWN jboss.j2ee:ear=Quatron.ear,jar=Quatron-ejb.jar,name=QuatronEJBBean,service=EJB3>{Described:** UNRESOLVED Demands 'persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU' **}
      
      
      *** CONTEXTS IN ERROR: Name -> Error
      
      <UNKNOWN jboss.j2ee:ear=Quatron.ear,jar=Quatron-ejb.jar,name=QuatronEJBBean,service=EJB3> -> ** UNRESOLVED Demands 'persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU' **
      
      vfszip:/C:/jboss-5.0.0.CR2/server/all/deploy/Quatron-ejb.jar -> javax.management.InstanceAlreadyExistsException: jboss.j2ee:jar=Quatron-ejb.jar,service=EJB3 already registered.
      
      persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU -> java.lang.ClassCastException: org.hibernate.dialect.PostgreSQLDialect cannot be cast to org.hibernate.dialect.Dialect
      
      
      22:17:54,394 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
      22:17:54,428 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
      22:17:54,436 INFO [ServerImpl] JBoss (Microcontainer) [5.0.0.CR2 (build: SVNTag=JBoss_5_0_0_CR2 date=200809171046)] Started in 59s:115ms
      22:18:00,224 INFO [TomcatDeployment] undeploy, ctxPath=/Quatron, vfsUrl=Quatron.ear/Quatron-war.war
      22:18:00,467 WARN [HackClassloaderMetaDataDeployer] FIXME Using loader repository config: quatron:archive=quatron.ear for vfszip:/C:/jboss-5.0.0.CR2/server/all/deploy/Quatron.ear use classloading metadata not loader repository config
      22:18:03,099 WARN [EjbMetadataJndiPolicyDecoratorDeployer] Defaulting to DefaultJndiBindingPolicy of "org.jboss.metadata.ejb.jboss.jndipolicy.plugins.BasicJndiBindingPolicy" for Session Bean QuatronEJBBean
      22:18:03,633 INFO [JBossASKernel] Created KernelDeployment for: Quatron-ejb.jar
      22:18:03,633 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=Quatron.ear,jar=Quatron-ejb.jar,name=QuatronEJBBean,service=EJB3
      22:18:03,634 INFO [JBossASKernel] with dependencies:
      22:18:03,634 INFO [JBossASKernel] and demands:
      22:18:03,634 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
      22:18:03,634 INFO [JBossASKernel] persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU
      22:18:03,634 INFO [JBossASKernel] and supplies:
      22:18:03,931 INFO [JBossASKernel] jndi:Quatron/QuatronEJBBean/remote-session.QuatronEJBRemote
      22:18:03,931 INFO [JBossASKernel] jndi:Quatron/QuatronEJBBean/remote
      22:18:03,931 INFO [JBossASKernel] Class:session.QuatronEJBRemote
      22:18:03,931 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=Quatron.ear,jar=Quatron-ejb.jar,name=QuatronEJBBean,service=EJB3) to KernelDeployment of: Quatron-ejb.jar
      22:18:04,167 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU
      22:18:04,933 WARN [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
      22:18:04,935 INFO [AnnotationBinder] Binding entity from annotated class: entities.UserLocation
      22:18:04,935 INFO [QueryBinder] Binding Named query: UserLocation.findById => SELECT u FROM UserLocation u WHERE u.id = :id
      22:18:04,935 INFO [QueryBinder] Binding Named query: UserLocation.findByName => SELECT u FROM UserLocation u WHERE u.name = :name
      22:18:05,433 INFO [EntityBinder] Bind entity entities.UserLocation on table user_location
      22:18:05,449 INFO [HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
      22:18:05,450 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
      22:18:05,455 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
      22:18:05,456 INFO [SettingsFactory] RDBMS: PostgreSQL, version: 8.2.9
      22:18:05,456 INFO [SettingsFactory] JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.1 JDBC3 with SSL (build 412)
      22:18:05,991 INFO [Dialect] Using dialect: org.hibernate.dialect.PostgreSQLDialect
      22:18:06,066 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU state=Create
      javax.persistence.PersistenceException: [PersistenceUnit: Quatron-ejbPU] Unable to build EntityManagerFactory
       at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
       at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
       at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:281)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
       at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
       at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
       at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
       at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:124)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1285)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1003)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1024)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1056)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:944)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:627)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: org.hibernate.HibernateException: Could not instantiate dialect class
       at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:107)
       at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:65)
       at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:460)
       at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:155)
       at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)
       at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
       at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
       ... 56 more
      Caused by: java.lang.ClassCastException: org.hibernate.dialect.PostgreSQLDialect cannot be cast to org.hibernate.dialect.Dialect
       at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:101)
       ... 63 more
      22:18:06,513 INFO [TomcatDeployment] deploy, ctxPath=/Quatron, vfsUrl=Quatron.ear/Quatron-war.war
      22:18:06,569 WARN [HDScanner] Failed to process changes
      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
      
      jboss.j2ee:ear=Quatron.ear,jar=Quatron-ejb.jar,name=QuatronEJBBean,service=EJB3
       -> <UNKNOWN jboss.j2ee:ear=Quatron.ear,jar=Quatron-ejb.jar,name=QuatronEJBBean,service=EJB3>{Described:** UNRESOLVED Demands 'persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU' **}
      
      
      *** CONTEXTS IN ERROR: Name -> Error
      
      <UNKNOWN jboss.j2ee:ear=Quatron.ear,jar=Quatron-ejb.jar,name=QuatronEJBBean,service=EJB3> -> ** UNRESOLVED Demands 'persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU' **
      
      vfszip:/C:/jboss-5.0.0.CR2/server/all/deploy/Quatron-ejb.jar -> javax.management.InstanceAlreadyExistsException: jboss.j2ee:jar=Quatron-ejb.jar,service=EJB3 already registered.
      
      persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU -> java.lang.ClassCastException: org.hibernate.dialect.PostgreSQLDialect cannot be cast to org.hibernate.dialect.Dialect
      
      
       at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:709)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:661)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:291)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
       at java.lang.Thread.run(Thread.java:619)
      22:21:28,414 INFO [[/Quatron]] Marking servlet QuatronServlet as unavailable
      22:21:28,415 ERROR [[QuatronServlet]] Allocate exception for servlet QuatronServlet
      javax.naming.NameNotFoundException: Quatron not bound
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:564)
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:572)
       at org.jnp.server.NamingServer.getObject(NamingServer.java:578)
       at org.jnp.server.NamingServer.lookup(NamingServer.java:288)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
       at javax.naming.InitialContext.lookup(InitialContext.java:392)
       at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1251)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:760)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
       at org.jboss.ejb3.JndiUtil.lookup(JndiUtil.java:44)
       at org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:75)
       at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:99)
       at org.jboss.web.tomcat.service.TomcatInjectionContainer.processInjectors(TomcatInjectionContainer.java:361)
       at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:244)
       at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1006)
       at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:777)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:189)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:91)
       at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:92)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:325)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)
      


      Thanks a lot!

        • 1. Re: Hibernate JBoss 5 javax.persistence.PersistenceException
          jaikiran pai Master

           

          Caused by: java.lang.ClassCastException: org.hibernate.dialect.PostgreSQLDialect cannot be cast to org.hibernate.dialect.Dialect



          Are you packaging any hibernate jars in your application? If yes, then try removing them. JBoss already ships with hibernate jars and this looks like a classloader issue.


          • 2. Re: Hibernate JBoss 5 javax.persistence.PersistenceException
            Christoph K Newbie

            Thanks a lot for your answer. I removed the Hibernate JAR Files from the Library but get the error message does not disappear.

            What does this mean: Unable to build EntityManagerFactory ?

            Error installing to Start: name=persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU state=Create
            javax.persistence.PersistenceException: [PersistenceUnit: Quatron-ejbPU] Unable to build EntityManagerFactory
             at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
             at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
             at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:281)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:597)
             at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
             at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
             at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
             at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
             at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
             at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
             at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
             at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
             at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
             at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
             at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
             at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
             at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
             at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
             at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
             at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:124)
             at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
             at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
             at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
             at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1285)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1003)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1024)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1056)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:944)
             at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
             at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
             at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
             at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:627)
             at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
             at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
             at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
             at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
             at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
             at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
             at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
             at java.lang.Thread.run(Thread.java:619)
            Caused by: org.hibernate.HibernateException: Could not instantiate dialect class
             at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:107)
             at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:65)
             at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:460)
             at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:155)
             at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)
             at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)
             at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
             at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
             ... 56 more
            Caused by: java.lang.ClassCastException: org.hibernate.dialect.PostgreSQLDialect cannot be cast to org.hibernate.dialect.Dialect
             at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:101)
             ... 63 more
            10:13:04,553 INFO [TomcatDeployment] deploy, ctxPath=/Quatron, vfsUrl=Quatron.ear/Quatron-war.war
            10:13:04,715 WARN [HDScanner] Failed to process changes
            org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
            
            *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
            
            jboss.j2ee:ear=Quatron.ear,jar=Quatron-ejb.jar,name=QuatronEJBBean,service=EJB3
             -> <UNKNOWN jboss.j2ee:ear=Quatron.ear,jar=Quatron-ejb.jar,name=QuatronEJBBean,service=EJB3>{Described:** UNRESOLVED Demands 'persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU' **}
            
            
            *** CONTEXTS IN ERROR: Name -> Error
            
            <UNKNOWN jboss.j2ee:ear=Quatron.ear,jar=Quatron-ejb.jar,name=QuatronEJBBean,service=EJB3> -> ** UNRESOLVED Demands 'persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU' **
            
            persistence.unit:unitName=Quatron.ear/Quatron-ejb.jar#Quatron-ejbPU -> java.lang.ClassCastException: org.hibernate.dialect.PostgreSQLDialect cannot be cast to org.hibernate.dialect.Dialect
            
            
             at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:709)
             at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:661)
             at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:291)
             at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
             at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
             at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
             at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
             at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
             at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
             at java.lang.Thread.run(Thread.java:619)
            10:14:03,882 INFO [[/Quatron]] Marking servlet QuatronServlet as unavailable
            10:14:03,886 ERROR [[QuatronServlet]] Allocate exception for servlet QuatronServlet
            javax.naming.NameNotFoundException: Quatron not bound
             at org.jnp.server.NamingServer.getBinding(NamingServer.java:564)
             at org.jnp.server.NamingServer.getBinding(NamingServer.java:572)
             at org.jnp.server.NamingServer.getObject(NamingServer.java:578)
             at org.jnp.server.NamingServer.lookup(NamingServer.java:288)
             at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
             at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
             at javax.naming.InitialContext.lookup(InitialContext.java:392)
             at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1251)
             at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:760)
             at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
             at org.jboss.ejb3.JndiUtil.lookup(JndiUtil.java:44)
             at org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:75)
             at org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:99)
             at org.jboss.web.tomcat.service.TomcatInjectionContainer.processInjectors(TomcatInjectionContainer.java:361)
             at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:244)
             at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1006)
             at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:777)
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
             at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:189)
             at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:91)
             at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:92)
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
             at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:325)
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
             at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
             at java.lang.Thread.run(Thread.java:619)