You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by nlivens <gi...@git.apache.org> on 2016/05/20 08:30:16 UTC

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

GitHub user nlivens opened a pull request:

    https://github.com/apache/cloudstack/pull/1553

    Explicitely load JDBC driver before creating our MySQL connections

    Solution to the mailing thread titled "MySQL : No suitable driver found for jdbc:mysql".
    It doesn't harm that we explicitely load the MySQL driver, and for those which would use a commons-dbcp version < 1.4 this would fix it as well. Since JDBC 4.0, the JDBC driver can auto-register itself, but for some weird cases (like mine), it's not working. Therefore we need to explicitly load the JDBC driver.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nlivens/cloudstack mysql_driver_issue

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack/pull/1553.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1553
    
----
commit 492c7f2612fdc022d78cd1064ca81e47eb201c04
Author: Nick Livens <ni...@nuagenetworks.net>
Date:   2016-05-20T08:20:48Z

    Explicitely load JDBC driver before creating our MySQL connections

----


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1553#discussion_r64223758
  
    --- Diff: build/replace.properties ---
    @@ -21,6 +21,7 @@ DBROOTPW=
     MSLOG=vmops.log
     APISERVERLOG=api.log
     DBHOST=localhost
    +DBPATH=jdbc:mysql
    --- End diff --
    
    maybe protocol/driver instead of path? in fact it contains protocol:driver


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1553#discussion_r64223544
  
    --- Diff: engine/storage/snapshot/test/resources/db.properties ---
    @@ -46,6 +47,8 @@ db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLi
     db.usage.username=cloud
     db.usage.password=cloud
     db.usage.host=localhost
    +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work
    --- End diff --
    
    :+1:
    of course it should, right ;)


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on the pull request:

    https://github.com/apache/cloudstack/pull/1553#issuecomment-220983955
  
    LGTM though it remains kluncy to some extend I think this is a considerable improvement over what we had


---
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.
---

[GitHub] cloudstack pull request: Dynamically load drivers before creating ...

Posted by swill <gi...@git.apache.org>.
Github user swill commented on the pull request:

    https://github.com/apache/cloudstack/pull/1553#issuecomment-221758855
  
    This is a known issue, so this one should be ready now.  Thx...


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by nlivens <gi...@git.apache.org>.
Github user nlivens commented on the pull request:

    https://github.com/apache/cloudstack/pull/1553#issuecomment-220599141
  
    @DaanHoogland, triggering you for review as well, this is only a small code change


---
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.
---

[GitHub] cloudstack pull request: Dynamically load drivers before creating ...

Posted by swill <gi...@git.apache.org>.
Github user swill commented on the pull request:

    https://github.com/apache/cloudstack/pull/1553#issuecomment-221758690
  
    
    
    ### CI RESULTS
    
    ```
    Tests Run: 83
      Skipped: 0
       Failed: 0
       Errors: 2
     Duration: 8h 39m 49s
    ```
    
    **Summary of the problem(s):**
    ```
    ERROR: test suite for <class 'integration.smoke.test_vpc_vpn.TestRVPCSite2SiteVpn'>
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/suite.py", line 209, in run
        self.setUp()
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/suite.py", line 292, in setUp
        self.setupContext(ancestor)
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/suite.py", line 315, in setupContext
        try_run(context, names)
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/util.py", line 471, in try_run
        return func()
      File "/data/git/cs1/cloudstack/test/integration/smoke/test_vpc_vpn.py", line 835, in setUpClass
        cls.template.download(cls.apiclient)
      File "/usr/lib/python2.7/site-packages/marvin/lib/base.py", line 1350, in download
        elif 'Downloaded' in template.status:
    TypeError: argument of type 'NoneType' is not iterable
    ----------------------------------------------------------------------
    Additional details in: /tmp/MarvinLogs/test_network_ZYSAN1/results.txt
    ```
    
    ```
    ERROR: test suite for <class 'integration.smoke.test_vpc_vpn.TestVpcRemoteAccessVpn'>
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/suite.py", line 209, in run
        self.setUp()
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/suite.py", line 292, in setUp
        self.setupContext(ancestor)
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/suite.py", line 315, in setupContext
        try_run(context, names)
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/util.py", line 471, in try_run
        return func()
      File "/data/git/cs1/cloudstack/test/integration/smoke/test_vpc_vpn.py", line 293, in setUpClass
        cls.template.download(cls.apiclient)
      File "/usr/lib/python2.7/site-packages/marvin/lib/base.py", line 1350, in download
        elif 'Downloaded' in template.status:
    TypeError: argument of type 'NoneType' is not iterable
    ----------------------------------------------------------------------
    Additional details in: /tmp/MarvinLogs/test_network_ZYSAN1/results.txt
    ```
    
    
    
    **Associated Uploads**
    
    **`/tmp/MarvinLogs/DeployDataCenter__May_25_2016_19_12_44_BK9DU4:`**
    * [dc_entries.obj](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/DeployDataCenter__May_25_2016_19_12_44_BK9DU4/dc_entries.obj)
    * [failed_plus_exceptions.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/DeployDataCenter__May_25_2016_19_12_44_BK9DU4/failed_plus_exceptions.txt)
    * [runinfo.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/DeployDataCenter__May_25_2016_19_12_44_BK9DU4/runinfo.txt)
    
    **`/tmp/MarvinLogs/test_network_ZYSAN1:`**
    * [failed_plus_exceptions.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/test_network_ZYSAN1/failed_plus_exceptions.txt)
    * [results.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/test_network_ZYSAN1/results.txt)
    * [runinfo.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/test_network_ZYSAN1/runinfo.txt)
    
    **`/tmp/MarvinLogs/test_vpc_routers_KJ1ZG0:`**
    * [failed_plus_exceptions.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/test_vpc_routers_KJ1ZG0/failed_plus_exceptions.txt)
    * [results.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/test_vpc_routers_KJ1ZG0/results.txt)
    * [runinfo.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/test_vpc_routers_KJ1ZG0/runinfo.txt)
    
    
    Uploads will be available until `2016-07-26 02:00:00 +0200 CEST`
    
    *Comment created by [`upr comment`](https://github.com/cloudops/upr).*



---
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.
---

[GitHub] cloudstack pull request: Dynamically load drivers before creating ...

Posted by swill <gi...@git.apache.org>.
Github user swill commented on the pull request:

    https://github.com/apache/cloudstack/pull/1553#issuecomment-221634279
  
    
    
    ### CI RESULTS
    
    ```
    Tests Run: 83
      Skipped: 0
       Failed: 1
       Errors: 2
     Duration: 8h 32m 15s
    ```
    
    **Summary of the problem(s):**
    ```
    ERROR: test suite for <class 'integration.smoke.test_vpc_vpn.TestVpcRemoteAccessVpn'>
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/suite.py", line 209, in run
        self.setUp()
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/suite.py", line 292, in setUp
        self.setupContext(ancestor)
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/suite.py", line 315, in setupContext
        try_run(context, names)
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/util.py", line 471, in try_run
        return func()
      File "/data/git/cs1/cloudstack/test/integration/smoke/test_vpc_vpn.py", line 293, in setUpClass
        cls.template.download(cls.apiclient)
      File "/usr/lib/python2.7/site-packages/marvin/lib/base.py", line 1350, in download
        elif 'Downloaded' in template.status:
    TypeError: argument of type 'NoneType' is not iterable
    ----------------------------------------------------------------------
    Additional details in: /tmp/MarvinLogs/test_network_GHJEO9/results.txt
    ```
    
    ```
    ERROR: test suite for <class 'integration.smoke.test_vpc_vpn.TestVpcSite2SiteVpn'>
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/suite.py", line 209, in run
        self.setUp()
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/suite.py", line 292, in setUp
        self.setupContext(ancestor)
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/suite.py", line 315, in setupContext
        try_run(context, names)
      File "/usr/lib/python2.7/site-packages/nose-1.3.7-py2.7.egg/nose/util.py", line 471, in try_run
        return func()
      File "/data/git/cs1/cloudstack/test/integration/smoke/test_vpc_vpn.py", line 472, in setUpClass
        cls.template.download(cls.apiclient)
      File "/usr/lib/python2.7/site-packages/marvin/lib/base.py", line 1350, in download
        elif 'Downloaded' in template.status:
    TypeError: argument of type 'NoneType' is not iterable
    ----------------------------------------------------------------------
    Additional details in: /tmp/MarvinLogs/test_network_GHJEO9/results.txt
    ```
    
    ```
    FAIL: test_02_vpc_privategw_static_routes (integration.smoke.test_privategw_acl.TestPrivateGwACL)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/data/git/cs1/cloudstack/test/integration/smoke/test_privategw_acl.py", line 262, in test_02_vpc_privategw_static_routes
        self.performVPCTests(vpc_off)
      File "/data/git/cs1/cloudstack/test/integration/smoke/test_privategw_acl.py", line 325, in performVPCTests
        privateGw_1 = self.createPvtGw(vpc_1, "10.0.3.100", "10.0.3.101", acl1.id, vlan_1)
      File "/data/git/cs1/cloudstack/test/integration/smoke/test_privategw_acl.py", line 595, in createPvtGw
        self.fail("Failed to create Private Gateway ==> %s" % e)
    AssertionError: Failed to create Private Gateway ==> Execute cmd: createprivategateway failed, due to: errorCode: 431, errorText:Network with vlan vlan://100 already exists in zone 1
    ----------------------------------------------------------------------
    Additional details in: /tmp/MarvinLogs/test_network_GHJEO9/results.txt
    ```
    
    
    
    **Associated Uploads**
    
    **`/tmp/MarvinLogs/DeployDataCenter__May_24_2016_06_35_59_8X66H9:`**
    * [dc_entries.obj](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/DeployDataCenter__May_24_2016_06_35_59_8X66H9/dc_entries.obj)
    * [failed_plus_exceptions.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/DeployDataCenter__May_24_2016_06_35_59_8X66H9/failed_plus_exceptions.txt)
    * [runinfo.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/DeployDataCenter__May_24_2016_06_35_59_8X66H9/runinfo.txt)
    
    **`/tmp/MarvinLogs/test_network_GHJEO9:`**
    * [failed_plus_exceptions.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/test_network_GHJEO9/failed_plus_exceptions.txt)
    * [results.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/test_network_GHJEO9/results.txt)
    * [runinfo.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/test_network_GHJEO9/runinfo.txt)
    
    **`/tmp/MarvinLogs/test_vpc_routers_URJGF9:`**
    * [failed_plus_exceptions.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/test_vpc_routers_URJGF9/failed_plus_exceptions.txt)
    * [results.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/test_vpc_routers_URJGF9/results.txt)
    * [runinfo.txt](https://objects-east.cloud.ca/v1/e465abe2f9ae4478b9fff416eab61bd9/PR1553/tmp/MarvinLogs/test_vpc_routers_URJGF9/runinfo.txt)
    
    
    Uploads will be available until `2016-07-25 02:00:00 +0200 CEST`
    
    *Comment created by [`upr comment`](https://github.com/cloudops/upr).*



---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1553#discussion_r64179203
  
    --- 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 --
    
    ad 1. so we can use a property that is used for both, right?
    ad 2. fair enough, thanks.


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by rhtyd <gi...@git.apache.org>.
Github user rhtyd commented on the pull request:

    https://github.com/apache/cloudstack/pull/1553#issuecomment-220547372
  
    LGTM, I am aware about the issue and the changes are therefore needed. Thanks @nlivens 


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by nlivens <gi...@git.apache.org>.
Github user nlivens commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1553#discussion_r64223798
  
    --- Diff: engine/storage/snapshot/test/resources/db.properties ---
    @@ -46,6 +47,8 @@ db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLi
     db.usage.username=cloud
     db.usage.password=cloud
     db.usage.host=localhost
    +# It's not guaranteed that using a different DB provider than the one from the regular cloud DB will work
    --- End diff --
    
    Yeah, it should work, it's just a matter of using a different driver, but unfortunately I'm not able to test such a setup :)


---
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.
---

[GitHub] cloudstack pull request: Dynamically load drivers before creating ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cloudstack/pull/1553


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by nlivens <gi...@git.apache.org>.
Github user nlivens commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1553#discussion_r64195563
  
    --- 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 --
    
    Sure thing, I'll add it to this PR once ready


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on the pull request:

    https://github.com/apache/cloudstack/pull/1553#issuecomment-220987228
  
    ping @swill tag:<your favorite let's take the next step tag here>


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1553#discussion_r64040574
  
    --- 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 --
    
    two questions:
    hardcoded driver name?; now that we can shouldn't we prepare for a MariaDB driver to be loaded instead?
    if it is not on the classpath how is this going to help, then? Class.forName(..) will search the classpath


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by nlivens <gi...@git.apache.org>.
Github user nlivens commented on the pull request:

    https://github.com/apache/cloudstack/pull/1553#issuecomment-220986821
  
    Changed db.x.path to db.x.driver as @DaanHoogland suggested


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on the pull request:

    https://github.com/apache/cloudstack/pull/1553#issuecomment-220976080
  
    @nlivens supakoel


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1553#discussion_r64223844
  
    --- Diff: client/tomcatconf/db.properties.in ---
    @@ -25,6 +25,7 @@ region.id=1
     db.cloud.username=@DBUSER@
     db.cloud.password=@DBPW@
     db.cloud.host=@DBHOST@
    +db.cloud.path=@DBPATH@
    --- End diff --
    
    same as above: it contains protocol:driver, not a path


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by nlivens <gi...@git.apache.org>.
Github user nlivens commented on the pull request:

    https://github.com/apache/cloudstack/pull/1553#issuecomment-220546975
  
    @swill, @rhtyd, @kiwiflyer, triggering you guys because you were part of this mailing thread.


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by DaanHoogland <gi...@git.apache.org>.
Github user DaanHoogland commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1553#discussion_r64193717
  
    --- 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 --
    
    If you can make it work without noticing the time you spend on it, please. I would go for db.driver.path btw, so we don't have to maintain a driver table in the code.


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by nlivens <gi...@git.apache.org>.
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by nlivens <gi...@git.apache.org>.
Github user nlivens commented on the pull request:

    https://github.com/apache/cloudstack/pull/1553#issuecomment-220974849
  
    @DaanHoogland, I've added the piece we were talking about, this can be found it the logs regarding loading the driver dynamically :
    > 2016-05-23 05:42:57,880 DEBUG [c.c.u.d.T.Transaction] (localhost-startStop-1:null) (logid:) Successfully loaded DB driver com.mysql.jdbc.Driver for connection jdbc:mysql://localhost:3306/cloud?autoReconnect=true&prepStmtCacheSize=517&cach
    ePrepStmts=true
    > 2016-05-23 05:42:57,896 DEBUG [c.c.u.d.T.Transaction] (localhost-startStop-1:null) (logid:) Successfully loaded DB driver com.mysql.jdbc.Driver for connection jdbc:mysql://localhost:3306/cloud_usage?autoReconnect=true&
    > 2016-05-23 05:42:57,898 DEBUG [c.c.u.d.T.Transaction] (localhost-startStop-1:null) (logid:) Successfully loaded DB driver com.mysql.jdbc.Driver for connection jdbc:mysql://localhost:3306/simulator?autoReconnect=true



---
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.
---

[GitHub] cloudstack pull request: Dynamically load drivers before creating ...

Posted by KrisSterckx <gi...@git.apache.org>.
Github user KrisSterckx commented on the pull request:

    https://github.com/apache/cloudstack/pull/1553#issuecomment-221024596
  
    @DaanHoogland moreover it is proven in Nuage lab to resolve the issues we had


---
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.
---

[GitHub] cloudstack pull request: Explicitely load JDBC driver before creat...

Posted by nlivens <gi...@git.apache.org>.
Github user nlivens commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1553#discussion_r64191953
  
    --- 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 --
    
    Yes, that can be changed to make use of a property value, shall I incorporate that change into this PR as well? :)
    A property called : "db.x.type" e.g. db.cloud.type=mysql / db.cloud.type=mariadb


---
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.
---