1 Reply Latest reply on Mar 9, 2012 6:30 AM by Scott Marlow

    two ejb modules with different persistence provider in one ear

    Jacek Dabrowski Newbie

      With JBoss7.1.0.Final is it possible to have two ejb modules in ear, one using hibernate:3 persistence provider and second using default (hibernate4) one?

       

      When I try to do that I get:

       

      08:30:39,383 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.persistenceunit."my.ear/test-module.jar#MyPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."my.ear/test-module.jar#MyPU": Failed to start service
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_22]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_22]
          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_22]
      Caused by: org.hibernate.HibernateException: Unable to get the default Bean Validation factory
          at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:98)
          at org.hibernate.cfg.AnnotationConfiguration.applyBeanValidationConstraintsOnDDL(AnnotationConfiguration.java:477)
          at org.hibernate.cfg.AnnotationConfiguration.applyConstraintsToDDL(AnnotationConfiguration.java:429)
          at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:403)
          at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1206)
          at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1457)
          at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:193)
          at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1085)
          at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:681)
          at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
          at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)
          at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
          ... 3 more
      Caused by: java.lang.NoSuchMethodException: org.hibernate.cfg.beanvalidation.TypeSafeActivator.applyDDL(java.util.Collection, java.util.Properties)
          at java.lang.Class.getMethod(Class.java:1605) [rt.jar:1.6.0_22]
          at org.hibernate.cfg.beanvalidation.BeanValidationActivator.applyDDL(BeanValidationActivator.java:93)
          ... 16 more
      

       

      Hibernate version is 3.5.5.Final.