Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332199 - rcp feature includes "org.eclipse.equinox.ds" but not "org.eclipse.equinox.event"
Summary: rcp feature includes "org.eclipse.equinox.ds" but not "org.eclipse.equinox.ev...
Status: RESOLVED WORKSFORME
Alias: None
Product: PDE
Classification: Eclipse Project
Component: Build (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: pde-build-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-09 04:45 EST by Johan Compagner CLA
Modified: 2010-12-21 12:26 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johan Compagner CLA 2010-12-09 04:45:23 EST
We are building our product purely on features we just build it on 3 major features:

platform->rcp->jdt are our main eclipse dependencies in our feature.xml file
with some emf features and the p2.user.ui 

If we build our product from that feature we get an exception when starting it up:

org.osgi.framework.BundleException: The bundle 
"org.eclipse.equinox.ds_1.2.1.R36x_v20100803 [1]" could not be resolved. 
Reason: Missing Constraint: Import-Package: 
org.eclipse.equinox.internal.util.event; version="1.0.0"
    at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)
    at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301)
    at 
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319)
    at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374)
    at 
org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067)
    at 
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561)
    at 
org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546)
    at 
org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459)
    at 
org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
    at 
org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:440)


i looked at this and the rcp feature includes the org.eclipse.equinox.ds plugin but that plugin has imported packages from i think the org.eclipse.equinox.event plugin, but that plugin is not included in any feature i can find.

Is this just a bug in the feature of the rcp plugin? it also should include the equinox.event plugin? Or can the pde builder auto include this somehow?
Comment 1 Andrew Niefer CLA 2010-12-21 10:46:51 EST
It looks like org.eclipse.equinox.event is included in the org.eclipse.platform feature.  Perhaps it should be moved into org.eclipse.rcp?



PDE/Build does not generally automatically include things when building products, however is you are building with p2 (http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.pde.doc.user/tasks/pde_p2_productbuilds.htm) and you have the metadata available, then p2 will automatically pull in dependencies.
Comment 2 Johan Compagner CLA 2010-12-21 11:03:42 EST
weird that i didn't find that reference when i was searching for it.
But i guess rcp builds on platform and because of that it should be included, need to investigate some more then why it didn't include it in our p2 build.
Comment 3 John Arthorne CLA 2010-12-21 11:12:12 EST
org.eclipse.equinox.ds does not have any dependency on org.eclipse.equinox.event.

The package org.eclipse.equinox.internal.util.event comes from bundle org.eclipse.equinox.util. That bundle is in the RCP feature so I don't know why you are seeing this problem.
Comment 4 Johan Compagner CLA 2010-12-21 11:12:56 EST
ok i just created a fresh new build
in the plugins dir both are there

org.eclipse.equinox.ds_1.2.1.R36x_v20100803
org.eclipse.equinox.event_1.2.0.v20100503

but i still get that error.

Is it because of version=1.0.0?


because event seems to export it:

Export-Package: org.eclipse.equinox.internal.event;x-internal:=true,or
 g.eclipse.equinox.internal.event.mapper;x-internal:=true


and ds seems to import it:

Import-Package: org.eclipse.equinox.internal.util.event;version="1.0"
Comment 5 John Arthorne CLA 2010-12-21 11:15:35 EST
(In reply to comment #4)
> Export-Package: org.eclipse.equinox.internal.event;x-internal:=true,or
>  g.eclipse.equinox.internal.event.mapper;x-internal:=true
> 
> Import-Package: org.eclipse.equinox.internal.util.event;version="1.0"

Read those package names again...
Comment 6 Johan Compagner CLA 2010-12-21 11:18:21 EST
> 
> because event seems to export it:
> 
> Export-Package: org.eclipse.equinox.internal.event;x-internal:=true,or
>  g.eclipse.equinox.internal.event.mapper;x-internal:=true

> and ds seems to import it:
> 
> Import-Package: org.eclipse.equinox.internal.util.event;version="1.0"


ahh wait yes i was looking a bit wrong, there is a "util" inside that package, so it is the equinox.event  plugin:

Export-Package: org.eclipse.equinox.internal.util;x-internal:=true,org
 .eclipse.equinox.internal.util.event;version="1.0";

that one i also have... and that exports this so it is weird why it doesnt find it.
Comment 7 Andrew Niefer CLA 2010-12-21 11:27:45 EST
To debug, you can start your product with "eclipse -console -noexit", then you will get the osgi console.

In my normal eclipse install:

osgi> packages org.eclipse.equinox.internal.util.event
org.eclipse.equinox.internal.util.event; version="1.0.0"<org.eclipse.equinox.util_1.0.200.v20100503 [96]>
  org.eclipse.equinox.ds_1.2.100.v20101206 [1629] imports

We see that org.eclipse.equinox.util_1.0.200.v20100503 exports the package and org.eclipse.equinox.ds_1.2.100.v20101206 imports it

You can do 
ss org.eclipse.equinox.util
to see:
id	State       Bundle
96	ACTIVE      org.eclipse.equinox.util_1.0.200.v20100503

and then 
diag 96
to see if there is anything equinox.util requires that isn't present.
Comment 8 Johan Compagner CLA 2010-12-21 11:40:57 EST
i figured it out, this bug can be closed, sorry for the noise.

in our .product file i had this:

   <configurations>
      <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
      <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
      <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="1" />
      <plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
      <plugin id="org.eclipse.update.configurator" autoStart="true" startLevel="0" />
   </configurations>


and we do build (3.5.2 currently) with that configuration for quite some time, so i upgraded to 3.6.1 now and then that doesnt work anymore i just removed the autostart of .ds and it seems to work fine, don't know why i had that then in the first place, i think it was a copy of an example (have been struggling to get it completely working back in the days)
Comment 9 Andrew Niefer CLA 2010-12-21 12:23:53 EST
Based on comment #8, there are a number of problems with your configuration which would affect this.

1) Start level 0 is not a good level to start things on, the framework begins at level 0 and nothing can be started before the framework is ready.  I suspect these bundles will just end up getting started at level 1.

2) Bundles must be installed into the framework to get used.  This is usually done by a combination of listing them in the configu.ini osgi.bundles property and then using either org.eclipse.equinox.simpleconfigurator or org.eclipse.update.configurator.  You have both configuratos which can lead to problems.  p2 uses org.eclipse.equinox.simpleconfigurator to manage an install,  I would suggest removing the start level from update.configurator and defining the property org.eclipse.update.reconcile=false in your config.ini file.

3) I don't believe there is any order to bundle starts withing a given start level.  For the resolution problems, it is likely that org.eclipse.equinox.ds is getting started before the configurators and at this point the equinox.util bundle hasn't been installed yet.

I would suggest using the following settings:
<configurations>
 <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="4" />
 <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2"/>
 <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
 <plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true"
startLevel="1" />
 <plugin id="org.eclipse.update.configurator" autoStart="true"
startLevel="4" />

 <property name="org.eclipse.update.reconcile" value="false" />
</configurations>

There is no UI for the <property> elements, you can add them manually to the xml.  UI was introduced in 3.7 with bug 260328.
Comment 10 Andrew Niefer CLA 2010-12-21 12:26:18 EST
This was really the same as bug 304338