OpenJPA
  1. OpenJPA
  2. OPENJPA-581

JNDI lookup failures are not generating useful messages

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.3, 1.1.0, 1.2.0
    • Fix Version/s: 1.2.0
    • Component/s: jdbc
    • Labels:
      None

      Description

      When using OpenJPA within a container-managed environment and the configuration is using <jta-data-source> and/or <non-jta-data-source> elements with jndi names, the error messages produced when the lookup fails doesn't help with deciphering the problem:

      Exception data:
      <openjpa-1.1.0-SNAPSHOT-r422266:641891 fatal user error> org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property.

      Looking at the code, even if the jndi lookup causes an exception, the exception is eaten. This failure turns into a null datasource and then we fall into "normal" datasource processing with the openjpa.Connection* properties. That's when we produce the above message because there is no driver specified.

      In this particular case, the user had a typo in his persistence.xml for the jndi name. It took too much debugging time to figure out that he had a typo.

      Kevin

        Activity

        Kevin Sutter created issue -
        Pinaki Poddar made changes -
        Field Original Value New Value
        Assignee Pinaki Poddar [ ppoddar@apache.org ]
        Hide
        Pinaki Poddar added a comment -

        Revision 669356.
        Prints a WARN level message when JNDI lookup fails for a null-null key.

        Show
        Pinaki Poddar added a comment - Revision 669356. Prints a WARN level message when JNDI lookup fails for a null-null key.
        Pinaki Poddar made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Michael Dick made changes -
        Fix Version/s 1.2.0 [ 12313102 ]
        Donald Woods made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Pinaki Poddar
            Reporter:
            Kevin Sutter
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development