Uploaded image for project: 'IronJacamar'
  1. IronJacamar
  2. JBJCA-1264

NullPointerException hides cause of PostgreSql Exception for getConnection call.

    XMLWordPrintable

Details

    • Hide

      set the loglevel property to 2 on a datasource.

      Show
      set the loglevel property to 2 on a datasource.

    Description

      When a datasource using PostgreSql is configured with the "loglevel" property the JCA db server causes a PGSqlException. Besides that cause the exception is not displayed to the user.

      org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

      The JCA code attempts to handle the exception in a catch block. Initially by logging a message. But the JCA code to log the message assumes the clw reference is not null. On this line

      https://github.com/ironjacamar/ironjacamar/blob/ironjacamar-1.0.30.Final/core/src/main/java/org/jboss/jca/core/connectionmanager/pool/mcp/SemaphoreConcurrentLinkedQueueManagedConnectionPool.java#L398

      In my case clw is null. Which then causes an NullPointerException. Completely hiding the underlying exception to the user.

      Attachments

        Activity

          People

            jpederse@redhat.com Jesper Pedersen
            jwhiting@redhat.com Jeremy Whiting
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: