You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "JJ Snyder (JIRA)" <ji...@apache.org> on 2009/03/26 14:06:54 UTC

[jira] Created: (DERBY-4120) derbyclient.jar is not a complete OSGi bundle

derbyclient.jar is not a complete OSGi bundle
---------------------------------------------

                 Key: DERBY-4120
                 URL: https://issues.apache.org/jira/browse/DERBY-4120
             Project: Derby
          Issue Type: Bug
          Components: Eclipse Plug-in
    Affects Versions: 10.4.2.0
         Environment: OSGi
            Reporter: JJ Snyder


The manifest in derbyclient.jar is incomplete for usage in OSGi.  There are no packages exported.  This appears to only be a problem in standalone equinox (outside of eclipse).  Note that I did not try other OSGi containers.

The fix is relatively simple.  Adding the Export-Package manifest header should take care of the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-4120) derbyclient.jar is not a complete OSGi bundle

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-4120:
---------------------------------

         Component/s: Services
    Issue & fix info: [High Value Fix, Known fix]  (was: [High Value Fix])
             Urgency: Normal

Triaged July 2, 2009: Marked as "Known Fix".

> derbyclient.jar is not a complete OSGi bundle
> ---------------------------------------------
>
>                 Key: DERBY-4120
>                 URL: https://issues.apache.org/jira/browse/DERBY-4120
>             Project: Derby
>          Issue Type: Bug
>          Components: Eclipse Plug-in, Services
>    Affects Versions: 10.4.2.0
>         Environment: OSGi
>            Reporter: JJ Snyder
>
> The manifest in derbyclient.jar is incomplete for usage in OSGi.  There are no packages exported.  This appears to only be a problem in standalone equinox (outside of eclipse).  Note that I did not try other OSGi containers.
> The fix is relatively simple.  Adding the Export-Package manifest header should take care of the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4120) derbyclient.jar is not a complete OSGi bundle

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769140#action_12769140 ] 

Knut Anders Hatlen commented on DERBY-4120:
-------------------------------------------

I see that the list of exported packages in derby.jar is close to, but not exactly the same as the list of packages in the published API (http://db.apache.org/derby/javadoc/publishedapi/jdbc4/). Based on what you have found till now, do you think they should be identical?

Exporting org.apache.derby.jdbc in derbyclient.jar sounds like a fine, focused fix to the problem reported here, so +1 from me. (But all I know about this is what I read from the links you provided, so I'm definitely not an authority.)

> derbyclient.jar is not a complete OSGi bundle
> ---------------------------------------------
>
>                 Key: DERBY-4120
>                 URL: https://issues.apache.org/jira/browse/DERBY-4120
>             Project: Derby
>          Issue Type: Bug
>          Components: Eclipse Plug-in, Services
>    Affects Versions: 10.4.2.0
>         Environment: OSGi
>            Reporter: JJ Snyder
>            Assignee: Bryan Pendleton
>
> The manifest in derbyclient.jar is incomplete for usage in OSGi.  There are no packages exported.  This appears to only be a problem in standalone equinox (outside of eclipse).  Note that I did not try other OSGi containers.
> The fix is relatively simple.  Adding the Export-Package manifest header should take care of the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DERBY-4120) derbyclient.jar is not a complete OSGi bundle

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Pendleton reassigned DERBY-4120:
--------------------------------------

    Assignee: Bryan Pendleton

> derbyclient.jar is not a complete OSGi bundle
> ---------------------------------------------
>
>                 Key: DERBY-4120
>                 URL: https://issues.apache.org/jira/browse/DERBY-4120
>             Project: Derby
>          Issue Type: Bug
>          Components: Eclipse Plug-in, Services
>    Affects Versions: 10.4.2.0
>         Environment: OSGi
>            Reporter: JJ Snyder
>            Assignee: Bryan Pendleton
>
> The manifest in derbyclient.jar is incomplete for usage in OSGi.  There are no packages exported.  This appears to only be a problem in standalone equinox (outside of eclipse).  Note that I did not try other OSGi containers.
> The fix is relatively simple.  Adding the Export-Package manifest header should take care of the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4120) derbyclient.jar is not a complete OSGi bundle

Posted by "JJ Snyder (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769246#action_12769246 ] 

JJ Snyder commented on DERBY-4120:
----------------------------------

All packages that contain classes that clients may want to cast to the derby implementation must be exported.  For example, if you think that a client application wants to cast the Statement to org.apache.derby.client.am.PreparedStatement40 then the org.apache.derby.client.am package must be exported.

Exporting all of the packages gives client applications the option to directly access the classes in those packages.  So unless a package is intended to be private then it should probably be exported

> derbyclient.jar is not a complete OSGi bundle
> ---------------------------------------------
>
>                 Key: DERBY-4120
>                 URL: https://issues.apache.org/jira/browse/DERBY-4120
>             Project: Derby
>          Issue Type: Bug
>          Components: Eclipse Plug-in, Services
>    Affects Versions: 10.4.2.0
>         Environment: OSGi
>            Reporter: JJ Snyder
>            Assignee: Bryan Pendleton
>
> The manifest in derbyclient.jar is incomplete for usage in OSGi.  There are no packages exported.  This appears to only be a problem in standalone equinox (outside of eclipse).  Note that I did not try other OSGi containers.
> The fix is relatively simple.  Adding the Export-Package manifest header should take care of the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (DERBY-4120) derbyclient.jar is not a complete OSGi bundle

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren reopened DERBY-4120:
---------------------------------------

      Assignee: Myrna van Lunteren  (was: Bryan Pendleton)

Reopening to backport to 10.5. Changing assignee from Bryan to myself for that.

> derbyclient.jar is not a complete OSGi bundle
> ---------------------------------------------
>
>                 Key: DERBY-4120
>                 URL: https://issues.apache.org/jira/browse/DERBY-4120
>             Project: Derby
>          Issue Type: Bug
>          Components: Eclipse Plug-in, Services
>    Affects Versions: 10.4.2.0
>         Environment: OSGi
>            Reporter: JJ Snyder
>            Assignee: Myrna van Lunteren
>             Fix For: 10.6.1.0
>
>         Attachments: addToManifest.diff
>
>
> The manifest in derbyclient.jar is incomplete for usage in OSGi.  There are no packages exported.  This appears to only be a problem in standalone equinox (outside of eclipse).  Note that I did not try other OSGi containers.
> The fix is relatively simple.  Adding the Export-Package manifest header should take care of the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-4120) derbyclient.jar is not a complete OSGi bundle

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-4120:
----------------------------------

    Derby Categories: [Embedded/Client difference, High Value Fix]  (was: [Embedded/Client difference])

> derbyclient.jar is not a complete OSGi bundle
> ---------------------------------------------
>
>                 Key: DERBY-4120
>                 URL: https://issues.apache.org/jira/browse/DERBY-4120
>             Project: Derby
>          Issue Type: Bug
>          Components: Eclipse Plug-in
>    Affects Versions: 10.4.2.0
>         Environment: OSGi
>            Reporter: JJ Snyder
>
> The manifest in derbyclient.jar is incomplete for usage in OSGi.  There are no packages exported.  This appears to only be a problem in standalone equinox (outside of eclipse).  Note that I did not try other OSGi containers.
> The fix is relatively simple.  Adding the Export-Package manifest header should take care of the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4120) derbyclient.jar is not a complete OSGi bundle

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769009#action_12769009 ] 

Bryan Pendleton commented on DERBY-4120:
----------------------------------------

After reading through the papers a bit, and looking at the actual contents of derbyclient.jar,
it seems to me that the only thing we should put into the Manifest  for derbyclient.jar is:

Export-Package: org.apache.derby.jdbc

I think that all the other packages in derbyclient.jar are internal, and the only externally-visible
package should be the above package, which contains ClientDriver.class

I'll try that change, as it is the smallest and most focused.


> derbyclient.jar is not a complete OSGi bundle
> ---------------------------------------------
>
>                 Key: DERBY-4120
>                 URL: https://issues.apache.org/jira/browse/DERBY-4120
>             Project: Derby
>          Issue Type: Bug
>          Components: Eclipse Plug-in, Services
>    Affects Versions: 10.4.2.0
>         Environment: OSGi
>            Reporter: JJ Snyder
>            Assignee: Bryan Pendleton
>
> The manifest in derbyclient.jar is incomplete for usage in OSGi.  There are no packages exported.  This appears to only be a problem in standalone equinox (outside of eclipse).  Note that I did not try other OSGi containers.
> The fix is relatively simple.  Adding the Export-Package manifest header should take care of the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4120) derbyclient.jar is not a complete OSGi bundle

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768542#action_12768542 ] 

Bryan Pendleton commented on DERBY-4120:
----------------------------------------

Where do I go to learn more about Export-Package and what it should contain?

I did a bit of poking about in the 10.5.3.0 distribution of Derby, and I see:

- derby.jar's Manifest.mf contains the following Export-Package information:

Export-Package: org.apache.derby.authentication,org.apache.derby.datab
 ase,org.apache.derby.io,org.apache.derby.jdbc,org.apache.derby.vti

- none of the other Derby jar files (derbyclient.jar, derbytools.jar, derbynet.jar, derbyrun.jar)
  seem to contain Export-Package lines

So I guess my questions are:
1) Should we add Export-Package to *all* the Derby jar files? Or just derbyclient.jar?
2) What value should it contain? Is it the same for each Derby jar file? Or should it
have a different value in derbyclient.jar than it does in derby.jar?


> derbyclient.jar is not a complete OSGi bundle
> ---------------------------------------------
>
>                 Key: DERBY-4120
>                 URL: https://issues.apache.org/jira/browse/DERBY-4120
>             Project: Derby
>          Issue Type: Bug
>          Components: Eclipse Plug-in, Services
>    Affects Versions: 10.4.2.0
>         Environment: OSGi
>            Reporter: JJ Snyder
>
> The manifest in derbyclient.jar is incomplete for usage in OSGi.  There are no packages exported.  This appears to only be a problem in standalone equinox (outside of eclipse).  Note that I did not try other OSGi containers.
> The fix is relatively simple.  Adding the Export-Package manifest header should take care of the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4120) derbyclient.jar is not a complete OSGi bundle

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768754#action_12768754 ] 

Bryan Pendleton commented on DERBY-4120:
----------------------------------------

A little bit of research on the web:

This article mentions both Export-Package and Import-Package:
http://www.javaworld.com/javaworld/jw-03-2008/jw-03-osgi1.html?page=3

This article also says that importing must be done correctly:
http://www.osgi.org/blog/2007/04/importance-of-exporting-nd-importing.html

This article presents the Export-Package information from the Eclipse POV:
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/bundle_manifest.html

It seems like the simplest change would be to put the identical Export-Package
line into derbyclient.jar as is used for derby.jar.

I don't understand what this would *fix*, but I can at least prototype this and
verify that it doesn't *break* anything (that is revealed by the regression tests).

> derbyclient.jar is not a complete OSGi bundle
> ---------------------------------------------
>
>                 Key: DERBY-4120
>                 URL: https://issues.apache.org/jira/browse/DERBY-4120
>             Project: Derby
>          Issue Type: Bug
>          Components: Eclipse Plug-in, Services
>    Affects Versions: 10.4.2.0
>         Environment: OSGi
>            Reporter: JJ Snyder
>            Assignee: Bryan Pendleton
>
> The manifest in derbyclient.jar is incomplete for usage in OSGi.  There are no packages exported.  This appears to only be a problem in standalone equinox (outside of eclipse).  Note that I did not try other OSGi containers.
> The fix is relatively simple.  Adding the Export-Package manifest header should take care of the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-4120) derbyclient.jar is not a complete OSGi bundle

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren resolved DERBY-4120.
---------------------------------------

         Assignee: Bryan Pendleton  (was: Myrna van Lunteren)
    Fix Version/s: 10.5.3.1
       Resolution: Fixed

Committed backport to 10.5 with revision 963799.
Merge command was: svn merge -c 830545 https://svn.apache.org/repos/asf/db/derby/code/trunk

I confirmed that the appropriate entry is present in the META-INF/MANIFEST.MF file in derbyclient.jar.

> derbyclient.jar is not a complete OSGi bundle
> ---------------------------------------------
>
>                 Key: DERBY-4120
>                 URL: https://issues.apache.org/jira/browse/DERBY-4120
>             Project: Derby
>          Issue Type: Bug
>          Components: Eclipse Plug-in, Services
>    Affects Versions: 10.4.2.0
>         Environment: OSGi
>            Reporter: JJ Snyder
>            Assignee: Bryan Pendleton
>             Fix For: 10.5.3.1, 10.6.1.0
>
>         Attachments: addToManifest.diff
>
>
> The manifest in derbyclient.jar is incomplete for usage in OSGi.  There are no packages exported.  This appears to only be a problem in standalone equinox (outside of eclipse).  Note that I did not try other OSGi containers.
> The fix is relatively simple.  Adding the Export-Package manifest header should take care of the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-4120) derbyclient.jar is not a complete OSGi bundle

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Pendleton updated DERBY-4120:
-----------------------------------

    Attachment: addToManifest.diff

Here's a simple diff to the master build.xml file which causes the Manifest.mf
for derbyclient.jar to have the following additional lines:

Bundle-SymbolicName: derbyclient
DynamicImport-Package: *
Export-Package: org.apache.derby.jdbc

Regression tests with this modified derbyclient.jar file were clean.

I see that we already had

Bundle-Vendor: Apache Software Foundation
Bundle-Name: Apache Derby 10.6
Bundle-Version: 10.6.0000000.828905M

Do we need to set 

Bundle-ManifestVersion:2

I'm not sure what Bundle-ManifestVersion does, but I see it referenced here:
http://publib.boulder.ibm.com/infocenter/forms/v3r0m0/index.jsp?topic=/com.ibm.help.forms.doc/forms_services_platform/fsp_t_creating_manifest_file.html

According to this, if we don't set Bundle-ManifestVersion to 2, we may be 
recognized as a legacy bundle:
http://markmail.org/message/lnfjsdgpoh2qj3li

I'm also still uncertain about which packages we ought to list in the
Export-Package line. In my own experience, I don't ever need to
refer to any other classes from derbyclient.jar other than the packages
in org.apache.derby.jdbc. In fact, for my applications I only use
org.apache.derby.jdbc.ClientDriver directly, so that would be sufficient for me.

To get some other examples, I tried grepping around in the .java files in the
java/testing subdirectory of the trunk, to see if any of our existing regression
test programs access other packages from derbyclient. There were only a handful
of hits, and from what I can tell these occur in code which would NOT be
written by typical client applications.

So I'm tempted to leave the Export-Package line very short for now, and
only add to it if we come across cases where an application needs to access
one of these classes.

-bash-2.05b$ find . -name '*.java' -exec grep org.apache.derby.client {} \; -print
import org.apache.derby.client.ClientXid;
./jdbcapi/XATransactionTest.java
        if (c instanceof org.apache.derby.client.am.Connection) {
                    ((org.apache.derby.client.am.Connection) c).
./jdbcapi/CacheSessionDataTest.java
        // org.apache.derby.client.net.EbcdicCcsidManager
./jdbcapi/AuthenticationTest.java
                        || s.startsWith("org.apache.derby.client"))
./jdbcapi/ParameterMappingTest.java
import org.apache.derby.client.am.ByteArrayCombinerStream;
./derbynet/ByteArrayCombinerStreamTest.java
import org.apache.derby.client.am.SqlException;
import org.apache.derby.client.am.ClientMessageId;
./derbynet/SqlExceptionTest.java



> derbyclient.jar is not a complete OSGi bundle
> ---------------------------------------------
>
>                 Key: DERBY-4120
>                 URL: https://issues.apache.org/jira/browse/DERBY-4120
>             Project: Derby
>          Issue Type: Bug
>          Components: Eclipse Plug-in, Services
>    Affects Versions: 10.4.2.0
>         Environment: OSGi
>            Reporter: JJ Snyder
>            Assignee: Bryan Pendleton
>         Attachments: addToManifest.diff
>
>
> The manifest in derbyclient.jar is incomplete for usage in OSGi.  There are no packages exported.  This appears to only be a problem in standalone equinox (outside of eclipse).  Note that I did not try other OSGi containers.
> The fix is relatively simple.  Adding the Export-Package manifest header should take care of the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-4120) derbyclient.jar is not a complete OSGi bundle

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Pendleton resolved DERBY-4120.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.6.0.0

Committed to the trunk as revision 830545.

I hope that this change is sufficient to enable derbyclient.jar to be used as an OSGi bundle.

If not, please let us know what additional problems arise, and we can address those.

> derbyclient.jar is not a complete OSGi bundle
> ---------------------------------------------
>
>                 Key: DERBY-4120
>                 URL: https://issues.apache.org/jira/browse/DERBY-4120
>             Project: Derby
>          Issue Type: Bug
>          Components: Eclipse Plug-in, Services
>    Affects Versions: 10.4.2.0
>         Environment: OSGi
>            Reporter: JJ Snyder
>            Assignee: Bryan Pendleton
>             Fix For: 10.6.0.0
>
>         Attachments: addToManifest.diff
>
>
> The manifest in derbyclient.jar is incomplete for usage in OSGi.  There are no packages exported.  This appears to only be a problem in standalone equinox (outside of eclipse).  Note that I did not try other OSGi containers.
> The fix is relatively simple.  Adding the Export-Package manifest header should take care of the problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.