Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 139108 - <pde.exportPlugins> throws NullPointerException and ConcurrentModificationException when called using <antcall>
Summary: <pde.exportPlugins> throws NullPointerException and ConcurrentModificationExc...
Status: RESOLVED DUPLICATE of bug 58413
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-27 21:39 EDT by Simon Archer CLA
Modified: 2006-04-27 21:53 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Archer CLA 2006-04-27 21:39:17 EDT
Using Eclipse 3.2 RC1

Since I have the need to export projects as deployable plugins I used PDE's handy capability to create an Ant script that allows me to easily re-export my plugins at the push of a button.

So I have 3 Ant scripts, all of which work great on their own.  But, I decided to write a master Ant script that simply calls each of the Ant scripts generated by the PDE's export wizard.  Take a look:

  <?xml version="1.0" encoding="UTF-8"?>
  <project name="build" default="plugin_export">
    <target name="plugin_export">
      <ant antfile="cfa.xml"/>
      <ant antfile="mbaf.xml"/>
      <ant antfile="oaf.xml"/>
      <ant antfile="oaf-demo.xml"/>
    </target>
  </project>


And here's an example of one of the Ant scripts generated by the PDE's export wizard, but reformatted to satisfy Bugzilla's narrow margins:

  <?xml version="1.0" encoding="UTF-8"?>
  <project name="build" default="plugin_export">
    <target name="plugin_export">
      <pde.exportPlugins
        plugins="com.ibm.esc.oaf.base"
        destination="C:\export\eclipse32-rt-bundles"
        filename="oaf.zip"
        exportType="zip"
        useJARFormat="true"
        exportSource="false"/>
    </target>
  </project>

Nothing too surprising here.  But, when I run my master Ant script it complete in 230 milliseconds, leading me to think that the PDE task <pde.exportPlugins> is executing asynchronously.  A little later I get an error dialog stating that multiple errors have occurred.  One of the errors is a ConcurrentModificationException and the others are NullPointerExceptions.  Here's what I found in the .log file:

!ENTRY org.eclipse.core.jobs 4 2 2006-04-27 21:34:07.063
!MESSAGE An internal error occurred during: "PDE Export".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.pde.internal.build.AssembleConfigScriptGenerator.getUnpackClause(AssembleConfigScriptGenerator.java:405)
	at org.eclipse.pde.internal.build.AssembleConfigScriptGenerator.getFinalShape(AssembleConfigScriptGenerator.java:410)
	at org.eclipse.pde.internal.build.AssembleConfigScriptGenerator.generatePostProcessingSteps(AssembleConfigScriptGenerator.java:330)
	at org.eclipse.pde.internal.build.AssembleConfigScriptGenerator.generate(AssembleConfigScriptGenerator.java:133)
	at org.eclipse.pde.internal.build.packager.PackageScriptGenerator.basicGenerateAssembleConfigFileTargetCall(PackageScriptGenerator.java:54)
	at org.eclipse.pde.internal.build.AssembleScriptGenerator.generateMainTarget(AssembleScriptGenerator.java:76)
	at org.eclipse.pde.internal.build.AssembleScriptGenerator.generate(AssembleScriptGenerator.java:44)
	at org.eclipse.pde.internal.build.BuildScriptGenerator.generatePackageScripts(BuildScriptGenerator.java:292)
	at org.eclipse.pde.internal.build.BuildScriptGenerator.generateFeatures(BuildScriptGenerator.java:190)
	at org.eclipse.pde.internal.build.BuildScriptGenerator.generate(BuildScriptGenerator.java:85)
	at org.eclipse.pde.internal.core.exports.FeatureExportOperation.doExport(FeatureExportOperation.java:192)
	at org.eclipse.pde.internal.core.exports.FeatureBasedExportOperation.run(FeatureBasedExportOperation.java:46)
	at org.eclipse.pde.internal.core.ant.BaseExportTask$1.run(BaseExportTask.java:48)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)


Unfortunately I cleared my .log before I could get the stack trace for the ConcurrentModificationException, but I shall update this bug report if I see it again.  It seems that the timing has to be just right for this one to be thrown.

The bottom line seems to be that since <pde.exportPlugins> is asynchronous, returning before it is complete, it is not possible to write an Ant script that calls multiple <pde.exportPlugins> without exceptions being thrown.
Comment 1 Wassim Melhem CLA 2006-04-27 21:53:33 EDT

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