You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Larry T <la...@touve.net> on 2010/11/11 18:48:01 UTC

Oracle JDBC in OSGI

I'm trying to migrate a simple application into our OSGi framework.  I've got
the typical code that does:

Class.forName("oracle.jdbc.driver.OracleDriver");
connection = DriverManager.getConnection(url, user, pass);

and i get a CNFE on the driver.  I don't have an OSGi-ified ojdbc6.jar
bundle, so I tried to embed the stuff in my bundle by using the following in
my pom:

<Embed-Dependency>*;scope=compile;artifactId=ojdbc6</Embed-Dependency>

Which gets past the CNFE, but then I get the following when deploying my
bundle:

org.osgi.framework.BundleException: Unresolved constraint in bundle <my
bundle name>: Unable to reolve 275.0: missing requirement [275.0] package;
(package=com.sun.security.auth.module)

I don't want to go down the path of finding all dependencies and embedding
them.  Isn't there an OSGi-ified bundle for ojdbc6.jar around?  There must
be others who are using JDBC from within OSGi, right?

Thanks,
 Larry
-- 
View this message in context: http://old.nabble.com/Oracle-JDBC-in-OSGI-tp30192290p30192290.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Oracle JDBC in OSGI

Posted by Allen Lau <al...@gmail.com>.
I use the jdbc driver from SpringSource and it works fine connecting to
Oracle.

Here's the link:
http://ebr.springsource.com/repository/app/bundle/version/detail?name=com.springsource.oracle.jdbc&version=10.2.0.2&searchType=bundlesByName&searchQuery=jdbc

On Thu, Nov 11, 2010 at 9:48 AM, Larry T <la...@touve.net> wrote:

>
> I'm trying to migrate a simple application into our OSGi framework.  I've
> got
> the typical code that does:
>
> Class.forName("oracle.jdbc.driver.OracleDriver");
> connection = DriverManager.getConnection(url, user, pass);
>
> and i get a CNFE on the driver.  I don't have an OSGi-ified ojdbc6.jar
> bundle, so I tried to embed the stuff in my bundle by using the following
> in
> my pom:
>
> <Embed-Dependency>*;scope=compile;artifactId=ojdbc6</Embed-Dependency>
>
> Which gets past the CNFE, but then I get the following when deploying my
> bundle:
>
> org.osgi.framework.BundleException: Unresolved constraint in bundle <my
> bundle name>: Unable to reolve 275.0: missing requirement [275.0] package;
> (package=com.sun.security.auth.module)
>
> I don't want to go down the path of finding all dependencies and embedding
> them.  Isn't there an OSGi-ified bundle for ojdbc6.jar around?  There must
> be others who are using JDBC from within OSGi, right?
>
> Thanks,
>  Larry
> --
> View this message in context:
> http://old.nabble.com/Oracle-JDBC-in-OSGI-tp30192290p30192290.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Oracle JDBC in OSGI

Posted by David Bosschaert <da...@gmail.com>.
Just as a note. Supporting JDBC in OSGi has been standardized in the
OSGi 4.2 Enterprise Release (chapter 125) [1].

So if you get a JDBC driver that supports that specification you can
obtain your JDBC drivers through the OSGi service registry without any
classloader tricks.

Best regards,

David

[1] http://www.osgi.org/Download/Release4V42

On 11 November 2010 22:43, Joel Schuster <jo...@navsys.com> wrote:
> If you must use the JDBC driver directly then the issue is with the classloader as the DriverManager is trying to load it 'behind the scenes'. Read my blog article on how to work around this:
>
> http://joelschuster.blogspot.com/
>
> However, I highly recommend using JPA via Eclipselink instead which works great with OSGi.
>
> For the Oracle Driver... we OSGi-ified it using bnd. The turns the ojdbc6.jar into a OSGi bundle which then is used by EclipseLink.
>
> - Joel
>
> ________________________________________
> From: Justin Edelson [justinedelson@gmail.com] On Behalf Of Justin Edelson [justin@justinedelson.com]
> Sent: Thursday, November 11, 2010 10:55 AM
> To: users@felix.apache.org
> Subject: Re: Oracle JDBC in OSGI
>
> Ask Oracle.
>
> On Nov 11, 2010, at 12:48 PM, Larry T <la...@touve.net> wrote:
>
>>
>> I'm trying to migrate a simple application into our OSGi framework.  I've got
>> the typical code that does:
>>
>> Class.forName("oracle.jdbc.driver.OracleDriver");
>> connection = DriverManager.getConnection(url, user, pass);
>>
>> and i get a CNFE on the driver.  I don't have an OSGi-ified ojdbc6.jar
>> bundle, so I tried to embed the stuff in my bundle by using the following in
>> my pom:
>>
>> <Embed-Dependency>*;scope=compile;artifactId=ojdbc6</Embed-Dependency>
>>
>> Which gets past the CNFE, but then I get the following when deploying my
>> bundle:
>>
>> org.osgi.framework.BundleException: Unresolved constraint in bundle <my
>> bundle name>: Unable to reolve 275.0: missing requirement [275.0] package;
>> (package=com.sun.security.auth.module)
>>
>> I don't want to go down the path of finding all dependencies and embedding
>> them.  Isn't there an OSGi-ified bundle for ojdbc6.jar around?  There must
>> be others who are using JDBC from within OSGi, right?
>>
>> Thanks,
>> Larry
>> --
>> View this message in context: http://old.nabble.com/Oracle-JDBC-in-OSGI-tp30192290p30192290.html
>> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


RE: Oracle JDBC in OSGI

Posted by Joel Schuster <jo...@Navsys.com>.
If you must use the JDBC driver directly then the issue is with the classloader as the DriverManager is trying to load it 'behind the scenes'. Read my blog article on how to work around this:

http://joelschuster.blogspot.com/

However, I highly recommend using JPA via Eclipselink instead which works great with OSGi.

For the Oracle Driver... we OSGi-ified it using bnd. The turns the ojdbc6.jar into a OSGi bundle which then is used by EclipseLink.

- Joel

________________________________________
From: Justin Edelson [justinedelson@gmail.com] On Behalf Of Justin Edelson [justin@justinedelson.com]
Sent: Thursday, November 11, 2010 10:55 AM
To: users@felix.apache.org
Subject: Re: Oracle JDBC in OSGI

Ask Oracle.

On Nov 11, 2010, at 12:48 PM, Larry T <la...@touve.net> wrote:

>
> I'm trying to migrate a simple application into our OSGi framework.  I've got
> the typical code that does:
>
> Class.forName("oracle.jdbc.driver.OracleDriver");
> connection = DriverManager.getConnection(url, user, pass);
>
> and i get a CNFE on the driver.  I don't have an OSGi-ified ojdbc6.jar
> bundle, so I tried to embed the stuff in my bundle by using the following in
> my pom:
>
> <Embed-Dependency>*;scope=compile;artifactId=ojdbc6</Embed-Dependency>
>
> Which gets past the CNFE, but then I get the following when deploying my
> bundle:
>
> org.osgi.framework.BundleException: Unresolved constraint in bundle <my
> bundle name>: Unable to reolve 275.0: missing requirement [275.0] package;
> (package=com.sun.security.auth.module)
>
> I don't want to go down the path of finding all dependencies and embedding
> them.  Isn't there an OSGi-ified bundle for ojdbc6.jar around?  There must
> be others who are using JDBC from within OSGi, right?
>
> Thanks,
> Larry
> --
> View this message in context: http://old.nabble.com/Oracle-JDBC-in-OSGI-tp30192290p30192290.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Oracle JDBC in OSGI

Posted by Justin Edelson <ju...@justinedelson.com>.
Ask Oracle.

On Nov 11, 2010, at 12:48 PM, Larry T <la...@touve.net> wrote:

> 
> I'm trying to migrate a simple application into our OSGi framework.  I've got
> the typical code that does:
> 
> Class.forName("oracle.jdbc.driver.OracleDriver");
> connection = DriverManager.getConnection(url, user, pass);
> 
> and i get a CNFE on the driver.  I don't have an OSGi-ified ojdbc6.jar
> bundle, so I tried to embed the stuff in my bundle by using the following in
> my pom:
> 
> <Embed-Dependency>*;scope=compile;artifactId=ojdbc6</Embed-Dependency>
> 
> Which gets past the CNFE, but then I get the following when deploying my
> bundle:
> 
> org.osgi.framework.BundleException: Unresolved constraint in bundle <my
> bundle name>: Unable to reolve 275.0: missing requirement [275.0] package;
> (package=com.sun.security.auth.module)
> 
> I don't want to go down the path of finding all dependencies and embedding
> them.  Isn't there an OSGi-ified bundle for ojdbc6.jar around?  There must
> be others who are using JDBC from within OSGi, right?
> 
> Thanks,
> Larry
> -- 
> View this message in context: http://old.nabble.com/Oracle-JDBC-in-OSGI-tp30192290p30192290.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Oracle JDBC in OSGI

Posted by mv...@comcast.net.

Larry, 



A number of us have slogged through getting Oracle and JDBC to work inside of Felix.  To expand the number of answers you can get as you work through this process, I invite you to check out the Karaf user-group also. http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html 



v/r, 



Mike Van 


----- Original Message ----- 
From: "Larry T" <la...@touve.net> 
To: users@felix.apache.org 
Sent: Thursday, November 11, 2010 12:48:01 PM 
Subject: Oracle JDBC in OSGI 


I'm trying to migrate a simple application into our OSGi framework.  I've got 
the typical code that does: 

Class.forName("oracle.jdbc.driver.OracleDriver"); 
connection = DriverManager.getConnection(url, user, pass); 

and i get a CNFE on the driver.  I don't have an OSGi-ified ojdbc6.jar 
bundle, so I tried to embed the stuff in my bundle by using the following in 
my pom: 

<Embed-Dependency>*;scope=compile;artifactId=ojdbc6</Embed-Dependency> 

Which gets past the CNFE, but then I get the following when deploying my 
bundle: 

org.osgi.framework.BundleException: Unresolved constraint in bundle <my 
bundle name>: Unable to reolve 275.0: missing requirement [275.0] package; 
(package=com.sun.security.auth.module) 

I don't want to go down the path of finding all dependencies and embedding 
them.  Isn't there an OSGi-ified bundle for ojdbc6.jar around?  There must 
be others who are using JDBC from within OSGi, right? 

Thanks, 
 Larry 
-- 
View this message in context: http://old.nabble.com/Oracle-JDBC-in-OSGI-tp30192290p30192290.html 
Sent from the Apache Felix - Users mailing list archive at Nabble.com. 


--------------------------------------------------------------------- 
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org 
For additional commands, e-mail: users-help@felix.apache.org