Eclipse RCP new plug-in dependency unresolved requirement - eclipse

I am learning RCP plug-ins and trying to add another plug-in as a dependency. So I started with a simple HelloWorld application and tested and it works fine. Now I created another plug-in by importing external jar files and added that as dependent on my HelloWorld application. Now when I run the code I get the following error,
!ENTRY org.eclipse.equinox.app 0 0 2018-10-08 13:39:55.300
!MESSAGE Product com.be.tests.part1.product1 could not be found.
!ENTRY com.be.tests.part1 4 0 2018-10-08 13:39:55.315
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: com.be.tests.part1 [73]
Unresolved requirement: Require-Bundle: Part1Libs; bundle-version="1.0.0"
I have added the new plug-in (Part1Libs) in the dependencies tab. The
MANIFEST.MF file shows the dependency as
Require-Bundle: org.eclipse.ui.intro,
org.eclipse.core.runtime,
org.eclipse.ui,
org.eclipse.equinox.ds,
org.eclipse.equinox.util,
org.eclipse.equinox.event,
Part1Libs;bundle-version="1.0.0"
It looks like I am missing a simple step but I can't figure out what is going on. Any help is greatly appreciated,

Look in the 'Run > Run Configurations...' dialog and find your RCP.
On the 'Plug-ins' tab ensure that all the plugins in your RCP are listed.

Related

bundle exception in eclipse upgrade 4.5.2 to 4.10

I upgraded my eclipse RCP based application from 4.5.2 to 4.10. I setup target platform and pointed it to new eclipse plugin directory as well.
And when I try to launch the application, it shows below errors.
Can somebody suggest any check list which I should follow for eclipse based applications upgrade and what am I missing here?
!ENTRY org.eclipse.core.runtime 4 0 2019-05-30 06:33:32.513
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.core.runtime [3]
Unresolved requirement: Require-Bundle: javax.inject; bundle-version="1.0.0"; visibility:="reexport"; resolution:="optional"
Unresolved requirement: Require-Bundle: org.eclipse.core.jobs; bundle-version="[3.10.0,4.0.0)"; visibility:="reexport"
at org.eclipse.osgi.container.Module.start(Module.java:451)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1783)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1763)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1725)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1656)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:233)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:343)
!ENTRY org.eclipse.core.runtime 2 0 2019-05-30 06:33:32.513
!MESSAGE Could not resolve module: org.eclipse.core.runtime [3]
Unresolved requirement: Require-Bundle: javax.inject; bundle-version="1.0.0"; visibility:="reexport"; resolution:="optional"
Unresolved requirement: Require-Bundle: org.eclipse.core.jobs; bundle-version="[3.10.0,4.0.0)"; visibility:="reexport"
!ENTRY org.eclipse.osgi 4 0 2019-05-30 06:33:32.529
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:81)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
at org.eclipse.equinox.launcher.Main.run(Main.java:1501)
at org.eclipse.equinox.launcher.Main.main(Main.java:1474)
Your log suggests problems with the javax.inject and org.eclipse.core.jobs plug-ins.
In the 'Run > Run Configurations...' dialog find your RCP in the 'Eclipse Application' section.
Use the 'Add Required Plug-ins' button to add all plug-ins your RCP uses. This will change between releases.
Use the 'Validate Plug-ins' button to validate that the selected plug-ins set is reasonable.

Bundle org.apache.ant could not be found. (Gradle and wuff)

I am trying to covert some existing eclipse plugin to gradle using the "wuff" plugin at
https://github.com/akhikhl/wuff/wiki/Convert-existing-Eclipse-plugins-and-apps-to-Gradle
I followed the tutorial and created the sample app successfully, but when trying to convert my own plugin i get the following error:
Bundle name org.apache.ant could not be found
The org.apache.ant is in my Require-Bundle in the Manifest.MF
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.jdt.core,
org.apache.ant

Eclipse: An internal error occurred during: "Updating Maven Project". org/apache/maven/plugin/war/util/MappingUtils

Adding a dependency on pom.xml and updating via Maven -> Update Project I get this error (see .log below)
!ENTRY org.eclipse.core.jobs 4 2 2012-08-22 10:04:31.078 !MESSAGE An
internal error occurred during: "Updating Maven Project". !STACK 0
java.lang.NoClassDefFoundError:
org/apache/maven/plugin/war/util/MappingUtils at
org.maven.ide.eclipse.wtp.namemapping.PatternBasedFileNameMapping.mapFileName(PatternBasedFileNameMapping.java:36)
at
org.maven.ide.eclipse.wtp.WebProjectConfiguratorDelegate.configureClasspath(WebProjectConfiguratorDelegate.java:367)
at
org.maven.ide.eclipse.wtp.WTPProjectConfigurator.configureClasspath(WTPProjectConfigurator.java:95)
at
org.eclipse.m2e.jdt.internal.DefaultClasspathManagerDelegate.populateClasspath(DefaultClasspathManagerDelegate.java:61)
at
org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:303)
at
org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:411)
at
org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:392)
at
org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:419)
at
org.eclipse.m2e.jdt.internal.BuildPathManager.updateClasspath(BuildPathManager.java:240)
at
org.eclipse.m2e.jdt.internal.BuildPathManager.mavenProjectChanged(BuildPathManager.java:229)
at
org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:724)
at
org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:847)
at
org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:280)
at
org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:323)
at
org.eclipse.m2e.core.ui.internal.UpdateMavenProjectJob.runInWorkspace(UpdateMavenProjectJob.java:74)
at
org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Any suggestion?
Check the version of the maven-war-plugin in your POM and make sure it's 2.2
Ok, a late answer, but I ran into the same problem and I fixed it by deleting my Maven repository. /.m2/repository

Right target platform for running JUnit plugin tests in Eclipse Indigo?

For my Eclipse plugin project, I have defined the following target platform:
<location includeAllPlatforms="true" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.equinox.executable.feature.group" version="3.5.0.v20110530-7P7NFUFFLWUl76mart"/>
<unit id="org.eclipse.rcp.sdk.id" version="3.7.1.M20110909-1335"/>
<unit id="org.eclipse.jdt.feature.group" version="3.7.1.r371_v20110810-0800-7z8gFcoFMLfTabvKsR5Qm9rBGEBK"/>
<unit id="epp.package.java" version="1.4.1.20110909-1818"/>
...
My plugin has JUnit plugin tests (in the same plugin). If I try to run them with a JUnit launch config (org.eclipse.platform.ide), I get the following console messages about junit, and an exception:
!ENTRY org.eclipse.osgi 2 0 2011-12-16 13:00:35.206
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-12-16 13:00:35.206
!MESSAGE Bundle reference:file:/Users/stolz/ws-bucky/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.jdt.junit4.runtime_1.1.200.v20110505-0800.jar was not resolved.
!SUBENTRY 2 org.eclipse.jdt.junit4.runtime 2 0 2011-12-16 13:00:35.206
!MESSAGE Missing required bundle org.junit_4.7.0.
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-12-16 13:00:35.207
!MESSAGE Bundle reference:file:/Users/stolz/ws-bucky/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.junit4_4.8.1.v20100525/ was not resolved.
!SUBENTRY 2 org.junit4 2 0 2011-12-16 13:00:35.207
!MESSAGE Missing required bundle org.junit_4.8.1.
and
!SUBENTRY 1 org.eclipse.osgi 2 0 2011-12-16 13:00:35.234
!MESSAGE Bundle org.junit4_4.8.1.v20100525 [219] was not resolved.
!SUBENTRY 2 org.junit4 2 0 2011-12-16 13:00:35.235
!MESSAGE Missing required bundle org.junit_4.8.1.
!ENTRY org.eclipse.core.net 1 0 2011-12-16 13:00:39.889
!MESSAGE System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences
Exception in thread "Plug-in Tests Runner" java.lang.IllegalArgumentException: Bundle "org.eclipse.jdt.junit4.runtime" not found. Possible causes include missing dependencies, too restrictive version ranges, or a non-matching required execution environment.
at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.getClassLoader(RemotePluginTestRunner.java:77)
at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.readPluginArgs(RemotePluginTestRunner.java:93)
at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.init(RemotePluginTestRunner.java:83)
at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:61)
at org.eclipse.pde.internal.junit.runtime.PlatformUITestHarness$1.run(PlatformUITestHarness.java:47)
at java.lang.Thread.run(Thread.java:680)
With the default JDT installation, the unit test runs fine, it's just that I want to define a proper target platform for a Hudson-build. Needless to say, I tried adding dependencies on the two offending platforms in various places, to no avail.
Update:
Whoops, I confused this with another set of tests; these here are not headless but workbench-tests.
Another oddity is that sometimes I won't see this error when running the test for the first time after switching to the default Eclipse platform and back to mine. Odd.
I don't like to blow my own horn here, but the only workaround I could come up with now (after another few hours of experimentation) is setting the launch-config to "all workspace and enabled target plugins" instead of either using a feature or plugin-based launch. I think this indicates that there is something fishy in the plugin-resolution process which Eclipse gets right by default, but not when you start restricting the available features/plugins.
With that change, it seems to reliably work both within Eclipse and Buckminster (leaving the target platform unchanged(!) from the problematic setup in the original question). So I conclude that the target platform is in principle correct, it must have been something about the launch.
Thanks for everyone's (#andrew-eisenberg, #PaulWebster at least) input!
How can you be compiling and launching your JUnit tests if JUnit is not part of the target platform? The first thing that you need to do is add org.junit and org.junit4 bundles to the target platform. Since it looks like you are doing a feature-based target platform, you may need to create a custom feature for these bundles.
Second, since it is unlikely that you want to ship your tests with your plugin, you probably want to follow the standard Eclipse practice of separating your tests into a *..tests plugin.
Typically, you simply do not include the tests in the final RCP app or update site.

Eclipse won't start, log error says: ObjectNotFoundException: Tree element

Last night my machine restarted while Eclipse Galileo was open. No big deal, right?
This morning, I started my machine and tried to open Eclipse. Instead of opening, I see this:
The error log suggests that there is some kind of problem caused by exiting with unsaved changes.
How can I get Eclipse to open and ignore those unsaved changes? I can't even open a text file that is not part of this project with Eclipse? There must be a way to reset this state.
EDIT:
I have tracked down the problem to a single file. When I delete this file below, Eclipse opens but my projects are missing.
.metadata\.plugins\org.eclipse.core.resources\.snap
I do use the subversion plugin, but I don't think that is the problem. Here is what the error log says ( abbreviated ):
!SESSION 2010-08-17 10:13:01.718 -----------------------------------------------
eclipse.buildId=M20100211-1343
java.version=1.4.2_06
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_CA
Command-line arguments: -os win32 -ws win32 -arch x86
!ENTRY org.eclipse.core.resources 2 10035 2010-08-17 10:13:02.656
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
!ENTRY org.eclipse.osgi 4 0 2010-08-17 10:13:02.671
!MESSAGE An error occurred while automatically activating bundle org.eclipse.core.resources (33).
!STACK 0
org.osgi.framework.BundleException: Exception in org.eclipse.core.resources.ResourcesPlugin.start() of bundle org.eclipse.core.resources.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
...
Caused by: org.eclipse.core.internal.dtree.ObjectNotFoundException: Tree element '/reports/src/com/lang/reports/OnlineReport.java' not found.
at org.eclipse.core.internal.dtree.AbstractDataTree.handleNotFound(AbstractDataTree.java:257)
...
Root exception:
org.eclipse.core.internal.dtree.ObjectNotFoundException: Tree element '/reports/src/com/lang/reports/OnlineReport.java' not found.
at org.eclipse.core.internal.dtree.AbstractDataTree.handleNotFound(AbstractDataTree.java:257)
...
!ENTRY org.eclipse.osgi 4 0 2010-08-17 10:13:02.703
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: org/eclipse/core/resources/IContainer
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:114)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
!ENTRY org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.eclipse.jdt.apt.core_3.3.202.R35x_v20091130-2300 [103] was not resolved.
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.eclipse.jdt.apt.pluggable.core_1.0.201.R35x_v20090925-1100 [104] was not resolved.
!SUBENTRY 2 org.eclipse.jdt.apt.pluggable.core 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing required bundle org.eclipse.jdt.apt.core_0.0.0.
!SUBENTRY 2 org.eclipse.jdt.apt.pluggable.core 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing imported package org.eclipse.jdt.internal.compiler.tool_0.0.0.
!SUBENTRY 2 org.eclipse.jdt.apt.pluggable.core 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing imported package org.eclipse.jdt.internal.compiler.apt.dispatch_0.0.0.
!SUBENTRY 2 org.eclipse.jdt.apt.pluggable.core 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing imported package org.eclipse.jdt.internal.compiler.apt.model_0.0.0.
!SUBENTRY 2 org.eclipse.jdt.apt.pluggable.core 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing imported package org.eclipse.jdt.internal.compiler.apt.util_0.0.0.
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.eclipse.jdt.apt.ui_3.3.200.v20090930-2100_R35x [105] was not resolved.
!SUBENTRY 2 org.eclipse.jdt.apt.ui 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing required bundle org.eclipse.jdt.apt.core_[3.2.0,4.0.0).
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.eclipse.jdt.compiler.apt_1.0.201.R35x_v20090925-1100 [106] was not resolved.
!SUBENTRY 2 org.eclipse.jdt.compiler.apt 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing imported package org.eclipse.jdt.internal.compiler.tool_0.0.0.
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.eclipse.jdt.compiler.tool_1.0.100.v_981_R35x [107] was not resolved.
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.eclipse.jdt.junit4.runtime_1.1.0.v20090513-2000 [116] was not resolved.
!SUBENTRY 2 org.eclipse.jdt.junit4.runtime 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing required bundle org.junit4_[4.4.0,5.0.0).
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.hamcrest.core_1.1.0.v20090501071000 [184] was not resolved.
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle org.junit4_4.5.0.v20090824 [186] was not resolved.
!SUBENTRY 2 org.junit4 2 0 2010-08-17 10:13:02.765
!MESSAGE Missing required bundle org.hamcrest.core_1.1.0.
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-08-17 10:13:02.765
!MESSAGE Bundle com.collabnet.subversion.merge_2.1.0 [208] was not resolved.
For this issue I had to delete the .snap file located in the directory :
<workspace-directory>\.metadata\.plugins\org.eclipse.core.resources
After deleting that file, I was able to start my Eclipse with no problem.
Recommended: Delete <workspace-directory>\.metadata\.plugins\org.eclipse.core.resources\.snap. This will not reset your workspace and your other projects won't get deleted (as answered by krishna).
Not Recommended: Alternatively, delete the the whole <workspace-directory>\.metadata directory from your workspace and restart.This will reset your workspace and delete all your existing projects in it.
Ran into this error.
There was no .snap file in my .metadata folder.
I had to delete this:
<workspace>/.metadata/.plugins/org.eclipse.core.resources/.root/d+.tree
d+=> some number.
Then I had to re-import the projects and re-assign the working sets. I preferred it over opening a new workspace and redoing settings.
Deleting .snap file worked perfect for me.
Delete .snap file from the directory - workspace.metadata.plugins\org.eclipse.core.resources.
Import the workspace (existing projects into workspace - do not copy folders into workspace again).
For anyone interested, I had the exact same problem and deleting the file .metadata/.plugins/org.eclipse.core.resources/.snap did the trick for me.
Had similar problem.
Log file said exception was caused by corruption in the project tree -- a very vague description.
Deleting individual files and directories in /.metadata/.plugins/org.eclipse.core.resources didn't work for me. I had to delete the entire /.metadata/.plugins/org.eclipse.core.resources directory. I lost the entire project tree but not the projects. They were still in the workspace and just needed to be imported back into Eclipse. I also did not lose the large numbers of plugins configured for working Java, Android, PHP, C++, J2EE, etc.
This is the second time I encountered a project tree related corruption. The first time I deleted the .metadata altogether and then spent a very long time putting back all the plugins and projects. The direction the other answers here were useful in zeroing in on just the org.eclipse.core.resources directory. Seems deleting the whole directory just results in only needing to reimport all the projects.
Your mileage may vary...
This also works when you receive this error from Information Design Tool (IDT) (Business Objects BI4).
Delete .snap file from this directory.
Please note that you Will lose all your local projects. Hopefully your modifications have been recently saved to a repository.
Directory -
C:\Users\xxxxuser.name.businessobjects\bimodeler_14\workspace.metadata.plugins\org.eclipse.core.resources\
Use the clean option
I had this error. I start eclipse with "clean" option and that worked for me.
eclipse.exe -clean
Eclipse starts and all projects ok.
solution: delete .metadata folder in your last workspace.
reason: Maybe you force shutdown/restart your computer, while your eclipse still running.
Just a little tip that might help people avoid an issue that I encountered.
In my case there were multiple workspace directories on my machine. When I ran the mvn sonar:sonar goal then it created its own workspace directory, placed the snapshot (.snap files) in there, and changed a setting to tell maven to look there for changes first. However, this was not my workspace that I was using, so the snapshot was never being updated with my changes. So when maven used that snapshot it could not find the files in their old locations. So I had to eliminate that workspace to resolve the issue. This worked because maven then looked in the next workspace on its list, my workspace, for the snapshot instead of the one added (but never updated) by the sonar goal.
So you might need to search your entire hard drive for *.snap files to see if there is more one workspace being used on your machine.
Check your environment variables _JAVA_OPTION path. I had HP UFT installed on my system and I set _JAVA_OPTION to IGNOREME_JAVA_OPTION for both system and environment variable. After reboot, eclipse showed the same error " check log file". Removed the IGNOREME and eclipse no issues. This could be another possibility that could be looked at to fix the eclipse.
Hope this helps.
I also had the same problem, this happens when you force shutdown/restart your computer, while your eclipse still running.
Deleting .metadata folder worked for me. Delete all the metadata and then import your project from that same workspace.
Rather deleting whole .metadata folder, which in turns delete your projects from workspace, try to find the .snap files and delete them.
.snap files are the snapshot of workspace's temporary instance which will be saved on clean & close of workspace.
Delete all the *.Snap files in the path workspace-directory>.metadata.plugins\org.eclipse.core.resources