[jira] [Created] (DBUTILS-81) DbUtils.loadDriver() uses Class.forName()

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (DBUTILS-81) DbUtils.loadDriver() uses Class.forName()

Alex D Herbert (Jira)
DbUtils.loadDriver() uses Class.forName()
-----------------------------------------

                 Key: DBUTILS-81
                 URL: https://issues.apache.org/jira/browse/DBUTILS-81
             Project: Commons DbUtils
          Issue Type: Bug
            Reporter: Simone Tripodi


The {{Class.forName()}} statement should be avoided due to potential OSGi issues - commons components are OSGi bundles!
The ClassLoader should be used instead to [load classes|http://download.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String)] and add a new method to pass custom ClassLoader.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (DBUTILS-81) DbUtils.loadDriver() uses Class.forName()

Alex D Herbert (Jira)

    [ https://issues.apache.org/jira/browse/DBUTILS-81?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13112470#comment-13112470 ]

Sebb commented on DBUTILS-81:
-----------------------------

Have you a suggested patch for this?

> DbUtils.loadDriver() uses Class.forName()
> -----------------------------------------
>
>                 Key: DBUTILS-81
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-81
>             Project: Commons DbUtils
>          Issue Type: Bug
>            Reporter: Simone Tripodi
>
> The {{Class.forName()}} statement should be avoided due to potential OSGi issues - commons components are OSGi bundles!
> The ClassLoader should be used instead to [load classes|http://download.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String)] and add a new method to pass custom ClassLoader.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (DBUTILS-81) DbUtils.loadDriver() uses Class.forName()

Alex D Herbert (Jira)
In reply to this post by Alex D Herbert (Jira)

    [ https://issues.apache.org/jira/browse/DBUTILS-81?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13112498#comment-13112498 ]

Simone Tripodi commented on DBUTILS-81:
---------------------------------------

I can provide one, it worths anyway having DBUTILS-80 fixed first

> DbUtils.loadDriver() uses Class.forName()
> -----------------------------------------
>
>                 Key: DBUTILS-81
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-81
>             Project: Commons DbUtils
>          Issue Type: Bug
>            Reporter: Simone Tripodi
>
> The {{Class.forName()}} statement should be avoided due to potential OSGi issues - commons components are OSGi bundles!
> The ClassLoader should be used instead to [load classes|http://download.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String)] and add a new method to pass custom ClassLoader.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (DBUTILS-81) DbUtils.loadDriver() uses Class.forName()

Alex D Herbert (Jira)
In reply to this post by Alex D Herbert (Jira)

     [ https://issues.apache.org/jira/browse/DBUTILS-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simone Tripodi updated DBUTILS-81:
----------------------------------

    Attachment: DBUTILS-81.patch

Please take a loot at the proposed patch, if it works for you I can commit.
Looking forward your feedback

> DbUtils.loadDriver() uses Class.forName()
> -----------------------------------------
>
>                 Key: DBUTILS-81
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-81
>             Project: Commons DbUtils
>          Issue Type: Bug
>            Reporter: Simone Tripodi
>         Attachments: DBUTILS-81.patch
>
>
> The {{Class.forName()}} statement should be avoided due to potential OSGi issues - commons components are OSGi bundles!
> The ClassLoader should be used instead to [load classes|http://download.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String)] and add a new method to pass custom ClassLoader.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (DBUTILS-81) DbUtils.loadDriver() uses Class.forName()

Alex D Herbert (Jira)
In reply to this post by Alex D Herbert (Jira)

    [ https://issues.apache.org/jira/browse/DBUTILS-81?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114076#comment-13114076 ]

Simone Tripodi commented on DBUTILS-81:
---------------------------------------

Got a feedback from Neil Bartlett (one of the OSGi gurus) on [Twitter|http://twitter.com/#!/njbartlett/status/117709061654454273], going to commit the patch and asking for feedbacks on ML

> DbUtils.loadDriver() uses Class.forName()
> -----------------------------------------
>
>                 Key: DBUTILS-81
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-81
>             Project: Commons DbUtils
>          Issue Type: Bug
>            Reporter: Simone Tripodi
>         Attachments: DBUTILS-81.patch
>
>
> The {{Class.forName()}} statement should be avoided due to potential OSGi issues - commons components are OSGi bundles!
> The ClassLoader should be used instead to [load classes|http://download.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String)] and add a new method to pass custom ClassLoader.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (DBUTILS-81) DbUtils.loadDriver() uses Class.forName()

Alex D Herbert (Jira)
In reply to this post by Alex D Herbert (Jira)

    [ https://issues.apache.org/jira/browse/DBUTILS-81?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114078#comment-13114078 ]

Simone Tripodi commented on DBUTILS-81:
---------------------------------------

fixed on [r1175267|https://svn.apache.org/viewvc?view=revision&revision=1175267]

> DbUtils.loadDriver() uses Class.forName()
> -----------------------------------------
>
>                 Key: DBUTILS-81
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-81
>             Project: Commons DbUtils
>          Issue Type: Bug
>            Reporter: Simone Tripodi
>         Attachments: DBUTILS-81.patch
>
>
> The {{Class.forName()}} statement should be avoided due to potential OSGi issues - commons components are OSGi bundles!
> The ClassLoader should be used instead to [load classes|http://download.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String)] and add a new method to pass custom ClassLoader.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (DBUTILS-81) DbUtils.loadDriver() uses Class.forName()

Alex D Herbert (Jira)
In reply to this post by Alex D Herbert (Jira)

     [ https://issues.apache.org/jira/browse/DBUTILS-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simone Tripodi resolved DBUTILS-81.
-----------------------------------

    Resolution: Fixed
      Assignee: Simone Tripodi

fixed on [r1175267|https://svn.apache.org/viewvc?view=revision&revision=1175267]

> DbUtils.loadDriver() uses Class.forName()
> -----------------------------------------
>
>                 Key: DBUTILS-81
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-81
>             Project: Commons DbUtils
>          Issue Type: Bug
>            Reporter: Simone Tripodi
>            Assignee: Simone Tripodi
>         Attachments: DBUTILS-81.patch
>
>
> The {{Class.forName()}} statement should be avoided due to potential OSGi issues - commons components are OSGi bundles!
> The ClassLoader should be used instead to [load classes|http://download.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String)] and add a new method to pass custom ClassLoader.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (DBUTILS-81) DbUtils.loadDriver() uses Class.forName()

Alex D Herbert (Jira)
In reply to this post by Alex D Herbert (Jira)

     [ https://issues.apache.org/jira/browse/DBUTILS-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simone Tripodi updated DBUTILS-81:
----------------------------------

    Comment: was deleted

(was: fixed on [r1175267|https://svn.apache.org/viewvc?view=revision&revision=1175267])

> DbUtils.loadDriver() uses Class.forName()
> -----------------------------------------
>
>                 Key: DBUTILS-81
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-81
>             Project: Commons DbUtils
>          Issue Type: Bug
>            Reporter: Simone Tripodi
>         Attachments: DBUTILS-81.patch
>
>
> The {{Class.forName()}} statement should be avoided due to potential OSGi issues - commons components are OSGi bundles!
> The ClassLoader should be used instead to [load classes|http://download.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html#loadClass(java.lang.String)] and add a new method to pass custom ClassLoader.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira