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

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

    Steffen Buchholz Newbie

      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?