0 Replies Latest reply on Oct 13, 2015 1:44 PM by suraj sharma

    Persistenceunit error while running Seam 2.2.0-JBoss 5.1.0 application on JBoss 7.1

    suraj sharma Newbie

      Hi All,

       

      I am migrating my application from Seam 2.2.0, JBoss 5.1.0 GA to JBoss 7.1. I followed the steps you have mentioned in the Dvdstore example migration for JBoss AS 7.x, I am getting the following error at the end of deployment while starting the server.

       

      JBAS014775:    New missing/unsatisfied dependencies:

            service jboss.persistenceunit."migration-ear.ear/migration-ejb.jar#migration" (missing) dependents: [service jboss.naming.context.java.comp.migration-ear.migration-ejb.SchedulerHandlerBean.env."com.migration.session.impl.SchedulerHandlerBean".entityManager, service jboss.naming.context.java.comp.migration-ear.migration-ejb.migrationJobHealthCheckupBean.env, JBAS014799: ... and 99 more ]

       

      But the difference is I am using hibernate 3 as a module instead of deploying ear lib using the below configuration in persistence.xml

       

      <property name="jboss.as.jpa.providerModule" value="org.hibernate:3"></property>

       

      the below is my persistence.xml

       

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

      <!-- Persistence deployment descriptor for dev profile -->

      <persistence 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"

        version="1.0">

       

       

        <persistence-unit name="sampletest" >

        <provider>org.hibernate.ejb.HibernatePersistence</provider>

        <jta-data-source>java:jboss/datasources/sampleDS</jta-data-source>

        <properties>

      <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />

        <property name="jboss.as.jpa.managed" value="false"/>

        <property name="jboss.entity.manager.factory.jndi.name"

        value="java:/sampleEntityManagerFactory" />

        <property name="jboss.as.jpa.providerModule" value="org.hibernate:3"></property>

        </properties>

        </persistence-unit>

      </persistence>

       

      I configured my hibernate 3 properly.

       

      I also observed that the list of classes showing in missing / unsatisfied dependencies has @persistenceContext annotation in those beans and all these are annotated with @Stateless

      The Bean has the below code

      @PersistenceContext

      private EntityManager em;

       

      ;Based on the error message it should there should be an error in my data source configuration. But I have hibernate.cfg.xml in my JBPM configuration, there I have given the same data source name and it was not throwing any error. So there is no problem in datasource configuration.

       

      Do I need to do any extra configuration for Seam 2.2.0 application to run on JBoss 7.1?

       

      2) I also observed that the EJB lookup is not working while starting the server.

       

      While starting the server I have a bean with @Startup annotation and in that beam I am doing EJB lookup as below

       

      final InitialContext initialContext = new InitialContext();

       

      MyBean bean=(MyBean)initialContext.lookup(name);

       

      There is no issue in the above logic but when we call a method like

       

      bean.doSomething() it is not performing any operations.

       

      As per some other posts I found that this is resolved when using Hibernate 4, but I am using Hibernate 3 as per https://developer.jboss.org/blogs/marek-novotny/2011/12/16/dvdstore-migration-for-jboss-as-710beta

       

      Does JBoss 7.1 fully supports Seam 2.2.0, or do I need to upgrade any other technologies?