Bug 494913 - Could not resolve module: org.eclipse.e4.ui.workbench.swt
Summary: Could not resolve module: org.eclipse.e4.ui.workbench.swt
Status: NEW
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 major with 5 votes (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2016-05-30 08:30 EDT by Andrzej Podyma CLA
Modified: 2022-09-16 11:05 EDT (History)
10 users (show)

See Also:


Attachments
Add Required Plug-ins option do not resolve dependency problem (160.25 KB, image/png)
2016-05-30 08:30 EDT, Andrzej Podyma CLA
no flags Details
.log file for failed deployed RCP application (15.09 KB, text/plain)
2020-09-24 19:13 EDT, Kenneth Evans CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrzej Podyma CLA 2016-05-30 08:30:04 EDT
Created attachment 262109 [details]
Add Required Plug-ins option do not resolve dependency problem

I am using the following eclipse:

Eclipse for RCP and RAP Developers
Version: Neon Release Candidate 2 (4.6.0RC2)
Build id: 20160526-1324


While doing internal eclipse tutorial "Creating a Rich Client Application" I am not able to execute newly created plugin. It is also not possible to satisfy required plugins with "Add Required Plug-ins" option (see screenshot attached).

Excecution log:

!SESSION 2016-05-30 12:41:25.974 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_60
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product com.example.rcpapp.product
Command-line arguments:  -product com.example.rcpapp.product -data /Users/andrzej/Documents/workspace_neon/../runtime-com.example.rcpapp.product -dev file:/Users/andrzej/Documents/workspace_neon/.metadata/.plugins/org.eclipse.pde.core/com.example.rcpapp.product/dev.properties -os macosx -ws cocoa -arch x86_64 -consoleLog

!ENTRY org.eclipse.e4.ui.workbench.swt 4 0 2016-05-30 12:41:26.902
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.e4.ui.workbench.swt [9]
  Unresolved requirement: Require-Capability: osgi.extender; filter:="(&(osgi.extender=osgi.component)(version>=1.2)(!(version>=2.0)))"

	at org.eclipse.osgi.container.Module.start(Module.java:444)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1599)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Comment 1 Phil Beauvoir CLA 2016-06-09 12:14:30 EDT
Same here. Using 4.6 RC4a.

This means that you cannot run an application from Eclipse that uses org.eclipse.e4.ui.workbench.swt

It's a show-stopper.
Comment 2 Phil Beauvoir CLA 2016-06-09 13:24:09 EDT
I edited the Plug-ins tab on the Run Configuration and checked org.eclipse.equinox.ds and clicked "Add Required Plug-ins". That fixed it.
Comment 3 Glenn Burkhardt CLA 2016-06-22 20:00:32 EDT
Adding 'org.eclipse.equinox.ds' and 'add required' works for me, too.
Comment 4 Phil Beauvoir CLA 2016-06-23 03:00:35 EDT
This issue can be resolved if a feature project with RCP is used instead of a plugin-based launch configuration. Most newbies probably don't know about this. I'll take a look and see if it's easy to contribute such a feature project.
Comment 5 Glenn Burkhardt CLA 2016-06-23 09:30:06 EDT
BTW, this problem still exists in Version: Neon Release (4.6.0)
Build id: 20160613-1800.
Comment 6 Yossi Gil CLA 2016-09-02 15:21:34 EDT
I am experiencing this problem as well. What's RCP and how do you run it?
Comment 7 Stephan Herrmann CLA 2017-02-04 16:13:06 EST
After updating to Build id: I20170203-2000 existing Eclipse launch configurations that had been working a minute ago no longer work!

First exception:

org.osgi.framework.BundleException: Could not resolve module: org.eclipse.equinox.ds [2151]
  Unresolved requirement: Require-Bundle: org.apache.felix.scr; bundle-version="[2.0.0,3.0.0)"; visibility:="reexport"



And then basically everything relating to e4 or the IDE is fubar:

         Unresolved requirement: Require-Bundle: org.eclipse.ui.ide; bundle-version="3.8.0"
           -> Bundle-SymbolicName: org.eclipse.ui.ide; bundle-version="3.13.0.v20170201-1354"; singleton:="true"
              org.eclipse.ui.ide [2222]
                Unresolved requirement: Require-Bundle: org.eclipse.ui; bundle-version="[3.106.0,4.0.0)"
                  -> Bundle-SymbolicName: org.eclipse.ui; bundle-version="3.109.0.v20170119-0010"; singleton:="true"
                     org.eclipse.ui [2216]
                       Unresolved requirement: Require-Bundle: org.eclipse.ui.workbench; bundle-version="[3.105.0,4.0.0)"; visibility:="reexport"
                         -> Bundle-SymbolicName: org.eclipse.ui.workbench; bundle-version="3.109.0.v20170203-1953"; singleton:="true"
                            org.eclipse.ui.workbench [2231]
                              Unresolved requirement: Import-Package: org.eclipse.e4.core.commands.internal
                                -> Export-Package: org.eclipse.e4.core.commands.internal; bundle-symbolic-name="org.eclipse.e4.core.commands"; bundle-version="0.12.0.v20160919-1453"; version="0.0.0"; x-friends:="org.eclipse.e4.ui.bindings,org.eclipse.ui.workbench"
                                   org.eclipse.e4.core.commands [1886]
                                     Unresolved requirement: Import-Package: org.eclipse.e4.core.services.log
                                       -> Export-Package: org.eclipse.e4.core.services.log; bundle-symbolic-name="org.eclipse.e4.core.services"; bundle-version="2.1.0.v20160919-1954"; version="0.0.0"; x-friends:="org.eclipse.e4.ui.bindings,  org.eclipse.e4.ui.services,  org.eclipse.e4.ui.workbench,  org.eclipse.e4.ui.workbench.renderers.swt,  org.eclipse.e4.ui.workbench.swt,  org.eclipse.ui.workbench"
                                          org.eclipse.e4.core.services [1891]
                                            Unresolved requirement: Require-Capability: osgi.extender; filter:="(&(osgi.extender=osgi.component)(version>=1.2)(!(version>=2.0)))"
                              Unresolved requirement: Import-Package: org.eclipse.e4.ui.internal.workbench
                                -> Export-Package: org.eclipse.e4.ui.internal.workbench; bundle-symbolic-name="org.eclipse.e4.ui.workbench"; bundle-version="1.5.0.v20170203-0918"; version="0.0.0"; x-friends:="org.eclipse.e4.ui.workbench.fragment,  org.eclipse.e4.ui.workbench.renderers.swt,  org.eclipse.e4.ui.workbench.swt,  org.eclipse.ui.workbench,  org.eclipse.ui.ide.application,  org.eclipse.ui.ide"
                                   org.eclipse.e4.ui.workbench [2137]
                                     Unresolved requirement: Require-Bundle: org.eclipse.e4.ui.model.workbench; bundle-version="1.2.0"
                                       -> Bundle-SymbolicName: org.eclipse.e4.ui.model.workbench; bundle-version="1.3.0.v20170105-1239"; singleton:="true"
                                          org.eclipse.e4.ui.model.workbench [2136]
                                            Unresolved requirement: Require-Bundle: org.eclipse.e4.core.services; bundle-version="0.9.0"
                                              -> Bundle-SymbolicName: org.eclipse.e4.core.services; bundle-version="2.1.0.v20160919-1954"; singleton:="true"
                                     Unresolved requirement: Require-Bundle: org.eclipse.e4.ui.services; bundle-version="0.9.0"
                                       -> Bundle-SymbolicName: org.eclipse.e4.ui.services; bundle-version="1.3.0.v20161125-2125"; singleton:="true"
                                          org.eclipse.e4.ui.services [1900]
                                            Unresolved requirement: Require-Bundle: org.eclipse.e4.core.services; bundle-version="0.9.0"
                                              -> Bundle-SymbolicName: org.eclipse.e4.core.services; bundle-version="2.1.0.v20160919-1954"; singleton:="true"
                                     Unresolved requirement: Require-Bundle: org.eclipse.e4.core.services; bundle-version="0.9.0"
                                       -> Bundle-SymbolicName: org.eclipse.e4.core.services; bundle-version="2.1.0.v20160919-1954"; singleton:="true"
                              Unresolved requirement: Import-Package: org.eclipse.e4.core.commands
                                -> Export-Package: org.eclipse.e4.core.commands; bundle-symbolic-name="org.eclipse.e4.core.commands"; bundle-version="0.12.0.v20160919-1453"; version="0.0.0"; x-friends:="org.eclipse.e4.ui.bindings,  org.eclipse.e4.ui.workbench,  org.eclipse.e4.ui.workbench.renderers.swt,  org.eclipse.ui.workbench,  org.eclipse.e4.ui.workbench.swt,  org.eclipse.e4.ui.progress,  org.eclipse.e4.core.commands.tests"
                              Unresolved requirement: Import-Package: org.eclipse.e4.ui.internal.workbench.addons
                                -> Export-Package: org.eclipse.e4.ui.internal.workbench.addons; bundle-symbolic-name="org.eclipse.e4.ui.workbench"; bundle-version="1.5.0.v20170203-0918"; version="0.0.0"; x-internal:="true"
                Unresolved requirement: Require-Bundle: org.eclipse.ui.workbench; bundle-version="[3.7.0,4.0.0)"
                  -> Bundle-SymbolicName: org.eclipse.ui.workbench; bundle-version="3.109.0.v20170203-1953"; singleton:="true"


The innermost problem was also displayed when validating the launch configuration:

Unresolved requirement: Require-Capability: osgi.extender; filter:="(&(osgi.extender=osgi.component)(version>=1.2)(!(version>=2.0)))"


I tried "Add required" (in the launch configuration and also in the target definition) and also enabled "all workspace and enabled target plug-ins", to no avail.


I had to go to the target platform and select everything to get a successful launch, but really, this should be resolved by "Add Required".

In particular, none of the error messages pointed me to anything that I had disabled. Everything with osgi and felix in its name was enabled.
Comment 8 Stephan Herrmann CLA 2017-02-04 16:35:00 EST
(In reply to Stephan Herrmann from comment #7)
> First exception:
> 
> org.osgi.framework.BundleException: Could not resolve module:
> org.eclipse.equinox.ds [2151]
>   Unresolved requirement: Require-Bundle: org.apache.felix.scr;
> bundle-version="[2.0.0,3.0.0)"; visibility:="reexport"

I found that o.a.felix.scr was *not* selected, so that probably was the root problem. But "Add Required" in the target platform editor (which I clicked several times) should've fixed that, but obviously didn't.

Once it was selected in the target, "Add Required Plug-ins" in the launch configuration actually works.
Comment 9 Olivier Prouvost CLA 2017-02-04 19:05:30 EST
For this dependency : 

Unresolved requirement: Require-Capability: osgi.extender; filter:="(&(osgi.extender=osgi.component)(version>=1.2)(!(version>=2.0)))"


It means that org.eclipse.equinox.ds is not selected in your launch configuration. 

There are bugs opened : #491374 and #496549 about dependencies and validation for OSGi capabilities.
Comment 10 Stephan Herrmann CLA 2017-02-04 20:36:17 EST
(In reply to Olivier Prouvost from comment #9)
> For this dependency : 
> 
> Unresolved requirement: Require-Capability: osgi.extender;
> filter:="(&(osgi.extender=osgi.component)(version>=1.2)(!(version>=2.0)))"
> 
> 
> It means that org.eclipse.equinox.ds is not selected in your launch
> configuration. 
> 
> There are bugs opened : #491374 and #496549 about dependencies and
> validation for OSGi capabilities.

Thanks for the references (clickable: bug 491374 and bug 496549)

It seems to be a combination of things:

At some point I had org.eclipse.equinox.ds in my configuration but it failed to start due to missing org.apache.felix.scr.

In the target editor, having equinox.ds but not felix.scr is *not* fixed by "Add Required".

After manually selecting felix.scr in the target, the launch configuration has this behaviour:

If equinox.ds is missing, it is not added.

If equinox.ds is select and felix.scr is missing, add required fixes the problem.


Confusing ...
Comment 11 Kenneth Evans CLA 2017-04-04 21:28:45 EDT
I am also running into this problem.  Adding things manually in the run configuration does not work when deploying.  I finally got it to work by making org.eclipse.equinox.ds a dependency in the plug-in and doing add required in the product.

My problem is that I am getting Maven views in my product (under Show View), which are not desired and also cause errors.  These apparently come from org.eclipse.m2e.*, which get added as required when org.eclipse.equinox.ds is added.  They don't seem to be necessary.  At least unchecking them in the run configuration still validates.

It is hard to see why a Maven UI should be a required dependency for a product (that does not use Maven).

For the record, I don't have org.apache.felix.scr in my workspace.

Confusing...

and

Irritating...
Comment 12 Kenneth Evans CLA 2017-04-06 13:41:54 EDT
After looking into this more I am less confused.  And I apologize for the negative comment.  (It was late.)

The RCP project that gives me most trouble was written in 2011 and hasn't changed much since.  Except that it breaks with every new [significant] release owing to the required dependencies changing (and often bugs with the new dependencies).  So I work on getting it running again without the code being fresh in my mind.  This is made difficult as the error usually shows up as, for example, a problem with org.eclipse.e4.ui.workbench.swt or something else that is not the real problem.

I especially have trouble with org.eclipse.equinox.ds and org.eclipse.help.webapp.  For both of these the Dependency Analysis for MANIFEST.MF says they are unused (which is untrue and probably a bug).  So I periodically apparently have been taking them out, then fixing what gets broken in some way until it works again.

There seems to be a choice whether to put them in MANIFEST.MF or the .product.  Apparently it is sufficient to have them in the .product, except you have to remember to add them manually (since Add Required doesn't work). I currently have them in MANIFEST.MF, where I have to remember it lies about their being unused.  I'm not sure which is recommended.

BTW just fixing the Run Configuration, doesn't fix the problem if you deploy.  I would prefer not to have to rewrite the projects to use features.  It is not a plug-in that needs an update site.

In any event, now that I understand the situation (I think), I have made a note so I will remember when it breaks in the future.

The other point is about the Maven Views in the default handler for the Window | Show View menu.  They are coming in through the dependencies for org.eclipse.equinox.ds (why they are relevant to this topic).  Maven is completely unwanted in this particular RCP app, and org.eclipse.equinox.ds should not be dependent on including GUI elements from Maven.

I am using Neon.2 Release (4.6.2).

Thanks.
Comment 13 Glenn Burkhardt CLA 2019-01-23 09:48:32 EST
For Eclipse 4.10, it seems that "org.apache.felix.scr" provides the "osgi-extender" capability.  I also observe that the "add required plugins" for a product definition in 4.10 seems to be broken.
Comment 14 Kenneth Evans CLA 2019-01-23 15:10:20 EST
The "add-required-functions" capability has been broken for a long time.  Things like org.eclipse.equinox.ds are not found as required but it doesn't run when deployed without them.  It even considers them unused dependencies.

org.eclipse.equinox.ds is a black box to me.  It isn't related to my programs' logic, and I don't know what it does, as with many of the required plug-ins.  I shouldn't have to know.  The "add-required-functions" capability should take care of that for me.

I think this is a bug
Comment 15 Darko Milovanovic CLA 2020-09-24 03:21:20 EDT
this worked for me:

ADDED osgi.clear=true LINE
Go to C:\Users\USER\eclipse\ECLIPSE_VERSION\eclipse\configuration\config.ini

Open file config.ini

Add this line: osgi.clean=true

Start eclipse.

If it is working then delete this line afterwards.

This is same as -clean argument.

resource:
https://help.eclipse.org/2020-06/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html&cp%3D2_1_5_0&anchor=osgiclean
Comment 16 Kenneth Evans CLA 2020-09-24 11:14:26 EDT
Thanks. Could you explain more what "this worked for me" means. Does it (1) make Add Required plugins work correctly, (2) keep the Dependency Analysis for MANIFEST.MF from saying they are unused, and (3) allow you to deploy whenever the application runs in the Workspace with a clean Run configuration from Run Eclipse product?

I still have to spend a lot of time with almost every release getting a program to which I have made no signigicant changes build and then deploy. It should not be this way.

I stopped using Eclipse Help (org.eclipse.help.webapp). That eliminated a lot of the hassle, at the expense of not having Help for my applications.

I was once very much into RCP. It turns out to have been one of the worst programming decisions I have ever made. I am down to only 2 RCP applications that are too big to be convenient to rewrite.

This is a 2016 bug that continues to not be addressed by Eclipse support.
Comment 17 Stefan Prieschl CLA 2020-09-24 11:42:15 EDT
Try to add "org.apache.felix.scr" to your plugin and then go to your product file and click "Add Required Plug-ins" in Contents-Tab and "Add Recommended..." (Start Levels) in Configuration-Tab. That should solve your problem.

In former versions you needed to add "org.eclipse.equinox.ds" like mentioned in [Comment 3], but this plugin has been removed.
Comment 18 Kenneth Evans CLA 2020-09-24 16:27:55 EDT
Stefan,

I am currently using Eclipse 2019-12 primarily to avoid going through the process of getting my application to run with a later version.  However, elsewhere I am getting Eclipse bugs that are apparently now fixed in the current version.  I would like to upgrade but do not want to get into another nightmare getting the RCP apps to work.

My plugin.xml currently has two plugins that show up as unused dependencies:
org.eclipse.equinox.event
org.eclipse.equinox.ds

(This seems like a bug, as I've said previously. I shouldn't have to have to add dependencies that are unused.)

Do I need org.eclipse.equinox.event? (Remember, it says it is unused.)

According to my notes I got org.eclipse.equinox.ds from the EquinoxTargetProducts from the 4.10 update site. Not having any information, I do all this by trial and error. Was that the wrong thing to do?

I would typically upgrade to 2020-09 via adding the new software site (2020-09) in Preferences and then doing Help | Install New Software from that site. My understanding is that org.eclipse.equinox.ds would still be there.

What would be the best way to proceed?  Thanks.
Comment 19 Kenneth Evans CLA 2020-09-24 19:13:26 EDT
Created attachment 284262 [details]
.log file for failed deployed RCP application

This is .log file for one of the failed RCP applications mentioned in Comment 17.
Comment 20 Kenneth Evans CLA 2020-09-24 19:25:14 EDT
I went ahead and updated to 2020-09. (I used Help|Check for Updates not Install New Software as I said.)

I replaced org.eclipse.equinox.ds with org.apache.felix.scr as suggested.
I apparently need org.eclipse.equinox.event.

Both org.apache.felix.scr and org.eclipse.equinox.event show as unused dependencies.

I deleted the Run configurations, redid the contents starting with my plugins then did Add Required.
I did Launch an Eclipse application.
After repeating this at least twice I got it to run in the Workspace.

Validate Plugins show no errors in the Run configuration.

Then I did Eclipse Product Export Wizard which completed without errors.

(I did this for both of my RCP applications.)

Both fail to run with what looks like the major problem to be
java.lang.NoClassDefFoundError: org/eclipse/core/resources/ResourcesPlugin

This is typical of what happens whenever I update the Eclipse version.  They run and look ok in the Workbench (at least after fixing other problems). 

They do not run when deployed, and I cannot tell why from the .log. 

(org.eclipse.core.resources_3.13.800.v20200706-2152.jar and org.eclipse.core.resources.win32.x86_64_3.5.400.v20190812-0909.jar are in the deployed plugins directory.)

*** The .log is attached above.

Thanks for your help.
Comment 21 Kenneth Evans CLA 2020-09-24 19:26:20 EDT
Created attachment 284262 [details]
.log file for failed deployed RCP application

This is .log file for one of the failed RCP applications mentioned in Comment 17.

Should be Comment 20.
Comment 22 Vikas Chandra CLA 2020-09-25 03:34:03 EDT
There are too many comments as of now. It will be good if a new bug is filed with the behaviour shown in 2020-09 with steps.
Comment 23 Kenneth Evans CLA 2020-09-25 14:34:14 EDT
I am not sure why comments are a bad thing, but I agree with Einstein that to continue to do the same thing and expect different results is unwise. The new bug is Bug #567370 and has supporting information as to this issue as it occurs in 2020-09.
Comment 24 Eclipse Genie CLA 2022-09-16 11:05:44 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.