0 Replies Latest reply on Dec 1, 2016 8:54 AM by Vinicius Silva

    Hibernate: Could not deploy application packaged persistence provider

    Vinicius Silva Newbie

      Hi guys,

       

      I'm trying to upgrade Hibernate from version 4.2.21.Final to version 5.2.5.Final but I have been having some troubles since last week. So far, I haven't been able to find anything about this problem in my searches... Whenever I modify pom.xml and set the new version for Hibernate, I get the following exception when deploying the project:

       

      10:08:44,397 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) WFLYDS0004: Found MaisAcoes.war in deployment directory. To trigger deployment create a file called MaisAcoes.war.dodeploy
      10:08:44,466 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of "MaisAcoes.war" (runtime-name: "MaisAcoes.war")
      10:08:47,251 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry activation.jar in /C:/Users/vinic/Desktop/SEATI/wildfly-10.1.0.Final/standalone/deployments/MaisAcoes.war/WEB-INF/lib/mail-1.4.1.jar  does not point to a valid jar for a Class-Path reference.
      10:08:49,493 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."MaisAcoes.war".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."MaisAcoes.war".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "MaisAcoes.war"
          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at java.lang.Thread.run(Thread.java:745)
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJPA0019: Could not deploy application packaged persistence provider 'org.hibernate.jpa.HibernatePersistenceProvider'
          at org.jboss.as.jpa.processor.PersistenceProviderHandler.deploy(PersistenceProviderHandler.java:79)
          at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:49)
          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
          ... 5 more
      Caused by: java.lang.ClassCastException: class org.hibernate.jpa.HibernatePersistenceProvider
          at java.lang.Class.asSubclass(Class.java:3404)
          at org.jboss.as.jpa.processor.PersistenceProviderHandler.deploy(PersistenceProviderHandler.java:72)
          ... 7 more
      
      10:08:49,505 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "MaisAcoes.war")]) - failure description: {
          "WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"MaisAcoes.war\".FIRST_MODULE_USE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"MaisAcoes.war\".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment \"MaisAcoes.war\"
          Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJPA0019: Could not deploy application packaged persistence provider 'org.hibernate.jpa.HibernatePersistenceProvider'
          Caused by: java.lang.ClassCastException: class org.hibernate.jpa.HibernatePersistenceProvider"},
          "WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.unit.\"MaisAcoes.war\".FIRST_MODULE_USE"],
          "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
      }
      10:08:49,658 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0010: Deployed "MaisAcoes.war" (runtime-name : "MaisAcoes.war")
      10:08:49,658 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report
      WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."MaisAcoes.war".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."MaisAcoes.war".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "MaisAcoes.war"
      
      10:08:44,397 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) WFLYDS0004: Found MaisAcoes.war in deployment directory. To trigger deployment create a file called MaisAcoes.war.dodeploy10:08:44,466 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of "MaisAcoes.war" (runtime-name: "MaisAcoes.war")10:08:47,251 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0059: Class Path entry activation.jar in /C:/Users/vinic/Desktop/SEATI/wildfly-10.1.0.Final/standalone/deployments/MaisAcoes.war/WEB-INF/lib/mail-1.4.1.jar  does not point to a valid jar for a Class-Path reference.10:08:49,493 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."MaisAcoes.war".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."MaisAcoes.war".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "MaisAcoes.war"    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)    at java.lang.Thread.run(Thread.java:745)Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJPA0019: Could not deploy application packaged persistence provider 'org.hibernate.jpa.HibernatePersistenceProvider'    at org.jboss.as.jpa.processor.PersistenceProviderHandler.deploy(PersistenceProviderHandler.java:79)    at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:49)    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)    ... 5 moreCaused by: java.lang.ClassCastException: class org.hibernate.jpa.HibernatePersistenceProvider    at java.lang.Class.asSubclass(Class.java:3404)    at org.jboss.as.jpa.processor.PersistenceProviderHandler.deploy(PersistenceProviderHandler.java:72)    ... 7 more 10:08:49,505 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "MaisAcoes.war")]) - failure description: {    "WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"MaisAcoes.war\".FIRST_MODULE_USE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"MaisAcoes.war\".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment \"MaisAcoes.war\"     Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJPA0019: Could not deploy application packaged persistence provider 'org.hibernate.jpa.HibernatePersistenceProvider'    Caused by: java.lang.ClassCastException: class org.hibernate.jpa.HibernatePersistenceProvider"},    "WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.unit.\"MaisAcoes.war\".FIRST_MODULE_USE"],    "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined}10:08:49,658 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0010: Deployed "MaisAcoes.war" (runtime-name : "MaisAcoes.war")10:08:49,658 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."MaisAcoes.war".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."MaisAcoes.war".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "MaisAcoes.war"

       

      What am I missing? Here's my pom.xml:

       

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
          <modelVersion>4.0.0</modelVersion>
          <groupId>MaisAcoes</groupId>
          <artifactId>MaisAcoes</artifactId>
          <version>0.0.1-SNAPSHOT</version>
          <packaging>war</packaging>
          <build>
              <sourceDirectory>src</sourceDirectory>
              <plugins>
                  <plugin>
                      <artifactId>maven-compiler-plugin</artifactId>
                      <version>3.1</version>
                      <configuration>
                          <source>1.8</source>
                          <target>1.8</target>
                      </configuration>
                  </plugin>
                  <plugin>
                      <artifactId>maven-war-plugin</artifactId>
                      <version>2.4</version>
                      <configuration>
                          <warSourceDirectory>WebContent</warSourceDirectory>
                          <failOnMissingWebXml>false</failOnMissingWebXml>
                      </configuration>
                  </plugin>
              </plugins>
          </build>
       
          <dependencies>
              <!-- ****** HIBERNATE****** -->
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-core</artifactId>
                  <version>5.2.5.Final</version>
              </dependency>
              <!-- ****** ****** -->
       
              <!-- ****** JAVA SERVER FACES ****** -->
              <dependency>
                  <groupId>com.sun.faces</groupId>
                  <artifactId>jsf-api</artifactId>
                  <version>2.2.13</version>
              </dependency>
              <!-- ****** ****** -->
       
       
              <!-- ****** PRIME FACES ****** -->
              <dependency>
                  <groupId>org.primefaces</groupId>
                  <artifactId>primefaces</artifactId>
                  <version>5.1</version>
              </dependency>
       
              <dependency>
                  <groupId>org.primefaces.extensions</groupId>
                  <artifactId>primefaces-extensions</artifactId>
                  <version>3.0.0</version>
              </dependency>
              <!-- ****** ****** -->
       
              <!-- ****** PRIME FACES ALL THEMES****** -->
              <dependency>
                  <groupId>org.primefaces.extensions</groupId>
                  <artifactId>all-themes</artifactId>
                  <version>1.0.8</version>
              </dependency>
              <!-- ****** ****** -->
       
              <!-- Apache Commons: Email -->
              <dependency>
                  <groupId>org.apache.commons</groupId>
                  <artifactId>commons-email</artifactId>
                  <version>1.2</version>
              </dependency>
       
              <!-- Java EE 7 -->
              <dependency>
                  <groupId>javax</groupId>
                  <artifactId>javaee-api</artifactId>
                  <version>7.0</version>
              </dependency>
       
              <!-- Quartz (serviço "cron" para o projeto) -->
              <dependency>
                  <groupId>org.quartz-scheduler</groupId>
                  <artifactId>quartz</artifactId>
                  <version>2.2.1</version>
              </dependency>
              <dependency>
                  <groupId>org.quartz-scheduler</groupId>
                  <artifactId>quartz-jobs</artifactId>
                  <version>2.2.1</version>
              </dependency>
          </dependencies>
      
      </project>
      

       

      I'm using WildFly 10.1.