Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333981

Summary: Unreported compile errors for pde.build ant tasks
Product: [Eclipse Project] Platform Reporter: Jeff McAffer <jeffmcaffer>
Component: RelengAssignee: Kim Moir <kim.moir>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: aniefer, daniel_megert, kim.moir, tjwatson
Version: 3.7   
Target Milestone: 3.7 M7   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Jeff McAffer CLA 2011-01-11 09:50:20 EST
in i0104

I am trying to export the PDE Build product from my workspace.  If "Generate Metadata Repository" is checked then the error attached below is reported and the export fails.  If the box is deselected, the export works.

Seems that somehow Repo2RunnableTask is not being picked up.  I verified that it does infact exist in the repository.tools bundle's ant tasks.

/workspaces/lgc/.metadata/.plugins/org.eclipse.pde.core/temp/org.eclipse.pde.container.feature/assemble.org.eclipse.pde.container.feature.p2.xml:38: The following error occurred while executing this line:
/workspaces/lgc/.metadata/.plugins/org.eclipse.pde.core/temp/org.eclipse.pde.container.feature/assemble.org.eclipse.pde.container.feature.p2.xml:106: Problem: failed to create task or type eclipse.brand.p2.artifacts
Cause: Could not load a dependent class Repo2RunnableTask
       This class may be in a separate JAR that is not installed.
Action: Determine what extra JAR files are needed, and place them in one of:
        -/workspaces/lgc/.metadata/.plugins/org.eclipse.pde.core/temp/org.eclipse.pde.container.feature/assemble.org.eclipse.pde.container.feature.p2.xml/lib
        -/Users/jeff/.ant/lib
        -a directory added on the command line with the -lib argument

Do not panic, this is a common problem.
The commonest cause is a missing JAR.

This is not a bug; it is a configuration problem

The following error occurred while executing this line:
/workspaces/lgc/.metadata/.plugins/org.eclipse.pde.core/temp/org.eclipse.pde.container.feature/assemble.org.eclipse.pde.container.feature.p2.xml:106: Problem: failed to create task or type eclipse.brand.p2.artifacts
Cause: Could not load a dependent class Repo2RunnableTask
       This class may be in a separate JAR that is not installed.
Action: Determine what extra JAR files are needed, and place them in one of:
        -/workspaces/lgc/.metadata/.plugins/org.eclipse.pde.core/temp/org.eclipse.pde.container.feature/assemble.org.eclipse.pde.container.feature.p2.xml/lib
        -/Users/jeff/.ant/lib
        -a directory added on the command line with the -lib argument

Do not panic, this is a common problem.
The commonest cause is a missing JAR.

This is not a bug; it is a configuration problem
Comment 1 Andrew Niefer CLA 2011-01-12 11:53:59 EST
There is a real problem here, I don't know what is wrong, This caused junit failures in N20110111-2000
Comment 2 Jeff McAffer CLA 2011-01-12 13:18:07 EST
Interestingly, the error is reporting that it cannot load Repo2RunnableTask, not org.eclipse.equinox.p2.repository.tools.Repo2RunnableTask (or whatever the full name is).  I did a quick trace in the classloading and found that indeed, when loading BrandP2Task there is an attempt to load "Repo2RunnableTask" (not qualified).  This is a at the classloader level so I don't see how it could ever succeed.

I did verify that the repo tools jar is on the AntClassloader classpath and that that file does contain Repo2RunnableTask.class.

My only thought right now is that the version of the BrandP2Task being used actually has a compile error in it and is really not complete.  If for example the Repo2RunnableTask was not resolved at compile time then in theory the output class may just reference the unqualified class name...  Wild guess.
Comment 3 Andrew Niefer CLA 2011-01-12 13:46:28 EST
There are actually compilation problems in BrandP2Task that did not get reported during the build.

These are caused by a bad classpath in the generated build.xml :
<pathelement
path="../../pdebaseLocation/plugins/org.eclipse.equinox.p2.repository.tools_2.0.100.N20110111-2000.jar/lib/repository-tools-ant.jar"/>


We are getting binary bundles from ../../pdebaseLocation on our classpath, this
results in being unable to access nested jars which we would expect to find in
when compiling against the source.
Comment 4 Andrew Niefer CLA 2011-01-12 13:48:44 EST
(In reply to comment #2)
> My only thought right now is that the version of the BrandP2Task being used
> actually has a compile error in it and is really not complete.  If for example
> the Repo2RunnableTask was not resolved at compile time then in theory the
> output class may just reference the unqualified class name...  Wild guess.

This is exactly what happened.  Olivier will be raising a bug against JDT to do something different so that the class can be loaded and you end up getting Unresolved compilation errors whenever you try to use it.  This would be much easier to debug.
Comment 5 Jeff McAffer CLA 2011-01-12 13:55:31 EST
Great.  I'm bumping the severity up since this problem trashes significant workflows.  Can we get this fixed for M5?
Comment 6 Kim Moir CLA 2011-04-29 10:57:53 EDT
I think this can be closed because the artifacts in bug 330240 aren't being built now.  Also the same issue is described in bug 333981.