[jira] [Created] (DBCP-363) dbcp bundle should use DynamicImport

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

[jira] [Created] (DBCP-363) dbcp bundle should use DynamicImport

Gilles (Jira)
dbcp bundle should use DynamicImport
------------------------------------

                 Key: DBCP-363
                 URL: https://issues.apache.org/jira/browse/DBCP-363
             Project: Commons Dbcp
          Issue Type: Bug
    Affects Versions: 1.4, 1.3
            Reporter: Felix Mayerhuber


The bundle provided in the maven central of the commons.dbcp doesn't have a DynamicImport defined. This resolves in following error:
If you want to use a BasicDataSource class as dataSource and the class is provided by the osgi environment (equinox, ...) the dataSource is not able to be created due to a ClassNotFoundException. If the bundle would have set DynamicImport it works. (I had to change from your bundle to the commons.dbcp bundle provided by servicemix, because there the DynamicImport is set)

--
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] (DBCP-363) dbcp bundle should use DynamicImport

Gilles (Jira)

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

Holger Hoffstätte commented on DBCP-363:
----------------------------------------

The whole purpose of OSGi is to *prevent* the kind of unfettered access and more or less random class wiring established by DynamicImport; it's a bad practice that should die out. Instead of letting dbcp blindly create instances the right thing to do would be use proper OSGi lookup of a DataSource through an OSGi-aware factory.


> dbcp bundle should use DynamicImport
> ------------------------------------
>
>                 Key: DBCP-363
>                 URL: https://issues.apache.org/jira/browse/DBCP-363
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.3, 1.4
>            Reporter: Felix Mayerhuber
>
> The bundle provided in the maven central of the commons.dbcp doesn't have a DynamicImport defined. This resolves in following error:
> If you want to use a BasicDataSource class as dataSource and the class is provided by the osgi environment (equinox, ...) the dataSource is not able to be created due to a ClassNotFoundException. If the bundle would have set DynamicImport it works. (I had to change from your bundle to the commons.dbcp bundle provided by servicemix, because there the DynamicImport is set)

--
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] [Issue Comment Edited] (DBCP-363) dbcp bundle should use DynamicImport

Gilles (Jira)
In reply to this post by Gilles (Jira)

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

Holger Hoffstätte edited comment on DBCP-363 at 6/11/11 8:58 AM:
-----------------------------------------------------------------

The whole purpose of OSGi is to *prevent* the kind of unfettered access and more or less random class wiring established by DynamicImport; it's a bad practice that should die out. Instead of letting dbcp blindly create instances the right thing to do would be use proper OSGi lookup of a DataSource through an OSGi-aware factory.
See: http://www.osgi.org/javadoc/r4v42/org/osgi/service/jdbc/DataSourceFactory.html



      was (Author: h2o):
    The whole purpose of OSGi is to *prevent* the kind of unfettered access and more or less random class wiring established by DynamicImport; it's a bad practice that should die out. Instead of letting dbcp blindly create instances the right thing to do would be use proper OSGi lookup of a DataSource through an OSGi-aware factory.

 

> dbcp bundle should use DynamicImport
> ------------------------------------
>
>                 Key: DBCP-363
>                 URL: https://issues.apache.org/jira/browse/DBCP-363
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.3, 1.4
>            Reporter: Felix Mayerhuber
>
> The bundle provided in the maven central of the commons.dbcp doesn't have a DynamicImport defined. This resolves in following error:
> If you want to use a BasicDataSource class as dataSource and the class is provided by the osgi environment (equinox, ...) the dataSource is not able to be created due to a ClassNotFoundException. If the bundle would have set DynamicImport it works. (I had to change from your bundle to the commons.dbcp bundle provided by servicemix, because there the DynamicImport is set)

--
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] (DBCP-363) dbcp bundle should use DynamicImport

Gilles (Jira)
In reply to this post by Gilles (Jira)

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

Phil Steitz updated DBCP-363:
-----------------------------

    Fix Version/s: 1.4.1
   

> dbcp bundle should use DynamicImport
> ------------------------------------
>
>                 Key: DBCP-363
>                 URL: https://issues.apache.org/jira/browse/DBCP-363
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.3, 1.4
>            Reporter: Felix Mayerhuber
>             Fix For: 1.4.1
>
>
> The bundle provided in the maven central of the commons.dbcp doesn't have a DynamicImport defined. This resolves in following error:
> If you want to use a BasicDataSource class as dataSource and the class is provided by the osgi environment (equinox, ...) the dataSource is not able to be created due to a ClassNotFoundException. If the bundle would have set DynamicImport it works. (I had to change from your bundle to the commons.dbcp bundle provided by servicemix, because there the DynamicImport is set)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (DBCP-363) dbcp bundle should use DynamicImport

Gilles (Jira)
In reply to this post by Gilles (Jira)

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

Jukka Zitting commented on DBCP-363:
------------------------------------

Having DynamicImport in place does not prevent DBCP from also using the DataSourceFactory mechanism in OSGi.

Meanwhile defining DynamicImport for DBCP does solve the problem for cases where the JDBC driver exports the relevant driver classes but does not (yet) implement a DataSourceFactory service.
               

> dbcp bundle should use DynamicImport
> ------------------------------------
>
>                 Key: DBCP-363
>                 URL: https://issues.apache.org/jira/browse/DBCP-363
>             Project: Commons Dbcp
>          Issue Type: Bug
>    Affects Versions: 1.3, 1.4
>            Reporter: Felix Mayerhuber
>             Fix For: 1.4.1
>
>
> The bundle provided in the maven central of the commons.dbcp doesn't have a DynamicImport defined. This resolves in following error:
> If you want to use a BasicDataSource class as dataSource and the class is provided by the osgi environment (equinox, ...) the dataSource is not able to be created due to a ClassNotFoundException. If the bundle would have set DynamicImport it works. (I had to change from your bundle to the commons.dbcp bundle provided by servicemix, because there the DynamicImport is set)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira