Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Some Packages must be imported outside of Eclipse

How are you launching equinox?  Are you certain the config.ini is getting read?  Try using a VM option to be sure (-Dosgi.compatibility.bootdelegation=true).  This option is set to true by default when launched with the equinox launcher (org.eclipse.equinox.launcher).  But it is set to false when using the OSGi launching API (org.osgi.framework.launch) or just using  "java -jar org.eclipse.osgi.jar".  See https://bugs.eclipse.org/bugs/show_bug.cgi?id=178477

Tom



Inactive hide details for "." ---06/23/2012 02:12:52 PM---Hello Tom,"." ---06/23/2012 02:12:52 PM---Hello Tom,


    From:

"." <las-palmas-11@xxxxxxxxxxxxxxxx>

    To:

Equinox development mailing list <equinox-dev@xxxxxxxxxxx>,

    Date:

06/23/2012 02:12 PM

    Subject:

Re: [equinox-dev] Some Packages must be imported outside of Eclipse




Hello Tom,
    Eclipse is launched with a backwards compatibility flag that is allowing your bundles to load classes from the packages provided by the VM (osgi.compatibility.bootdelegation=true).  When you launch equinox "outside of eclipse" this option is not set by default.

I added osgi.compatibility.bootdelegation=true to the config.ini in the configuration directory and the packages are still not available. E.g. I get a Class Not Found Exception in a bundle that uses QName when javax.xml.namespace is not imported.
Moreover, according to this site
http://help.eclipse.org/help32/topic/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html osgi.compatibility.bootdelegation is set to true by default, so this should also applies to "outside of Eclipse".
    PDE also has tools for generating your import statements.

I only know the "Automated Management of Dependencies" (AMD) function (section) in die bundle manifest editor. Are more tools available in the PDE?

Rene

-------- Original Message --------
Subject: Re: [equinox-dev] Some Packages must be imported outside of Eclipse
From: Thomas Watson
<tjwatson@xxxxxxxxxx>
To: Equinox development mailing list
<equinox-dev@xxxxxxxxxxx>
Date: Thu Jun 21 2012 15:01:24 GMT+0200

    PDE also has tools for generating your import statements.  Eclipse is launched with a backwards compatibility flag that is allowing your bundles to load classes from the packages provided by the VM (osgi.compatibility.bootdelegation=true).  When you launch equinox "outside of eclipse" this option is not set by default.

    Tom



    Inactive hide details for BJ Hargrave---06/20/2012
          04:17:10 PM---This is why you should use something like
          bndtools to make youBJ Hargrave---06/20/2012 04:17:10 PM---This is why you should use something like bndtools to make your bundles. Hand editing your manifest's package statements is not
      From: 

    BJ Hargrave/Austin/IBM@IBMUS
      To: 

    Equinox development mailing list
    <equinox-dev@xxxxxxxxxxx>,
      Date: 

    06/20/2012 04:17 PM
      Subject: 

    Re: [equinox-dev] Some Packages must be imported outside of Eclipse




    This is why you should use something like bndtools to make your bundles. Hand editing your manifest's package statements is not a good idea.
     

    --


office: +1 386 848 1781
mobile: +1 386 848 3788






    From:        
    "." <las-palmas-11@xxxxxxxxxxxxxxxx> 
    To:        
    Equinox development mailing list <equinox-dev@xxxxxxxxxxx>,
    Date:        
    2012/06/20 17:10 
    Subject:        
    Re: [equinox-dev] Some Packages must be imported outside of Eclipse 
    Sent by:        
    equinox-dev-bounces@xxxxxxxxxxx 





    Hello Richard,

    thanks for your answer.

    If it's not recommend to change the property to make packages like
    javax.* directly available: Is it possible in Eclipse to automatically
    import such packages when I use classes from them? I want to avoid the
    effort to manually check all my classes for imports from everything
    except java.* and manually adding these packages to the bundle manifest
    before I export the bundle as JAR.

    Regards,
    Rene

    -------- Original Message --------
    Subject: Re: [equinox-dev] Some Packages must be imported outside of Eclipse
    From: Richard S. Hall
    <heavy@xxxxxxxxxxxxxx>
    To: Equinox development mailing list
    <equinox-dev@xxxxxxxxxxx>
    Date: Wed Jun 20 2012 22:26:55 GMT+0200
    > On 6/20/12 16:17 , . wrote:
    >> Hello,
    >>
    >> if I start a OSGi bundle in Eclipse (Equinox) not only java.*, but
    >> also packages like javax.* are directly available and therefore must
    >> be not imported in the bundle manifest.
    >
    > I would expect that you can import the javax.* packages, but you are
    > correct that you shouldn't/can't import the java.* packages.
    >
    >> In contrast, when I run a bundle outside of Eclipse (also in Equinox;
    >> with startup.bat/startup.sh and config.ini) all used packages except
    >> java.* MUST be imported, otherwise it results to Class Not Found
    >> Exceptions.
    >>
    >> What is the reason why e.g. javax.* are not available outside of
    >> Eclipse without importing them? Is it possible, e.g. with a parameter
    >> in the config.ini, to make these packages directly available or in
    >> other words create the same runtime environment like in Eclipse?
    >
    > The reason is historical, I'd guess.
    >
    > You can configure this via the org.osgi.framework.bootdelegation
    > framework configuration property, but I'd recommend against doing so.
    > Double check, but I'd expect that you can import the javax.* packages
    > in Equinox when running in Eclipse...you should always import
    > everything except java.* packages...
    >
    > -> richard
    >
    >>
    >> Thanks in advance!
    >>
    >> Regards,
    >> Rene
    >> _______________________________________________
    >> equinox-dev mailing list
    >>
    equinox-dev@xxxxxxxxxxx
    >>
    https://dev.eclipse.org/mailman/listinfo/equinox-dev
    >
    >
    > _______________________________________________
    > equinox-dev mailing list
    >
    equinox-dev@xxxxxxxxxxx
    >
    https://dev.eclipse.org/mailman/listinfo/equinox-dev
    >


    _______________________________________________
    equinox-dev mailing list

    equinox-dev@xxxxxxxxxxx
    https://dev.eclipse.org/mailman/listinfo/equinox-dev

    _______________________________________________
    equinox-dev mailing list

    equinox-dev@xxxxxxxxxxx
    https://dev.eclipse.org/mailman/listinfo/equinox-dev




    _______________________________________________
    equinox-dev mailing list
    equinox-dev@xxxxxxxxxxx
    https://dev.eclipse.org/mailman/listinfo/equinox-dev
    _______________________________________________
    equinox-dev mailing list
    equinox-dev@xxxxxxxxxxx
    https://dev.eclipse.org/mailman/listinfo/equinox-dev


GIF image

GIF image


Back to the top