1 Reply Latest reply on Mar 26, 2018 5:04 PM by jewellgm

    java.lang.ClassNotFoundException: org.hibernate.ejb.EntityManagerImpl

    buchholzs1

      I want to port a war file to JBoss 7.1. I deployed the existing war file, but got an exception:

       

      Caused by: java.lang.NoClassDefFoundError: org/hibernate/ejb/EntityManagerImpl

       

      at com.hp.dtag.pmo.SchemaCreator.setEm(SchemaCreator.java:71)

       

      at com.hp.dtag.pmo.portlet.dummy.InitializeDummyData.init(InitializeDummyData.java:50)

       

        

      The code in SchemaCreator is as follows:

       

      public void setEm(EntityManager em){

       

              if (em.getDelegate() instanceof Session) {

       

                  s = (Session)em.getDelegate();

       

              }

       

              if (em.getDelegate() instanceof EntityManagerImpl){

       

                  s = ((EntityManagerImpl)em.getDelegate()).getSession();

       

              }

       

          }

       

        

      I have the dependency to the hibernate entitymanager in the pom:

       

              <dependency>

       

                  <groupId>org.hibernate</groupId>

       

                  <artifactId>hibernate-entitymanager</artifactId>

       

                  <scope>provided</scope>

       

              </dependency>

       

      Why doesn't JBoss find the EntityManagerImpl?