Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-764

database exception using rhdm71-optaweb-employee-rostering-externaldb.yaml when connecting to PostgreSQL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.2.0.GA
    • 7.0.1.GA
    • Cloud
    • OCP3.9

    • 2018 Week 36-38, 2018 Week 39-41, 2018 Week 42-44

      This jira was cloned from, and follows up on, RHPAM-904. The rhpam71-kieserver-externaldb.yaml file required changes when fixing that issue.

      As a follow-up, the rhdm71-optaweb-employee-rostering-externaldb.yaml template should also be updated with the same required changes. However, because of persistence problems tracked in PLANNER-1152 and PLANNER-1278, we need to first get new artifacts containing those fixes until we can move forward with this jira.

      This is the original Description copied/pasted from RHPAM-904:


      Right now using rhpam70-kieserver-externaldb.yaml when connecting to PostgreSQL db will see this exception in the pod log.

      Caused by: java.net.ConnectException: Connection refused (Connection refused)
      ...............
      exception in log:
      Caused by: javax.resource.ResourceException: IJ031102: Failed to load XA datasource: org.postgresql.xa.PGXADataSource
      at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXADataSource(XAManagedConnectionFactory.java:640)
      at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:493)
      ... 52 more
      Caused by: java.lang.NoSuchMethodException: Method setURL not found
      at org.jboss.jca.adapters.jdbc.util.Injection.inject(Injection.java:139)
      at org.jboss.jca.adapters.jdbc.util.Injection.inject(Injection.java:68)
      at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXADataSource(XAManagedConnectionFactory.java:635)
      ... 53 more

      I didn't see this exception before in the old rhba70-kieserver-externaldb.yaml when connecting to PostgreSQL, and there is no exception using rhpam70-kieserver-postgresql.yaml.

      So I compared the EAP datasource configuration created by rhpam70-kieserver-externaldb.yaml and by old rhba70-kieserver-externaldb.yaml, and current rhpam70-kieserver-postgresql.yaml.
      The difference is:
      Both rhpam70-kieserver-postgresql.yaml and old rhba70-kieserver-externaldb.yaml created datasource properties like this
      <xa-datasource-property name="DatabaseName">rhpam7</xa-datasource-property>
      <xa-datasource-property name="PortNumber">5432</xa-datasource-property>
      <xa-datasource-property name="ServerName">myapp-postgresql</xa-datasource-property>

      And current rhpam70-kieserver-externaldb.yaml created datasource properties like this:
      <xa-datasource-property name="URL">jdbc:postgresql://external-db:5432/rhpam</xa-datasource-property>

      I tested in my local found:

      1) using PostgreSQL 9.2 JDBC driver, which is the default PostgreSQL JDBC driver in eap7 image in OCP.
      in my local, if the datasource used "URL", would have the same exception.
      in my local, if the datasource used 3 properties (DatabaseName, PortNumber and ServerName), there was no exception.

      I further tested using postgresql-42.2.2.redhat-2.jar (the latest jar to fix RHPAM-740 KIE restarted caused exception)
      in my local, used "URL" or used 3 properties all worked well.

      And I tested in OCP,
      I created a local KIE image using postgresql-42.2.2.redhat-2.jar, and use the rhpam70-kieserver-externaldb.yaml there is no exception.

              rhn-support-fspolti Filippe Spolti
              rhn-support-fspolti Filippe Spolti
              Radovan Synek Radovan Synek (Inactive)
              Radovan Synek Radovan Synek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: