4 Replies Latest reply on Feb 19, 2010 9:41 AM by gertv

    FUSE 4.2 geronimo-el exports / imports

    dustin_dustin.schultz

      Using FUSE 4.2, I install the geronimo-el spec using the following:

       

      osgi:install -s mvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/1.0.1

       

      And it shows as started:

       

      geronimo-el_1.0_spec (1.0.1)

       

      However, there are no exports:

       

      karaf@root> exports 212

      geronimo-el_1.0_spec (212): No active exported packages.

       

      But yet, the headers show it exports "javax.el"

       

      karaf@root> headers 212

       

      geronimo-el_1.0_spec (212)

      -


      Manifest-Version = 1.0

      Archiver-Version = Plexus Archiver

      Created-By = 1.5.0_13 (Apple Computer, Inc.)

      Built-By = gnodet

      Build-Jdk = 1.5.0_13

      Bundle-License = http://www.apache.org/licenses/LICENSE-2.0.txt

      Import-Package = javax.el;version="1.0"

      Bnd-LastModified = 1201859517220

      Export-Package = javax.el;version="1.0"

      Bundle-Version = 1.0.1

      Bundle-Name = geronimo-el_1.0_spec

      Bundle-Description = Provides open-source implementations of Sun specifications.

      Bundle-DocURL = http://www.apache.org

      Bundle-ManifestVersion = 2

      Bundle-Vendor = Apache Software Foundation

      Implementation-Title = Apache Geronimo

      Bundle-SymbolicName = org.apache.geronimo.specs.geronimo-el_1.0_spec

      Tool = Bnd-0.0.227

      Implementation-Version = 1.0.1

       

      And for some reason, it's importing javax.el version 2.1.0

       

      karaf@root> imports 212

      OPS4J Pax Web - Jsp Support (115): javax.el; version="2.1.0"

       

      Am I missing something or is this a bug?

        • 1. Re: FUSE 4.2 geronimo-el exports / imports
          dustin_dustin.schultz

          Ok slight update, if uninstall

           

          OPS4J Pax Web - Jsp Support (115)

           

          Then it correctly exports javax.el version 1.0

           

          But the question is, why is it importing version 2.1.0 when it declares an import of version 1.0?

          • 2. Re: FUSE 4.2 geronimo-el exports / imports
            gertv

            L.S.,

             

            The osgi:headers command is used to show the information in the MANIFEST.MF file that the OSGi runtime will use to resolve bundles and wire packages.  The packages:imports/exports commands show the result of resolution, i.e. it shows you how packages have been wired to resolve the bundle.

             

            In this case, the geronimo el bundle specifies

            Import-Package = javax.el;version="1.0"

             

            This means it will import javax.el version 1.0 or higher.  With the Pax Jsp Support installed, the best available version for the javax.el package is 2.1.0, so that's the bundle that gets wired to resolve the import.

             

            It would be better if the import would carry an explicit version range (e.g. [1.0, 1.1) to avoid resolving against a future (possibly incompatible) version of that package. 

             

            For the bundles we specifically build for ServiceMix, we usually avoid reimporting the packages we export to avoid exactly this kind of situation.  If you want to build your own bundle for EL 1.0 this way too, you can always take a quick look at e.g. http://svn.apache.org/viewvc/servicemix/smx4/bundles/trunk/commons-codec-1.3/pom.xml?revision=828351&view=markup for inspiration.

             

            Regards,

             

            Gert

            • 3. Re: FUSE 4.2 geronimo-el exports / imports
              dustin_dustin.schultz

              I thought import "1.0" meant explicitly import only version 1.0. Nice to know that it will resolve later versions. Thanks Gert!

              • 4. Re: FUSE 4.2 geronimo-el exports / imports
                gertv

                L.S.

                 

                For what it's worth: we don't think the EL bundle should be importing its own packages so I'm currently working on a patch to get that addressed in the next release of the geronimo bundles as well.  In the meanwhile, I'm afraid your best bet it to recreate your own bundle for javax.el

                 

                Regards,

                 

                Gert