Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-3434

DSpace fails to start when a database connection pool is supplied through JNDI

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.0
    • Fix Version/s: 6.3, 7.0
    • Component/s: API
    • Labels:
      None
    • Environment:
      Tomcat with its included database connection pooling support.
    • Attachments:
      0
    • Comments:
      7
    • Documentation Status:
      Not Required

      Description

      DatabaseUtils.getDataSource() tries to look up a service with name 'dataSource' and type BasicDataSource. But the tomcat-dbcp BasicDataSource is not a descendant of
      org.apache.commons.dbcp2.BasicDataSource so it doesn't match. SpringServiceManager.getServiceByName() returns null, DSpaceServicemanager passes the null up, and DatabaseUtils.updateDatabase() then chokes when it tries to dereference the return from getDataSource().

      We could ask for type Object.class, which should match anything.

      We could just autowire the datasource into DatabaseUtils instead of asking the ServiceManager. We would need to make DatabaseUtils into a bean so that it can be wired with the datasource bean.

      In any case, updateDatabase should defend against a null pool reference.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mwood Mark H. Wood
                Reporter:
                mwood Mark H. Wood
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: