| ConcurrentModificationException | ConcurrentModificationException 2003-07-14 - By Adam Jack
Hi.
We have an ant task that "imports" a build file into this run. Recently it has started failing (on Gump), i.e. w/ latest ant code.
Target.java: 316 is the next() below.
public void execute() throws BuildException { if (testIfCondition() && testUnlessCondition()) { Iterator it = children.iterator(); while (it.hasNext()) { Object o = it.next(); <<<--Thrown here
In short, ant is complaining that the task is modifying the list of tasks for the current target.
Since we import a script with "top level" tasks (not in targets), this change to the target's task list seems inevitable. As such, I can't understand why/how this code ever works/worked, yet it has -- for quite a while.
All thoughts appreciated.
regards
Adam -----Original Message----- From: Adam Jack [mailto:ajack@(protected)] Sent: Monday, July 14, 2003 5:57 PM To: 'krysalis-developers@(protected)' Subject: RE: ConcurrentModificationException
Scary, 'cos this seems to be right after importing "core" and nothing more fancy.
I've inserted the code below into CentipedeTask (in 3 places), and it seems that the tasks (without target) in the core xbuild.xml appear to get associate with the current task's target (i.e. CentipedeTask's target).
What I just can't understand though, is why it ever works? This output below was from running centipede on antlibs and was w/o failure.
Time to take this to ant user's list I think.
regards
Adam ---------------------------------------------------------------------------- -------------------------
Buildfile: build.xml [centipede] Log Target Tasks (for crash debugging) Start of execute() : (#5) [centipede] 0) -> description - org.apache.tools.ant.UnknownElement@(protected) [centipede] 1) -> taskdef - org.apache.tools.ant.taskdefs.Taskdef@(protected) [centipede] 2) -> centipede - org.krysalis.centipede.ant.CentipedeTask@(protected) [centipede] 3) -> import - org.apache.tools.ant.UnknownElement@(protected) [centipede] 4) -> patternset - org.apache.tools.ant.UnknownElement@(protected)
[centipede] Initializing Centipede [1.0.0.b.6.10000]... [centipede] Log Target Tasks (for crash debugging) Before import core() : (#5) [centipede] 0) -> description - org.apache.tools.ant.UnknownElement@(protected) [centipede] 1) -> taskdef - org.apache.tools.ant.taskdefs.Taskdef@(protected) [centipede] 2) -> centipede - org.krysalis.centipede.ant.CentipedeTask@(protected) [centipede] 3) -> import - org.apache.tools.ant.UnknownElement@(protected) [centipede] 4) -> patternset - org.apache.tools.ant.UnknownElement@(protected) [centipede] ...Centipede started.
[centipede] Log Target Tasks (for crash debugging) After import core() : (#72) [centipede] 0) -> description - org.apache.tools.ant.UnknownElement@(protected) [centipede] 1) -> taskdef - org.apache.tools.ant.taskdefs.Taskdef@(protected) [centipede] 2) -> centipede - org.krysalis.centipede.ant.CentipedeTask@(protected) [centipede] 3) -> import - org.apache.tools.ant.UnknownElement@(protected) [centipede] 4) -> patternset - org.apache.tools.ant.UnknownElement@(protected) [centipede] 5) -> description - org.apache.tools.ant.UnknownElement@(protected) [centipede] 6) -> tstamp - org.apache.tools.ant.UnknownElement@(protected) [centipede] 7) -> buildnumber - org.apache.tools.ant.UnknownElement@(protected) [centipede] 8) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 9) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 10) -> available - org.apache.tools.ant.UnknownElement@(protected) [centipede] 11) -> echo - org.apache.tools.ant.UnknownElement@(protected) [centipede] 12) -> path - org.apache.tools.ant.UnknownElement@(protected) [centipede] 13) -> taskdef - org.apache.tools.ant.UnknownElement@(protected) [centipede] 14) -> typedef - org.apache.tools.ant.UnknownElement@(protected) [centipede] 15) -> taskdef - org.apache.tools.ant.UnknownElement@(protected) [centipede] 16) -> xmlproperty - org.apache.tools.ant.UnknownElement@(protected) [centipede] 17) -> xmlproperty - org.apache.tools.ant.UnknownElement@(protected) [centipede] 18) -> xmlproperty - org.apache.tools.ant.UnknownElement@(protected) [centipede] 19) -> xmlproperty - org.apache.tools.ant.UnknownElement@(protected) [centipede] 20) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 21) -> available - org.apache.tools.ant.UnknownElement@(protected) [centipede] 22) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 23) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 24) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 25) -> dirname - org.apache.tools.ant.UnknownElement@(protected) [centipede] 26) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 27) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 28) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 29) -> echo - org.apache.tools.ant.UnknownElement@(protected) [centipede] 30) -> mkdir - org.apache.tools.ant.UnknownElement@(protected) [centipede] 31) -> mkdir - org.apache.tools.ant.UnknownElement@(protected) [centipede] 32) -> mkdir - org.apache.tools.ant.UnknownElement@(protected) [centipede] 33) -> mkdir - org.apache.tools.ant.UnknownElement@(protected) [centipede] 34) -> mkdir - org.apache.tools.ant.UnknownElement@(protected) [centipede] 35) -> mkdir - org.apache.tools.ant.UnknownElement@(protected) [centipede] 36) -> mkdir - org.apache.tools.ant.UnknownElement@(protected) [centipede] 37) -> condition - org.apache.tools.ant.UnknownElement@(protected) [centipede] 38) -> condition - org.apache.tools.ant.UnknownElement@(protected) [centipede] 39) -> condition - org.apache.tools.ant.UnknownElement@(protected) [centipede] 40) -> if - org.apache.tools.ant.UnknownElement@(protected) [centipede] 41) -> condition - org.apache.tools.ant.UnknownElement@(protected) [centipede] 42) -> condition - org.apache.tools.ant.UnknownElement@(protected) [centipede] 43) -> condition - org.apache.tools.ant.UnknownElement@(protected) [centipede] 44) -> condition - org.apache.tools.ant.UnknownElement@(protected) [centipede] 45) -> condition - org.apache.tools.ant.UnknownElement@(protected) [centipede] 46) -> condition - org.apache.tools.ant.UnknownElement@(protected) [centipede] 47) -> condition - org.apache.tools.ant.UnknownElement@(protected) [centipede] 48) -> condition - org.apache.tools.ant.UnknownElement@(protected) [centipede] 49) -> condition - org.apache.tools.ant.UnknownElement@(protected) [centipede] 50) -> if - org.apache.tools.ant.UnknownElement@(protected) [centipede] 51) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 52) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 53) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 54) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 55) -> echo - org.apache.tools.ant.UnknownElement@(protected) [centipede] 56) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 57) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 58) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 59) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 60) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 61) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 62) -> if - org.apache.tools.ant.UnknownElement@(protected) [centipede] 63) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 64) -> if - org.apache.tools.ant.UnknownElement@(protected) [centipede] 65) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 66) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 67) -> property - org.apache.tools.ant.UnknownElement@(protected) [centipede] 68) -> style - org.apache.tools.ant.UnknownElement@(protected) [centipede] 69) -> import - org.apache.tools.ant.UnknownElement@(protected) [centipede] 70) -> path - org.apache.tools.ant.UnknownElement@(protected) [centipede] 71) -> echo - org.apache.tools.ant.UnknownElement@(protected)
private void logTargetTasks(String where) {
Target target = getOwningTarget();
Task[] tasks = target.getTasks();
log( "******** Log Target Tasks (for crash debugging) " + where + " : " + target + " (#" + tasks.length + ")", Project.MSG_INFO);
for (int i = 0; i < tasks.length; ++i) { log( i + ") -> " + tasks[i].getTaskName() + " - " + tasks[i], Project.MSG_VERBOSE); } } regards
Adam -----Original Message----- From: krysalis-developers-admin@(protected) [mailto:krysalis-developers-admin@(protected)]On Behalf Of Nick Chalko Sent: Monday, July 14, 2003 2:42 PM To: krysalis-developers@(protected) Subject: Re: ConcurrentModificationException
Here is the output from krysalis-antlibs/makeantlib
ant -debug install
Apache Ant version 1.6alpha compiled on July 14 2003 Buildfile: build.xml Adding reference: ant.PropertyHelper -> org.apache.tools.ant.PropertyHelper@(protected) Detected Java version: 1.4 in: c:\j2sdk1.4.2\jre Detected OS: Windows 2000 Adding reference: ant.ComponentHelper -> org.apache.tools.ant.ComponentHelper@(protected) Setting ro project property: ant.version -> Apache Ant version 1.6alpha compiled on July 14 2003 Setting ro project property: ant.file -> c:\krysalis\krysalis-antlibs\makeantlib\build.xml Adding reference: ant.projectHelper -> org.apache.tools.ant.helper.ProjectHelper2@(protected) Adding reference: ant.parsing.context -> org.apache.tools.ant.helper.AntXMLContext@(protected) Adding reference: ant.targets -> [] parsing buildfile c:\krysalis\krysalis-antlibs\makeantlib\build.xml with URI = file:///C:/krysalis/krysalis-antlibs/makeantlib/build.xml Setting ro project property: ant.project.name -> makeantlib.antlib Adding reference: makeantlib.antlib -> org.apache.tools.ant.Project@(protected) Setting ro project property: ant.file.makeantlib.antlib -> c:\krysalis\krysalis-antlibs\makeantlib\build.xml Project base dir set to: C:\krysalis\krysalis-antlibs\makeantlib +Target: +Task: taskdef Resource centipede loaded from parent loader Class org.krysalis.centipede.ant.ImportAntLibTask loaded from parent loader (parentFirst) +Datatype importantlib org.krysalis.centipede.ant.ImportAntLibTask Class org.krysalis.centipede.ant.CentipedeTask loaded from parent loader (parentFirst) +Datatype centipede org.krysalis.centipede.ant.CentipedeTask +Datatype importcent org.krysalis.centipede.ant.ImportAntLibTask Class org.krysalis.centipede.ant.RuperDependTask loaded from parent loader (parentFirst) +Datatype ruperDepend org.krysalis.centipede.ant.RuperDependTask +Datatype importAntLib org.krysalis.centipede.ant.ImportAntLibTask Class org.krysalis.centipede.ant.OptionalClassLoader loaded from parent loader (parentFirst) +Datatype optionalclassloader org.krysalis.centipede.ant.OptionalClassLoader +Task: centipede Setting ro project property: centipede.version -> 1.0.0.ReleaseLevel.BETA.6.10000 [centipede] Initializing Centipede [1.0.0.ReleaseLevel.BETA.6.10000]... [centipede] Loading Viprom... [centipede] ...Viprom ok. [centipede] Adding property interceptor ... [centipede] ...property interceptor ok. [centipede] Importing core xbuild... [centipede] Importing Centiopede core xbuild: [centipede] Local repositories: [centipede] Remote repositories: [centipede] checkforupdate=false Resource Updater created around [file://C:/krysalis/krysalis-antlibs/makeantlib] with copy-local-to-target [true] and build.sysclasspath [null] [centipede] Property "antlibs.dir" not set. [centipede] Added c:\tools\ant\tools\antlibs to local repositories. [centipede] Property "user.home" set, but directory [C:\Documents and Settings\nchalko\lib\antlibs] not found. [centipede] Property "basedir" set, but directory [C:\krysalis\krysalis-antlibs\makeantlib\tools\antlibs] not found. [centipede] Property "build.dir" not set. Import AntLib : core.antlib Find Locally (otherwise Download from Remote) : core.antlib Find Or Downloadfile://C:/krysalis/krysalis-antlibs/makeantlib/core.antlib] in Repository Set[ruper (Local:1, Remote:2)] (true). Find Or Download Resource [core[*unset*.*unset*][.antlib][file://C:/krysalis/krysalis-antlibs/makeantl ib/core.antlib]] (true, false). InstanceIdentifier to match : [core[*unset*.*unset*][.antlib][file://C:/krysalis/krysalis-antlibs/makeantl ib/core.antlib]] Locate Best [core[*unset*.*unset*][.antlib][file://C:/krysalis/krysalis-antlibs/makeantl ib/core.antlib]] in Repository [FlatRepository [file://c:/tools/ant/tools/antlibs]] Consider :core*(~true) [file://c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib] Candidate [core[0.0.1.ReleaseLevel.DEVELOPMENT][.antlib][file://c:/tools/ant/tools/ant libs/core-0.0.1-dev.antlib]] in repository [Repository (ant.home) : file://c:/tools/ant/tools/antlibs] Best Match In Repository : core[0.0.1.ReleaseLevel.DEVELOPMENT][.antlib][file://c:/tools/ant/tools/antl ibs/core-0.0.1-dev.antlib] New Best Match : core[0.0.1.ReleaseLevel.DEVELOPMENT][.antlib][file://c:/tools/ant/tools/antl ibs/core-0.0.1-dev.antlib] No Target Repository on ResourceUpdater. Selected Destination Repository [FlatRepository [file://c:/tools/ant/tools/antlibs]]. Possibly Unarchive [file://c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib] Copy from [core[0.0.1.ReleaseLevel.DEVELOPMENT][.antlib][file://c:/tools/ant/tools/ant libs/core-0.0.1-dev.antlib]] to [file://c:/tools/ant/tools/antlibs] as [file://c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib]. Found [file://c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib] matching [core[*unset*.*unset*][.antlib][file://C:/krysalis/krysalis-antlibs/makeantl ib/core.antlib]]. Setting project property: core.antlib.dir -> c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib [centipede] set 'core.antlib.dir' to 'c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib' [centipede] import file : //c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib/xbuild.xml Importing file //c:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib/xbuild.xml from c:\krysalis\krysalis-antlibs\makeantlib\build.xml parsing buildfile c:\tools\ant\tools\antlibs\core-0.0.1-dev.antlib\xbuild.xml with URI = file:///C:/tools/ant/tools/antlibs/core-0.0.1-dev.antlib/xbuild.xml Setting ro project property: ant.file.core.antlib -> c:\tools\ant\tools\antlibs\core-0.0.1-dev.antlib\xbuild.xml Adding reference: core.classpath -> org.apache.tools.ant.UnknownElement@(protected) Adding reference: centipede.classpath -> org.apache.tools.ant.UnknownElement@(protected) [centipede] ...core xbuild ok. [centipede] ...Centipede started.
BUILD FAILED java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:4 48) at java.util.AbstractList$Itr.next(AbstractList.java:419) at org.apache.tools.ant.Target.execute(Target.java:316) at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java: 127) at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav a:117) at org.apache.tools.ant.Main.runBuild(Main.java:637) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:162) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:85)
Total time: 4 seconds java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:4 48) at java.util.AbstractList$Itr.next(AbstractList.java:419) at org.apache.tools.ant.Target.execute(Target.java:316) at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java: 127) at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav a:117) at org.apache.tools.ant.Main.runBuild(Main.java:637) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:162) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:85)
------------------------------------------------------- This SF.Net email sponsored by: Parasoft Error proof Web apps, automate testing & more. Download & eval WebKing and get a free book. www.parasoft.com/bulletproofapps1 _______________________________________________ Krysalis-developers mailing list Krysalis-developers@(protected) https://lists.sourceforge.net/lists/listinfo/krysalis-developers
--------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
|
|
 |