1 Reply Latest reply on Mar 11, 2011 9:01 PM by Freeman(Yue) Fang

    Errors with datasources

    Manuel Lara Caro Novice

      I had a bundle with this datasource:




      Edited by: larasith on Mar 11, 2011 11:55 AM

        • 1. Re: Errors with datasources
          Freeman(Yue) Fang Master



          JDBC driver class not found actually is a frequently asked question, please see the similar discussion[1] and , this problem generally from a bundle(let's say it bundle A) 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, you'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 you can't add correct package import when you generate bundle A.


          The general solution for this issue is that you 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.