Unresolved requirement: Require-Bundle: org.eclipse.core.databinding.beans; bundle-version="1.2.200"
Asked Answered
E

2

7

I am trying to create a RCP application in which, I want to bind a variable from a bean to view. Code for bean #

public class SaveFileBean implements PropertyChangeListener {
private String text;
private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(
        this);

@Override
public void propertyChange(PropertyChangeEvent arg0) {
    propertyChangeSupport.firePropertyChange("text", null, text);
}

public void addPropertyChangeListener(String propertyName,
        PropertyChangeListener listener) {
    propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
}

public void removePropertyChangeListener(PropertyChangeListener listener) {
    propertyChangeSupport.removePropertyChangeListener(listener);
}

public String getText() {
    return text;
}

}

The code for VIew

public class NewView extends ViewPart {
private DataBindingContext m_bindingContext;
public static final String ID = "com.app.Editor.newView";
SaveFileBean bean = new SaveFileBean();
private StyledText text;

public NewView() {
}

@Override
public void createPartControl(Composite parent) {

    text = new StyledText(parent, SWT.BORDER);
    bindValues();

}

private void bindValues() {
}

@Override
public void setFocus() {
    // create new Context
    DataBindingContext ctx = new DataBindingContext();

    // define the IObservables
    IObservableValue target = WidgetProperties.text(SWT.Modify).
      observe(text);
    IObservableValue model= BeanProperties.
      value(SaveFileBean.class,"text").observe(text);

    // connect them
    ctx.bindValue(target, model);
}
}

I added the following dependencies in manifest.mf Here is my MANIFEST.MF

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Editor
Bundle-SymbolicName: com.app.Editor;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.app.editor.Activator
Bundle-Vendor: APP
Require-Bundle: org.eclipse.ui,
   com.ibm.icu,
   org.eclipse.core.runtime,
   org.eclipse.core.databinding;bundle-version="1.4.2",
   org.eclipse.jface.databinding;bundle-version="1.6.200",
   org.eclipse.core.databinding.property,
   org.eclipse.core.databinding.beans;bundle-version="1.2.200"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy. Here is 
Export-Package: com.app.editor,
      com.app.editor.actions,
      com.app.editor.beans,
      com.app.editor.commands,
       com.app.editor.functionalities,
       com.app.editor.perspectives,
        com.app.editor.views

While running the code, I am getting error -

org.osgi.framework.BundleException: Could not resolve module: com.app.Editor    [81]
Unresolved requirement: Require-Bundle: org.eclipse.core.databinding.beans; bundle-version="1.2.200"

But, I have added this dependency in MANIFEST and I can see this jar in the project. Any idea?

Thanks!

Edit : the full log file is :

!SESSION 2015-08-19 08:53:21.748 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_45
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -application com.app.Editor.application
Command-line arguments:  -application com.app.Editor.application -data C:\Srijani\Personal Workspace\RCP/../runtime-com.app.Editor.application -dev file:C:/Srijani/Personal Workspace/RCP/.metadata/.plugins/org.eclipse.pde.core/com.app.Editor.application/dev.properties -os win32 -ws win32 -arch x86 -consoleLog

!ENTRY com.app.Editor 4 0 2015-08-19 08:53:22.559
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: com.app.Editor [87]
  Unresolved requirement: Require-Bundle: org.eclipse.core.databinding.beans

    at org.eclipse.osgi.container.Module.start(Module.java:434)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
    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)

!ENTRY com.app.Editor 2 0 2015-08-19 08:53:22.888
!MESSAGE Could not resolve module: com.app.Editor [87]
  Unresolved requirement: Require-Bundle: org.eclipse.core.databinding.beans


!ENTRY org.eclipse.osgi 4 0 2015-08-19 08:53:22.888
!MESSAGE Application error
!STACK 1
java.lang.RuntimeException: Application "com.app.Editor.application" could not be found in the registry. The applications available are: org.eclipse.ant.core.antRunner, org.eclipse.e4.ui.workbench.swt.E4Application, org.eclipse.e4.ui.workbench.swt.GenTopic, org.eclipse.equinox.app.error.
    at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:248)
    at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Eaglet answered 18/8, 2015 at 16:10 Comment(3)
Are there any more messages in the .log file in the workspace .metadata directory about resolution problems?Miner
Yes, there is.... I am attaching the log file. Thanks!Eaglet
If you are using Eclipse RCP edition there is a view called Target Platform State. Is the mentioned plugin listed in there? You can filter for the name. If so, check the Run Configuation if the plugin is getting loaded.Pacifica
E
17

I have solved this problem. Though I am not sure why this was happening.

Run As -> Run Configurations... -> Plugin-ins tab -> Add Required Plug-ins -> Validate plugin -> Run

This solved my problem!

Eaglet answered 19/8, 2015 at 7:3 Comment(2)
Had a similar issue with an unresolved requirement for junit after adding some tests, so +1 - and I think you mean Run Configurations... > Plug-ins tab > Add Required Plug-ins button (at least in Mars).Alexia
This will not solve your problem when deploying your product however. Still you'll have to find the missing dependencies and manually add them to your manifest.Mellott
A
1

For me, removing the plugins and adding them again worked... Preferences > Plug-in Development > Target Platform, try remove the Running Platform target definition -> Click Apply, and then Restore defaults or add the required plugins which you want to add.

Auteur answered 12/4, 2018 at 9:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.