Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-20564

Deploying postgresql-42.7.5.jar causes NPE when upgrading from wildfly 35->36

XMLWordPrintable

    • Hide

      I took my application that runs in a wildfly 35 container(the bitnami/wildfly:35) and upgraded the container to wildfly 36(bitnami/wildfly:36).  The places in my pom.xml that reference versions of components supplied as provided wildfly have versions updated to match what shipps with wildfly 36.  These would be things like hibernate, infinispan etc.

      Initially I didn't update my persistence.xml to be 3.1, it was left at 2.1.   After the exception happened, I tried converting it to use 3.1

      This made no difference but here's what my persistence.xml looks like now

      <?xml version="1.0" encoding="UTF-8"?>
      <persistence version="3.1" xmlns="[https://jakarta.ee/xml/ns/persistence]"
                   xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance]"
                   xsi:schemaLocation="[https://jakarta.ee/xml/ns/persistence]
                   [https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd]">
        <persistence-unit name="jlogiPU">
          <jta-data-source>java:jboss/datasources/jlogiDS</jta-data-source>
          <!-- list of JPA classes,  these aren't strictly required
                   since modern hibernate auto-discovers based on @Entity annotations
          -->
          <!-- properties for configurating this persistence unit -->
          <properties>
            <property name="hibernate.hbm2ddl.auto" value="update"/>
            <property name="jakarta.persistence.schema-generation.create-source" value="metadata"/>
            <property name="jakarta.persistence.schema-generation.drop-source" value="metadata"/>
            <!-- USE THIS ONLY FOR DEBUGGING!-->
            <property name="hibernate.show_sql" value="false"/>
            <!--<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform"/>-->
            <!-- according to the wildfly startup the following prop is no longer required, commenting out for now-->
      <!--      <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>-->
            <property name="hibernate.jdbc.batch_size" value="800"/>
          </properties>
        </persistence-unit>
      </persistence>
      

       

      Show
      I took my application that runs in a wildfly 35 container(the bitnami/wildfly:35) and upgraded the container to wildfly 36(bitnami/wildfly:36).  The places in my pom.xml that reference versions of components supplied as provided wildfly have versions updated to match what shipps with wildfly 36.  These would be things like hibernate, infinispan etc. Initially I didn't update my persistence.xml to be 3.1, it was left at 2.1.   After the exception happened, I tried converting it to use 3.1 This made no difference but here's what my persistence.xml looks like now <?xml version= "1.0" encoding= "UTF-8" ?> <persistence version= "3.1" xmlns= "[https://jakarta.ee/xml/ns/persistence]"               xmlns:xsi = "[http://www.w3.org/2001/XMLSchema-instance]"              xsi:schemaLocation="[https://jakarta.ee/xml/ns/persistence]              [https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd]">   <persistence-unit name= "jlogiPU" >     <jta-data-source> java:jboss/datasources/jlogiDS </jta-data-source>     <!-- list of JPA classes,  these aren't strictly required              since modern hibernate auto-discovers based on @Entity annotations     -->     <!-- properties for configurating this persistence unit -->     <properties>       <property name= "hibernate.hbm2ddl.auto" value= "update" />       <property name= "jakarta.persistence.schema-generation.create-source" value= "metadata" />       <property name= "jakarta.persistence.schema-generation.drop-source" value= "metadata" />       <!-- USE THIS ONLY FOR DEBUGGING!-->       <property name= "hibernate.show_sql" value= "false" />       <!--<property name= "hibernate.transaction.jta.platform" value= "org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform" /> -->       <!-- according to the wildfly startup the following prop is no longer required, commenting out for now--> <!--      <property name= "hibernate.dialect" value= "org.hibernate.dialect.PostgreSQLDialect" /> -->       <property name= "hibernate.jdbc.batch_size" value= "800" />     </properties>   </persistence-unit> </persistence>  
    • ---
    • ---

      I have upgrade versions of wildfly very religiously over the years. Normally it just works.  However, this morning tried upgrading my wildfly 35 based application to wildfly 36.   While wildfly is starting up I see the following exception

      2025-04-15 15:17:31,749 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."postgresql-42.7.5.jar".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."postgresql-42.7.5.jar".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "postgresql-42.7.5.jar"
      at org.jboss.as.server@28.0.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
      at org.jboss.msc@1.5.5.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1617)
      at org.jboss.msc@1.5.5.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1580)
      at org.jboss.msc@1.5.5.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1438)
      at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
      at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      at java.base/java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.NullPointerException: Cannot invoke "org.jboss.as.jpa.config.PersistenceUnitsInApplication.getPersistenceUnitHolders()" because "persistenceUnitsInApplication" is null
      at org.jboss.as.jpa@36.0.0.Final//org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.nextPhaseDependsOnPersistenceUnit(PersistenceUnitServiceHandler.java:1025)
      at org.jboss.as.jpa@36.0.0.Final//org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:118)
      at org.jboss.as.jpa@36.0.0.Final//org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:35)
      at org.jboss.as.server@28.0.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
      ... 8 more
       
       
      

       

              smarlow1@redhat.com Scott Marlow
              stephen.sill.2nd Stephen Sill (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: