OpenJPA
  1. OpenJPA
  2. OPENJPA-1746

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.2
    • Fix Version/s: 2.1.2, 2.2.0
    • Component/s: jpa
    • Labels:
      None
    • Environment:
      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.

        Activity

        Robert Flaherty created issue -
        ppoddar committed 979426 (1 file)
        ppoddar committed 979427 (1 file)
        Pinaki Poddar made changes -
        Field Original Value New Value
        Assignee Pinaki Poddar [ ppoddar@apache.org ]
        Michael Dick made changes -
        Fix Version/s 2.1.2 [ 12317142 ]
        Fix Version/s 2.2.0 [ 12315910 ]
        Hide
        Michael Dick added a comment -

        Closing issues which have code changes and have not been modified for a while.

        If there is more work to be done for this issue please check whether it has already been included in an OpenJPA release.

        If the changes are in an OpenJPA release please open a new issue and link to this one.

        If the changes are not in an OpenJPA release you may reopen this issue or create a new issue.

        Show
        Michael Dick added a comment - Closing issues which have code changes and have not been modified for a while. If there is more work to be done for this issue please check whether it has already been included in an OpenJPA release. If the changes are in an OpenJPA release please open a new issue and link to this one. If the changes are not in an OpenJPA release you may reopen this issue or create a new issue.
        Michael Dick made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Pinaki Poddar
            Reporter:
            Robert Flaherty
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development