db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Müller (JIRA) <j...@apache.org>
Subject [jira] [Commented] (DERBY-6069) Derby doesn't export the version number in its OSGI exported packages
Date Tue, 26 Mar 2013 17:53:16 GMT

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

Christian Müller commented on DERBY-6069:
-----------------------------------------

[~rhillegas]: You are right. Split packages are problematic in OSGI. You have (at least) to
options:
1) Rename one of the package. Disadvantage: This may break backwards compatibility.
2) Create an Uber Jar/Bundle as the ServiceMix guys did it already (derby, derbyclient, derbynet).
Disadvantage: It's not best practice to provide one big giant bundle with classes (and may
dependencies) which are not needed for some use cases.

It looks like IBM provide an Ant task for this: http://publib.boulder.ibm.com/infocenter/radhelp/v8/index.jsp?topic=%2Fcom.ibm.ant.tasks.doc%2Ftopics%2Fph-antosgi.html.
May be this is an option? Listing the package exports and imports in the build file is brittle
as you said.

Your localization jars will become fragment bundles (http://wiki.osgi.org/wiki/Fragment).
In this case, the host bundle (e.g. derby.jar) will share the same class loader with all fragment
bundles.

For unit testing your bundles, you could use Pax Exam (https://ops4j1.jira.com/wiki/display/paxexam/Pax+Exam)
which we use in Camel, Karaf, ServiceMix, ...

I hope this make it more clear.
                
> Derby doesn't export the version number in its OSGI exported packages
> ---------------------------------------------------------------------
>
>                 Key: DERBY-6069
>                 URL: https://issues.apache.org/jira/browse/DERBY-6069
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.9.1.0, 10.8.3.0
>            Reporter: Christian Müller
>              Labels: osgi
>         Attachments: MANIFEST.MF
>
>
> Derby doesn't export the version number in its OSGI exported packages. See the following
exports:
> {noformat}
> karaf@root> headers 259
> Apache Derby 10.8 (259)
> -----------------------
> Manifest-Version = 1.0
> Ant-Version = Apache Ant 1.7.0
> Class-Path = derbyLocale_cs.jar derbyLocale_de_DE.jar derbyLocale_es.jar derbyLocale_fr.jar
derbyLocale_hu.jar derbyLocale_it.jar derbyLocal
> e_ja_JP.jar derbyLocale_ko_KR.jar derbyLocale_pl.jar derbyLocale_pt_BR.jar derbyLocale_ru.jar
derbyLocale_zh_CN.jar derbyLocale_zh_TW.jar
> Sealed = true
> Created-By = 2.4 (IBM Corporation)
> Bundle-Vendor = Apache Software Foundation
> Bundle-Activator = org.apache.derby.osgi.EmbeddedActivator
> Bundle-Name = Apache Derby 10.8
> Bundle-SymbolicName = derby
> Bundle-Version = 10.8.3000000.1405108
> Bundle-ManifestVersion = 2
> DynamicImport-Package =
>         *
> Export-Package =
>         org.apache.derby.authentication,
>         org.apache.derby.database,
>         org.apache.derby.io,
>         org.apache.derby.jdbc,
>         org.apache.derby.vti
> {noformat}
> {noformat}
> karaf@root> headers 250
> Apache Derby 10.9 (250)
> -----------------------
> Manifest-Version = 1.0
> Ant-Version = Apache Ant 1.7.1
> Class-Path = derbyLocale_cs.jar derbyLocale_de_DE.jar derbyLocale_es.jar derbyLocale_fr.jar
derbyLocale_hu.jar derbyLocale_it.jar derbyLocal
> e_ja_JP.jar derbyLocale_ko_KR.jar derbyLocale_pl.jar derbyLocale_pt_BR.jar derbyLocale_ru.jar
derbyLocale_zh_CN.jar derbyLocale_zh_TW.jar
> Sealed = true
> Created-By = 20.6-b01-415 (Apple Inc.)
> Bundle-Vendor = Apache Software Foundation
> Bundle-Activator = org.apache.derby.osgi.EmbeddedActivator
> Bundle-Name = Apache Derby 10.9
> Bundle-SymbolicName = derby
> Bundle-Version = 10.9.1000000.1344872
> Bundle-ManifestVersion = 2
> DynamicImport-Package =
>         *
> Export-Package =
>         org.apache.derby.authentication,
>         org.apache.derby.database,
>         org.apache.derby.io,
>         org.apache.derby.jdbc,
>         org.apache.derby.vti
> {noformat}
> This leads to problems, if other bundles imports derby packages with a specific version
or version range (like spring-jdbc do):
> {noformat}
> karaf@root> headers 251
> Spring JDBC (251)
> -----------------
> Manifest-Version = 1.0
> ...
> Import-Package =
>         ...
>         org.apache.derby.impl.io;resolution:=optional;version="[10.5.0, 11.0.0)",
>         org.apache.derby.jdbc;resolution:=optional;version="[10.5.0, 11.0.0)",
> ...
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message