Re: H2 is missing org.osgi.service.jdbc in older OSGI environments

538 views
Skip to first unread message

Christoph Läubrich

unread,
May 7, 2013, 2:10:48 PM5/7/13
to h2-da...@googlegroups.com
This has nothing to do with "old" OSGi.
You can just drop in a bundle that provides the interface (eg the
reference compendium one).

Am 07.05.2013 16:33, schrieb Jacek Pospychała:
> hi,
>
> I've just hit an issue with h2-1.3.171.
> I see that it depends on org.osgi.service.jdbc package, which is
> unfortunately not available in my environment (Eclipse Equinox 3.7).
> It'd be cool if h2 could have this requirement optional only, to make
> it work with older osgi environments, that don't provide
> org.osgi.service.jdbc package.
>
> thanks
>
> Jacek
>
> --
> You received this message because you are subscribed to the Google
> Groups "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to h2-database...@googlegroups.com.
> To post to this group, send email to h2-da...@googlegroups.com.
> Visit this group at http://groups.google.com/group/h2-database?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

hoppinjohnz

unread,
Sep 19, 2013, 11:15:13 AM9/19/13
to h2-da...@googlegroups.com, lae...@googlemail.com
Christoph,
You are right. I have the same issue with h2-1.3-172 and Eclipse Luna 4.4M1.
Can you be a bit specific? Do you have such a droppable bundle example to share?
Thanks.

Christoph Läubrich

unread,
Sep 20, 2013, 1:12:01 AM9/20/13
to hoppinjohnz, h2-da...@googlegroups.com
find an example bundle attatched. It is using the official jdbc
interface from the OSGi spec, source and licence are embedded in the jar.

This only contains the JDBC part, you can also use the whole enterprise
code jar seen here:
http://www.osgi.org/Download/File?url=/download/r5/osgi.enterprise-5.0.0.jar
but that might provide more than you want/need so I prefere to split
these things up in individual jars as provided in the example.
org.osgi.service.jdbc_1.0.0.201309200704.jar

John Zhu

unread,
Sep 20, 2013, 6:53:45 PM9/20/13
to h2-da...@googlegroups.com
Christoph,

Thank you very much for the attached org.osgi.service.jdbc bundle example and the link to the full bundle.

In my Eclipse Luna RCP application, I found that just deleting the org.osgi.service.jdbc import line in the manifest.mf inside the h2-1.3-172.jar works as well. 

I hope this hack will not break h2, so far so good.


--
You received this message because you are subscribed to a topic in the Google Groups "H2 Database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/h2-database/inE---y60-I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to h2-database+unsubscribe@googlegroups.com.

To post to this group, send email to h2-da...@googlegroups.com.

Christoph Läubrich

unread,
Sep 22, 2013, 3:06:55 AM9/22/13
to h2-da...@googlegroups.com
It will work in the case you are using H2 directly, but will break the H2 OSGi integration. If you are not using H2 special features, you really should take a look at the OSGi JDBC spec since this will allow you to work with JDBC in a complete driver indipendent way.


Am 21.09.2013 00:53, schrieb John Zhu:
Christoph,

Thank you very much for the attached org.osgi.service.jdbc bundle example and the link to the full bundle.

In my Eclipse Luna RCP application, I found that just deleting the org.osgi.service.jdbc import line in the manifest.mf inside the h2-1.3-172.jar works as well. 

I hope this hack will not break h2, so far so good.
On Fri, Sep 20, 2013 at 1:12 AM, Christoph Läubrich <lae...@googlemail.com> wrote:
find an example bundle attatched. It is using the official jdbc interface from the OSGi spec, source and licence are embedded in the jar.

This only contains the JDBC part, you can also use the whole enterprise code jar seen here: http://www.osgi.org/Download/File?url=/download/r5/osgi.enterprise-5.0.0.jar but that might provide more than you want/need so I prefere to split these things up in individual jars as provided in the example.

Am 19.09.2013 17:15, schrieb hoppinjohnz:

Christoph,
You are right. I have the same issue with h2-1.3-172 and Eclipse Luna 4.4M1.
Can you be a bit specific? Do you have such a droppable bundle example to share?
Thanks.


--
You received this message because you are subscribed to a topic in the Google Groups "H2 Database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/h2-database/inE---y60-I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to h2-database...@googlegroups.com.

To post to this group, send email to h2-da...@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.

To unsubscribe from this group and stop receiving emails from it, send an email to h2-database...@googlegroups.com.

Matthew Painter

unread,
Nov 28, 2013, 4:47:39 AM11/28/13
to h2-da...@googlegroups.com, lae...@googlemail.com
To weigh in on an old thread here, it should be optional as per the OSGi spec.

Optional dependencies are only required to use certain functionality - using h2's OSGi JDBC within OSGi is optional and therefore the dependency should be optional.

Matt

Christoph Läubrich

unread,
Nov 28, 2013, 8:08:12 AM11/28/13
to h2-da...@googlegroups.com
It depends, for providing the JDBC Service it is not optional. And if it were optional, special care has to be taken in the activator to handle exceptions due to missing classes.
Beside this the JDBC Service is the way to obtain JDBC Connections so there is no real point in making it optional.
Reply all
Reply to author
Forward
0 new messages