Log4j 2
  1. Log4j 2
  2. LOG4J2-422

DriverManager for JDBC Appender should have argument for explicit Driver class

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta9
    • Fix Version/s: 2.0-rc1
    • Component/s: Appenders
    • Labels:
      None

      Description

      I had a situation where the DriverManager was unable to properly load the jdbc driver (Oracle) via url resolution alone. The DriverManager doesnt' currently allow you to explicitly specify the the driver. I resolved my situation by creating my own that accepts a driver parameter, but it seems like this should be added to the core

        Activity

        Hide
        Nick Williams added a comment -

        It sounds like you are using a driver that is not compliant with Java 6. Can you please tell me your database vendor, database version number, driver vendor, and driver version number?

        Show
        Nick Williams added a comment - It sounds like you are using a driver that is not compliant with Java 6. Can you please tell me your database vendor, database version number, driver vendor, and driver version number?
        Hide
        erich oliphant added a comment - - edited

        Hi I'm using the Oracle JDBC driver with database 11g. Driver Major version is 11, minor version is 2. I did a lot of poking around. The driver ojdbc.jar does have the service provider stuff, but it's just not being picked up for some reason.

        Show
        erich oliphant added a comment - - edited Hi I'm using the Oracle JDBC driver with database 11g. Driver Major version is 11, minor version is 2. I did a lot of poking around. The driver ojdbc.jar does have the service provider stuff, but it's just not being picked up for some reason.
        Hide
        Nick Williams added a comment -

        Hmmmm. That's odd. Can you tell me a bit about your application/environment? Is this a web application, and if so what application server are you using? Details like that would be helpful.

        Show
        Nick Williams added a comment - Hmmmm. That's odd. Can you tell me a bit about your application/environment? Is this a web application, and if so what application server are you using? Details like that would be helpful.
        Hide
        erich oliphant added a comment -

        Sure it's a Spring Integration app deployed as a war/webapp. If you have STS, it's based on one of their templates "Spring Integration Template (War). It's deployed into the bundled tcServer dev edition 2.9 (which I think corresponds to tomcat 7)

        Show
        erich oliphant added a comment - Sure it's a Spring Integration app deployed as a war/webapp. If you have STS, it's based on one of their templates "Spring Integration Template (War). It's deployed into the bundled tcServer dev edition 2.9 (which I think corresponds to tomcat 7)
        Hide
        Nick Williams added a comment -

        This issue is fixed with r1565838. However, the fix does not actually fix the <DriverManager...> connection source plugin—it removes it. This plugin is not safe and can't use a connection pool. Starting with rc1 you will need to either use the <DataSource...> or <ConnectionFactory...> connection source plugins, instead, and they should be backed with a connection pool. The updated site documentation will explain this further once rc1 is released.

        Show
        Nick Williams added a comment - This issue is fixed with r1565838. However, the fix does not actually fix the <DriverManager...> connection source plugin—it removes it. This plugin is not safe and can't use a connection pool. Starting with rc1 you will need to either use the <DataSource...> or <ConnectionFactory...> connection source plugins, instead, and they should be backed with a connection pool. The updated site documentation will explain this further once rc1 is released.
        Hide
        Nick Williams added a comment -

        Closing because not an issue anymore.

        Show
        Nick Williams added a comment - Closing because not an issue anymore.

          People

          • Assignee:
            Nick Williams
            Reporter:
            erich oliphant
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development