Bug 568388 - Missing requirement: plugin requires 'osgi.ee; (&(osgi.ee=JavaSE)(version=11))' but it could not be found
Summary: Missing requirement: plugin requires 'osgi.ee; (&(osgi.ee=JavaSE)(version=11)...
Status: CLOSED DUPLICATE of bug 545653
Alias: None
Product: PDE
Classification: Eclipse Project
Component: Build (show other bugs)
Version: 4.17   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: pde-build-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-29 20:13 EDT by Chris Lake CLA
Modified: 2020-11-16 07:01 EST (History)
2 users (show)

See Also:


Attachments
Simple project to demonstrate problem (5.66 KB, application/x-zip-compressed)
2020-10-29 20:13 EDT, Chris Lake CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lake CLA 2020-10-29 20:13:38 EDT
Created attachment 284613 [details]
Simple project to demonstrate problem

Steps Good:
* Download JDK 11
* Download "Eclipse IDE for RCP and RAP Developers"
* Create Simple plugin and product (attached)
* Run Product Export Wizard
* Result: An exported product


Steps Bad:
* Download JDK 11
* Download Oomph
* Run to install "Eclipse IDE for RCP and RAP Developers"
** Ensure that Bundle Pool IS being used
* Import the above created project
* Result:
The following error occurred while executing this line:
C:\dev\ws\.metadata\.plugins\org.eclipse.pde.core\temp\org.eclipse.pde.container.feature\package.org.eclipse.pde.container.feature.win32.win32.x86_64.xml:182: The following error occurred while executing this line:
C:\Users\user\.p2\pool\plugins\org.eclipse.pde.build_3.10.800.v20200410-1419\scripts\genericTargets.xml:240: A problem occured while invoking the director.

Adding the following to the genericTargets.xml:
<property name="p2.director.log" value="c:/users/user/Desktop/director.log" />
<record name="c:/users/user/Desktop/build.log" loglevel="verbose"/>
Gives:
Missing requirement: Theplugin 1.0.0.202010291855 (theplugin 1.0.0.202010291855) requires 'osgi.ee; (&(osgi.ee=JavaSE)(version=11))' but it could not be found

After going through a load of analysis and debugging I narrowed this down to a slight difference in the config.ini for the "eclipse.p2.data.area". Using a bundle pool the value is written as a URI, i.e.:

* Non-Bundle-Pool = eclipse.p2.data.area=@config.dir/../p2
* Bundle-Pool = eclipse.p2.data.area=file\:/C\:/Users/qatester/.p2/

When "org.eclipse.pde.internal.core.target.ProfileBundleContainer.getProfileFileLocation()" is then run the following returns false:

p2DataArea = new File(p2Area);
if (p2DataArea == null || !p2DataArea.isDirectory())

The mean there is no reference repository which I'm guessing is where the profiles are located to be used as part of the export process.

I feel that this needs to be URI aware, or Oomph needs to write the value without the "file:\" component.

I tried the following which seemed to work:

  try {
    if (URIUtil.isFileURI(new URI(p2Area))) { 
      p2DataArea = new File(new URI(p2Area));
    }
    else {
      p2DataArea = new File(p2Area);
    }
  } catch (URISyntaxException e) {
    throw new CoreException(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, "No Config Area"));
  }
Comment 1 Chris Lake CLA 2020-10-30 02:00:14 EDT
> I tried the following which seemed to work:
> 
>   try {
>     if (URIUtil.isFileURI(new URI(p2Area))) { 
>       p2DataArea = new File(new URI(p2Area));
>     }
>     else {
>       p2DataArea = new File(p2Area);
>     }
>   } catch (URISyntaxException e) {
>     throw new CoreException(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, "No Config Area"));
>   }

Forget that, I don't know why I thought it worked, but it doesn't :(
Comment 2 Vikas Chandra CLA 2020-10-30 04:36:34 EDT
Patches would be welcome !
Comment 3 Mickael Istria CLA 2020-11-16 07:01:46 EST
I think it's a dup of bug 545653 . Please reopen if you disagree.

*** This bug has been marked as a duplicate of bug 545653 ***