cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nlivens <...@git.apache.org>
Subject [GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...
Date Mon, 23 May 2016 07:29:27 GMT
Github user nlivens commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1553#discussion_r64178488
  
    --- Diff: framework/db/src/com/cloud/utils/db/TransactionLegacy.java ---
    @@ -1014,6 +1014,13 @@ public static void initDataSource(Properties dbProps) {
                 if (dbProps.size() == 0)
                     return;
     
    +            try {
    +                // Explicitely load JDBC driver because it has been removed from the
classpath as part of commit c22659d76d73f00f41c13776c490e17a50aacd20
    +                Class.forName("com.mysql.jdbc.Driver");
    --- End diff --
    
    1. You are absolutely right, but I explicitly loaded this one because "mysql:jdbc" is
hardcoded in the connection URL as well.
    2. The problem is that the JAR is actually loaded (so Class.forName works), but the JDBC
driver is not auto-registering itself. Tomcat has a really specific way of auto-registering
its JDBC drivers.. https://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html#DriverManager,_the_service_provider_mechanism_and_memory_leaks



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message