Uploaded image for project: 'Policy Framework'
  1. Policy Framework
  2. POLICY-3608

LASTUPDATE column in pdp table causing Nullpointer Exception in PAP initialization

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • Istanbul Release
    • Istanbul Release
    • pap
    • None

      After adding the LASTUPDATE column to a pdp table that already has data the value defaults to null.
      When the pdp initialization process  queries the existing records it throws a nullpointer exception when it sees lastupdate is null.
       
      This can be fixed in db-migrator by updating 0100-pdp.sql
      ALTER TABLE pdp ADD COLUMN LASTUPDATE datetime NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER HEALTHY;

       

      Exception in thread "main" org.onap.policy.pap.main.PolicyPapRuntimeException: Start of policy-pap service failed.
      at org.onap.policy.pap.main.startstop.Main.<init>(Main.java:93)
      at org.onap.policy.pap.main.startstop.Main.main(Main.java:159)
      [2021-08-31T10:33:24.754+00:00|ERROR|Main|main] failed to start Main
      java.lang.NullPointerException: null
      at org.onap.policy.models.pdp.persistence.concepts.JpaPdp.toAuthorative(JpaPdp.java:149)
      at org.onap.policy.models.pdp.persistence.concepts.JpaPdpSubGroup.toAuthorative(JpaPdpSubGroup.java:200)
      at org.onap.policy.models.pdp.persistence.concepts.JpaPdpGroup.toAuthorative(JpaPdpGroup.java:167)
      at org.onap.policy.models.pdp.persistence.provider.PdpProvider.asPdpGroupList(PdpProvider.java:368)
      at org.onap.policy.models.pdp.persistence.provider.PdpProvider.getPdpGroups(PdpProvider.java:70)
      at org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl.getPdpGroups(DatabasePolicyModelsProviderImpl.java:213)
      at org.onap.policy.pap.main.startstop.PapDatabaseInitializer.initializePapDatabase(PapDatabaseInitializer.java:72)
      at org.onap.policy.pap.main.startstop.Main.<init>(Main.java:72)
      at org.onap.policy.pap.main.startstop.Main.main(Main.java:159)
      Caused by: java.lang.NullPointerException
      at org.onap.policy.models.pdp.persistence.concepts.JpaPdp.toAuthorative(JpaPdp.java:149)
      at org.onap.policy.models.pdp.persistence.concepts.JpaPdpSubGroup.toAuthorative(JpaPdpSubGroup.java:200)
      at org.onap.policy.models.pdp.persistence.concepts.JpaPdpGroup.toAuthorative(JpaPdpGroup.java:167)
      at org.onap.policy.models.pdp.persistence.provider.PdpProvider.asPdpGroupList(PdpProvider.java:368)
      at org.onap.policy.models.pdp.persistence.provider.PdpProvider.getPdpGroups(PdpProvider.java:70)
      at org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl.getPdpGroups(DatabasePolicyModelsProviderImpl.java:213)
      at org.onap.policy.pap.main.startstop.PapDatabaseInitializer.initializePapDatabase(PapDatabaseInitializer.java:72)
      at org.onap.policy.pap.main.startstop.Main.<init>(Main.java:72)

            ktimoney ktimoney
            ktimoney ktimoney
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: