Uploaded image for project: 'Geronimo'
  1. Geronimo
  2. GERONIMO-5689

User-defined derby connection user name and password should be honored when enabling derby authentication

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Problem
    • 2.1.7, 2.2.1
    • 2.1.8
    • databases
    • Security Level: public (Regular issues)
    • None
    • ubuntu 10.04.1 LTS
      sun java 1.5.0_22

    Description

      Consider this scenario:
      1. User firstly disables derby authentication, then start the server and deploy an application which is using embedded derby database. The datasource deployment plan is like this:
      <resourceadapter>

      <outbound-resourceadapter>

      <connection-definition>

      <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>

      <connectiondefinition-instance>

      <name>BankPool</name>

      <config-property-setting name="Driver">org.apache.derby.jdbc.EmbeddedDriver</config-property-setting>

      <config-property-setting name="UserName">app</config-property-setting>

      <config-property-setting name="Password">app</config-property-setting>

      <config-property-setting name="ConnectionURL">jdbc:derby:BankDB;create=true</config-property-setting>

      <connectionmanager>

      <local-transaction/>

      <single-pool>

      <max-size>10</max-size>

      <min-size>0</min-size>

      <match-one/>

      </single-pool>

      </connectionmanager>

      </connectiondefinition-instance>

      </connection-definition>

      </outbound-resourceadapter>

      </resourceadapter>

      In the plan, user specifies an username and password.
      2. Shutdown the server, enable derby authentication, and start the server again

      3. Now the server cannot start successfullly, because this exception:

      Module 69/69 org.apache.geronimo.samples/bank-ear/2.1.1.4/car 2010-11-15 15:12:25,224 WARN [DerbyUserAuthenticator] User authentication failure (userName userPassword databaseName): app app BankDB
      2010-11-15 15:12:25,240 ERROR [MCFConnectionInterceptor] Error occurred creating ManagedConnection for handle: nullManagedConnectionInfo: org.apache.geronimo.connector.outbound.ManagedConnectionInfo@123288b. mc: null]
      javax.resource.spi.ResourceAllocationException: Unable to obtain physical connection to jdbc:derby:BankDB;create=true

      ...
      Caused by: org.apache.geronimo.gbean.InvalidConfigurationException: Configuration org.apache.geronimo.samples/bank-ear/2.1.1.4/car failed to start due to the following reasons:
      The service J2EEApplication=org.apache.geronimo.samples/bank-ear/2.1.1.4/car,j2eeType=GBean,name=BankDBInit did not start because Connection authentication failure occurred. Reason: Invalid authentication..

      I think this exception may cause by derby user is hard-coded in code to acquire server connection.

      Attachments

        1. bank-ear-2.1.1.4.ear
          113 kB
          Ming Xia

        Activity

          People

            chi runhua Chi Runhua
            xiaming Ming Xia
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: