Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The bundle XYZ could not resolved. Reason: Missing Constraint: Import-Package: ABC; version="1.0.0" error in headless RCP standalone

I'm working on standalone headless RCP. It works without problem when I execute the application and product in eclipse IDE, but when I export and execute it, I got this error in the log file.

enter image description here

!ENTRY org.eclipse.equinox.ds 4 0 2013-01-16 13:27:59.132
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: The bundle "org.eclipse.equinox.ds_1.4.0.v20120522-1841 [3]" 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:1332)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1316)
...

!ENTRY org.eclipse.equinox.ds 4 0 2013-01-16 13:28:00.901
!MESSAGE [SCR] Exception while activating instance org.eclipse.e4.ui.css.swt.internal.theme.ThemeEngineManager@6b8d6157 of component org.eclipse.e4.ui.css.swt.theme  
!STACK 0
java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Display
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)

Referring from this post, I understand that I've got a newer version of a plug-in without its dependencies, and there is something wrong in the runtime path. However, I'm not sure exactly what might cause this error.

What might be wrong? Why I have this error only when I execute it as standalone?

ADDED

I have build.properties file

output.. = bin/
bin.includes = META-INF/,\
               plugin.xml,\
               .
source.. = src/

This is MANIFEST.MF file

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Refactorer
Bundle-SymbolicName: edu.utexas.seal.refactorer;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: edu.utexas.seal.refactorer.Activator
Bundle-Vendor: PROSSEEK
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
 org.eclipse.jdt;bundle-version="3.8.0",
 org.eclipse.jdt.core;bundle-version="3.8.2",
 org.eclipse.core.resources;bundle-version="3.8.1",
 org.eclipse.text;bundle-version="3.5.200",
 org.eclipse.jdt.ui;bundle-version="3.8.1",
 org.eclipse.jdt.core.manipulation;bundle-version="1.5.0",
 org.eclipse.ltk.ui.refactoring;bundle-version="3.7.0",
 org.eclipse.jdt.core.manipulation;bundle-version="1.5.0",
 org.eclipse.ltk.core.refactoring;bundle-version="3.6.0",
 org.eclipse.jface.text;bundle-version="3.8.1",
 org.eclipse.core.expressions;bundle-version="3.4.401",
 org.eclipse.core.externaltools;bundle-version="1.0.100",
 org.eclipse.jface;bundle-version="3.8.101",
 edu.utexas.seal.utilities;bundle-version="1.0.0",
 org.eclipse.core.filebuffers;bundle-version="3.5.200"
Bundle-ClassPath: .
Export-Package: edu.utexas.seal.refactorer

I have only one item: "." in Bundle-ClassPath.

like image 540
prosseek Avatar asked Jan 16 '13 19:01

prosseek


1 Answers

There is also the possibility to add the missing bundle via extra dependency configuration, directly to the failing bundle:

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
  <dependency-resolution>
   <extraRequirements>
    <requirement>
     <type>eclipse-plugin</type>
     <id>org.eclipse.jface.text</id>
     <versionRange>0.0.0</versionRange>
   </requirement>
  </extraRequirements>
 </dependency-resolution>
</configuration>
</plugin>
like image 70
Sumit Singh Avatar answered Sep 22 '22 14:09

Sumit Singh