Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317007 - Unable to run Jetty OSGi when -Dosgi.compatibility.bootdelegation=false
Summary: Unable to run Jetty OSGi when -Dosgi.compatibility.bootdelegation=false
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: osgi (show other bugs)
Version: 7.1.4   Edit
Hardware: All All
: P3 critical (vote)
Target Milestone: 7.2.0.RC0   Edit
Assignee: Hugues Malphettes CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-16 03:30 EDT by Dmytro Pishchukhin CLA
Modified: 2010-07-06 18:09 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmytro Pishchukhin CLA 2010-06-16 03:30:39 EDT
Build Identifier: 7.1.4.v20100610

I've figure out the cause of  bug 315004 and bug 316909. 

Jetty OSGi functionality is tested only with Eclipse Launcher (see Jetty SDK). 

There is a boot delegation property: osgi.compatibility.bootdelegation that is "true" by default in the launcher (that is Eclipse-specific behavior: http://wiki.eclipse.org/Equinox_Boot_Delegation).

I found that some of bundles that are provided in SDK do not have some critical imports (e.g. org.apache.jasper.glassfish_2.1.0.v201004190952.jar missed package imports: org.xml.sax*, org.w3c.dom*)

I suggest to use Bnd or Bundlor to test import packages for jetty bundles (I can help with fixing)




Reproducible: Always

Steps to Reproduce:
in Jetty SDK edit /configuration/config.ini
- add osgi.compatibility.bootdelegation=false
Comment 1 Hugues Malphettes CLA 2010-06-16 13:44:44 EDT
Thanks a lot Dmytro for finding the root cause of this issue.
I am the maintainer for these jars both in eclipse-orbit (javax.servlet.jsp.glassfish) and for jetty.

For jetty we use Bnd for most jars.
I actually consciously removed all imports of packages provided by the profile JavaSE5: I assumed that bootdelegation was always true and thought that in fact this was the OSGi standard behavior.

Let's keep track of these here and I'll be fixing them.
Import those packages with the version 0.0.0 explicitly.

Let me know if I am missing something.

Is this issue blocking you or can you enable osgi.compatibility.bootdelegation ?
It seems that felix and knoplerfish are supporting that property?
Comment 2 Dmytro Pishchukhin CLA 2010-06-16 13:59:57 EDT
(In reply to comment #1)
> Thanks a lot Dmytro for finding the root cause of this issue.
> I am the maintainer for these jars both in eclipse-orbit
> (javax.servlet.jsp.glassfish) and for jetty.
> 
> For jetty we use Bnd for most jars.
> I actually consciously removed all imports of packages provided by the profile
> JavaSE5: I assumed that bootdelegation was always true and thought that in fact
> this was the OSGi standard behavior.
> 
> Let's keep track of these here and I'll be fixing them.
> Import those packages with the version 0.0.0 explicitly.
> 
> Let me know if I am missing something.
> 
> Is this issue blocking you or can you enable osgi.compatibility.bootdelegation
> ?
> It seems that felix and knoplerfish are supporting that property?

Hugues,

I'm not sure that Felix and Knopflerfish support this property, because I did not find any information about the property in OSGi spec. I think that this is Equinox specific property. 

This issue is blocking for me, because my project runs outside Eclipse launcher and could be run on Felix and Knopflerfish (or any R4 framework).

Standard OSGi behavior is osgi.compatibility.bootdelegation=false (details here: http://wiki.eclipse.org/Equinox_Boot_Delegation)

Do not use any versions for packages that are provided by JRE (org.xml.sax.*, org.w3c.dom.*). Those packages are exported by system bundle with default version value (0.0.0).

Can I test your fixes before any new version release?
Comment 3 Hugues Malphettes CLA 2010-06-16 14:09:36 EDT
I can find traces of "osgi.compatibility.bootdelegation"inf felix (http://felix.apache.org/site/using-the-osgi-compliance-tests.html) and knopflerfish (http://www.knopflerfish.org/releases/current/docs/release_notes.html).

I will update this bug with a snapshot build of jetty-osgi as I am fixing those bugs.
Glad to have someone to help testing it.
Comment 4 Hugues Malphettes CLA 2010-06-16 14:11:56 EDT
(In reply to comment #3)
> I can find traces of "osgi.compatibility.bootdelegation"inf felix
> (http://felix.apache.org/site/using-the-osgi-compliance-tests.html) and
> knopflerfish
> (http://www.knopflerfish.org/releases/current/docs/release_notes.html).
Sorry for the extra email.
In my understanding configuring an R4 implementation with org.osgi.framework.bootdelegation=* will do the trick.
Just a workaround really.
Comment 5 Dmytro Pishchukhin CLA 2010-06-16 15:58:13 EDT
(In reply to comment #4)
> (In reply to comment #3)
> > I can find traces of "osgi.compatibility.bootdelegation"inf felix
> > (http://felix.apache.org/site/using-the-osgi-compliance-tests.html) and
> > knopflerfish
> > (http://www.knopflerfish.org/releases/current/docs/release_notes.html).
> Sorry for the extra email.
> In my understanding configuring an R4 implementation with
> org.osgi.framework.bootdelegation=* will do the trick.
> Just a workaround really.


This is a workaround, but we cannot use this property in our project. 
Usage of the property is not a good OSGi smell :)
Comment 6 Hugues Malphettes CLA 2010-06-17 14:46:44 EDT
I have committed the changes to org.apache.jasper.glassfish
org.apache.jasper.glassfish__2.1.0.v201006171119 will fix those missing imports.

Reviewing the other jetty bundles.
Comment 7 Hugues Malphettes CLA 2010-06-21 11:49:12 EDT
I have committed the changes to the configuration of Bnd for the generation of the jetty's bundle manifest to import the non java.* packages with a version of "0.0.0"

Here is the thread for your reference discussing how to import those packages:
http://dev.eclipse.org/mhonarc/lists/orbit-dev/msg01875.html

jetty depends on org.xml.sax, org.w3c, javax.xml, javax.net, javax.naming, javax.transaction and a couple more. Most of these imports are used when the optional jetty libraries are in use.
They are all imported with the version "0.0.0" for the next release.
Comment 8 Hugues Malphettes CLA 2010-06-22 12:32:30 EDT
Committed after a small sanity check with Joakim. revision 2037.
Will be release after 7.1.4
Comment 9 Hugues Malphettes CLA 2010-06-22 12:34:40 EDT
Sorry for the mismanipulation, please disregard comment #5
Comment 10 Hugues Malphettes CLA 2010-07-06 18:09:48 EDT
Fixed for jetty-7.1.5
Please note that jetty-plus published on the maven repository has its osgi manifest broken: bug 319034
The EclipseRT Web Starter Kit distribution for 7.1.5 is fine.