Thursday, September 2, 2010

Eclipse plugin/OSGI err: Validation failed : Missing constraint - Import-Package: x.y.z; version=".."

You might encounter this while dealing with eclipse plugins in eclipse EDE.
For sample while launching as Eclipse Application or Junit Plug-in test.

This is because of validation (automatically trigged) upon launch.
a. Goto Run/Debug Configuration -> Eclipse Application (say) -> your configuration name
b. In the right side you will see many tabs named Main, Arguments, Plug-ins etc.
Select Plug-ins
c. At the bottom you will see item 'Validate plug-ins automatically prior to launching' checked.
d. Though un checking it might resolve the problem temporarily (at launch) its not a real solution
e. To resolve it, click 'Add Required Plugins' at the right. It will automatically add required bundles if available. Now manually do 'Validate Plug-ins' and validation will pass.