Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317222 - Provide an OSGi ready aggregate for jetty
Summary: Provide an OSGi ready aggregate for jetty
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: osgi (show other bugs)
Version: 7.1.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 7.1.x   Edit
Assignee: Hugues Malphettes CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-17 13:04 EDT by Hugues Malphettes CLA
Modified: 2010-10-13 17:55 EDT (History)
4 users (show)

See Also:
gregw: iplog+


Attachments
jetty-all-server pom with OSGi manifest entries (10.40 KB, text/xml)
2010-07-08 07:46 EDT, Dmytro Pishchukhin CLA
no flags Details
Revised pom.xml (11.08 KB, text/xml)
2010-07-08 14:46 EDT, Hugues Malphettes CLA
no flags Details
Updated jetty-all-server pom with fixed import-package issues (11.49 KB, text/xml)
2010-07-21 08:20 EDT, Dmytro Pishchukhin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hugues Malphettes CLA 2010-06-17 13:04:27 EDT
Dmytro suggested that we provide an jetty aggregate bundle ready to use out of the box in an OSGi container.
It will contain the same jars than the current jetty aggregate and the jetty.osgi.boot classes

We will need some extra precautions to be able to run this aggregate in environments where the optional libraries are not available: for example the jsp libs.
There will be no "Require-Bundle" in there. Note that curenttly all the Require-Bundle directives are limited to internal jetty dependencies: so in an aggregate these will naturally disappear.
Comment 1 Dmytro Pishchukhin CLA 2010-07-08 07:46:04 EDT
Created attachment 173763 [details]
jetty-all-server pom with OSGi manifest entries
Comment 2 Dmytro Pishchukhin CLA 2010-07-08 07:58:26 EDT
Hi Hugues,

In the attachment you can find pom for one aggregate module (jetty-all-server). You can use it to change the other aggregate pom files with minor fixes (Import-Package, Export-Package etc.)

I found 2 issues:

1. jetty bundle jetty-jsp-2.1 is a part of this aggregate bundle and it imports com.sun.org.apache.commons.logging;version="[2.1,3)" package that is contained in org.apache.jasper.glassfish_2.1.0.v201004190952.jar, but this package is not (!) exported by this bundle. This bundle is out of jetty project scope, but it is built by eclipse community (Orbit). As I can see you can easily update it.

2. jetty-osgi-boot module manifest. You have to change importing from Require-Bundle to Import-Package, because the jetty-osgi-boot bundle has hard links to bundles, but not to packages (I use the same approach to link to aggregate server module, but only for tests of aggregate bundle).

Hope that my changes help you.

Cheers,
Dmytro
Comment 3 Hugues Malphettes CLA 2010-07-08 11:31:11 EDT
Thanks a lot Dmytro.
Looking into these 2 issues.
Comment 4 Hugues Malphettes CLA 2010-07-08 12:05:41 EDT
(In reply to comment #2)
1- For com.sun.org.apache.commons.logging, I will mark it as a split package to make sure that consumers willingly want that version of the package.
I think the import of the package should be marked as optional anyways: when it is not present, the jsp engine will not issue logs is all that happens.

2- I'll be working on the jetty.boot.osgi to move away from the Require-Bundle
Comment 5 Hugues Malphettes CLA 2010-07-08 14:46:41 EDT
Created attachment 173801 [details]
Revised pom.xml

Here is the revised pom.xml as discussed with Dmytro.
Comment 6 Hugues Malphettes CLA 2010-07-08 14:49:29 EDT
Committed as revision 2083
Also committed the change in the manifest of jetty-jsp to import the split-package provided by jasper.glassfish as packaged in eclipse orbit.
Comment 7 Hugues Malphettes CLA 2010-07-08 14:52:16 EDT
bug 319306 keeps track of the necessary improvement on org.eclipse.jetty.osgi.boot to be able to consume the aggregate.
Comment 8 Dmytro Pishchukhin CLA 2010-07-21 07:41:43 EDT
Hi Hugues,

I found several issues with package importing. Here is updated list of imported packages for jetty-all-server bundle

                        <Import-Package>
                            !org.eclipse.jetty*,
                            com.sun.org.apache.commons.logging;version="[2.1,3)";glassfish="split";resolution:=optional,
                            javax.servlet;version="2.5.0",
                            javax.servlet.http;version="2.5.0",
                            javax.mail;version="1.4.0";resolution:=optional,
                            javax.mail.event;version="1.4.0";resolution:=optional,
                            javax.mail.internet;version="1.4.0";resolution:=optional,
                            javax.mail.search;version="1.4.0";resolution:=optional,
                            javax.mail.util;version="1.4.0";resolution:=optional,
                            javax.transaction;version="1.1.0";resolution:=optional,
                            javax.transaction.xa;version="1.1.0";resolution:=optional,
                            org.slf4j;resolution:=optional,
                            org.slf4j.spi;resolution:=optional,
                            org.slf4j.helpers;resolution:=optional,
                            org.xml.sax,
                            org.xml.sax.helpers,
                            javax.xml.parsers,
                            javax.net.ssl,
                            !org.mortbay.*,
                            org.objectweb.asm;version="3.1.0";resolution:=optional,
                            org.objectweb.asm.commons;version="3.1.0";resolution:=optional,
                            javax.security.auth.message*;version="[1.0,2.0)"resolution:=optional,
                            *
                        </Import-Package>


Regards,
Dmytro
Comment 9 Dmytro Pishchukhin CLA 2010-07-21 07:47:14 EDT
one small typo in imports list:

javax.security.auth.message*;version="[1.0,2.0)";resolution:=optional,
Comment 10 Dmytro Pishchukhin CLA 2010-07-21 08:20:16 EDT
Created attachment 174836 [details]
Updated jetty-all-server pom with fixed import-package issues

Hello,
Comment 11 Hugues Malphettes CLA 2010-07-21 12:26:13 EDT
(In reply to comment #10)
> Created an attachment (id=174836) [details]
> Updated jetty-all-server pom with fixed import-package issues
> 
> Hello,

Hi Dmytro,
So in the attached pom.xml, the difference is that the manifest generated by BND will import: javax.security.auth.message*;version="[1.0,2.0)";resolution:=optional

and there is no more wildcard to import all other necessary packages as detected by BND.

Could you let us know what required this change?
In particular, I am not sure how javax.security.auth.message*;version="[1.0,2.0)"
is resolved: I can't find such a package in the orbit bundles.

Thanks!
Comment 12 Dmytro Pishchukhin CLA 2010-07-21 12:58:13 EDT
(In reply to comment #11)
> (In reply to comment #10)
> > Created an attachment (id=174836) [details] [details]
> > Updated jetty-all-server pom with fixed import-package issues
> > 
> > Hello,
> 
> Hi Dmytro,
> So in the attached pom.xml, the difference is that the manifest generated by
> BND will import:
> javax.security.auth.message*;version="[1.0,2.0)";resolution:=optional
> 
> and there is no more wildcard to import all other necessary packages as
> detected by BND.
> 
> Could you let us know what required this change?
> In particular, I am not sure how
> javax.security.auth.message*;version="[1.0,2.0)"
> is resolved: I can't find such a package in the orbit bundles.
> 
> Thanks!

Hi Hugues,

those packages are provided by 
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-jaspic_1.0_spec</artifactId>
      <version>1.0</version>
    </dependency>

in   <artifactId>jetty-jaspi</artifactId>
module.

Regards,
Dmytro
Comment 13 Hugues Malphettes CLA 2010-07-21 13:05:42 EDT
(In reply to comment #12)
> (In reply to comment #11)
> > (In reply to comment #10)
> > > Created an attachment (id=174836) [details] [details] [details]
> > > Updated jetty-all-server pom with fixed import-package issues
> > > 
> > > Hello,
> > 
> > Hi Dmytro,
> > So in the attached pom.xml, the difference is that the manifest generated by
> > BND will import:
> > javax.security.auth.message*;version="[1.0,2.0)";resolution:=optional
> > 
> > and there is no more wildcard to import all other necessary packages as
> > detected by BND.
> > 
> > Could you let us know what required this change?
> > In particular, I am not sure how
> > javax.security.auth.message*;version="[1.0,2.0)"
> > is resolved: I can't find such a package in the orbit bundles.
> > 
> > Thanks!
> 
> Hi Hugues,
> 
> those packages are provided by 
>     <dependency>
>       <groupId>org.apache.geronimo.specs</groupId>
>       <artifactId>geronimo-jaspic_1.0_spec</artifactId>
>       <version>1.0</version>
>     </dependency>
> 
> in   <artifactId>jetty-jaspi</artifactId>
> module.
> 
> Regards,
> Dmytro
So we can't use the one provided by the JDK?
Currently these packages are not provided by orbit which is what worries me.
Comment 14 Dmytro Pishchukhin CLA 2010-07-21 13:07:51 EDT
(In reply to comment #13)
> (In reply to comment #12)
> > (In reply to comment #11)
> > > (In reply to comment #10)
> > > > Created an attachment (id=174836) [details] [details] [details] [details]
> > > > Updated jetty-all-server pom with fixed import-package issues
> > > > 
> > > > Hello,
> > > 
> > > Hi Dmytro,
> > > So in the attached pom.xml, the difference is that the manifest generated by
> > > BND will import:
> > > javax.security.auth.message*;version="[1.0,2.0)";resolution:=optional
> > > 
> > > and there is no more wildcard to import all other necessary packages as
> > > detected by BND.
> > > 
> > > Could you let us know what required this change?
> > > In particular, I am not sure how
> > > javax.security.auth.message*;version="[1.0,2.0)"
> > > is resolved: I can't find such a package in the orbit bundles.
> > > 
> > > Thanks!
> > 
> > Hi Hugues,
> > 
> > those packages are provided by 
> >     <dependency>
> >       <groupId>org.apache.geronimo.specs</groupId>
> >       <artifactId>geronimo-jaspic_1.0_spec</artifactId>
> >       <version>1.0</version>
> >     </dependency>
> > 
> > in   <artifactId>jetty-jaspi</artifactId>
> > module.
> > 
> > Regards,
> > Dmytro
> So we can't use the one provided by the JDK?
> Currently these packages are not provided by orbit which is what worries me.

The packages javax.security.auth.message* are not provided by JDK6.
Comment 15 Hugues Malphettes CLA 2010-07-26 14:23:42 EDT
I have added the import of javax.security.auth.message*;resolution:=optional
to the pom.xml
Thanks for reporting the issue.
Comment 16 Hugues Malphettes CLA 2010-07-26 22:26:23 EDT
Fixed with this new import-package.