camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Freeman Fang (JIRA)" <>
Subject [jira] [Updated] (CAMEL-4308) commons-dbcp bundle used in camel feature.xml doesn't allow dynamic imports
Date Sat, 06 Aug 2011 13:37:27 GMT


Freeman Fang updated CAMEL-4308:

    Attachment: CAMEL-4308.patch

append patch which use smx wrapped commons-dbcp 1.4 bundle and also upgrade commons-dbcp version
used in camel to 1.4

> commons-dbcp bundle used in camel feature.xml doesn't allow dynamic imports
> ---------------------------------------------------------------------------
>                 Key: CAMEL-4308
>                 URL:
>             Project: Camel
>          Issue Type: Improvement
>            Reporter: Freeman Fang
>         Attachments: CAMEL-4308.patch
> currently the commons-dbcp bundle used in camel feature.xml doesn't allow dynamic imports,
it will cause exception like
> org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver'
> as 
> JDBC driver class not found actually is a common issue in OSGi container, this problem
generally from a bundle(let's say it bundle A, commons-dbcp in this case) using some code
like classForName(jdbc_driver_classname) to init a jdbc driver class, this is a big problem
in OSGi world, as if BundleA not import package for jdbc_driver_classname, we'll see the problem.
However BundleA actually can't know about package name for jdbc_driver_classname beforehand,
as the jdbc_driver_classname generally is passed in through configuration during runtime,
it can't be determined during build time, so we can't add correct package import when we generate
bundle A.
> The general solution is
> 1. add dynamic import for bundle A(commons-dbcp) 
> or 
> 2. create JDBC driver as a fragment bundle, and attach it to bundle A(bundle A is host
bundle now), so that all resource from fragment bundle is available for the host bundle.
> Solution 1 left less effort for end user and n servicemix wrapped commons-dbcp bundle
we already have dynamic-import header and I think camel features should use the  servicemix
wrapped commons-dbcp bundle as well.
> I will append a patch soon.

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message