Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1746

NullPointerException when a null value is set in the properties map passed to Entity.createEntityManagerFactory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2.2
    • 2.1.2, 2.2.0
    • jpa
    • None
    • N/A

    Description

      If a property is set with a null value in the Entity.createEntityManagerFactory, a NullPointerException is thrown due to PersistenceUnitInfoImpl's use of Properties for the _props field (which extends Hashtable which doesn't allow nulls). Although not specifically laid out by the API, it accepts Map, which is incompatible with Properties/Hashtable in this instance. HashMap would be the preffered type here.

      Currently this was working with EclipseLink, as I set some properties to null to override defaults set in the persistence.xml file based on some dynamic criteria.

      Attachments

        Activity

          People

            ppoddar@apache.org Pinaki Poddar
            rflahert Robert Flaherty
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: