Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ConcurrentModificationException in maven multi threaded build #546

Closed
dantran opened this issue Apr 11, 2016 · 1 comment
Closed

ConcurrentModificationException in maven multi threaded build #546

dantran opened this issue Apr 11, 2016 · 1 comment

Comments

@dantran
Copy link

dantran commented Apr 11, 2016

My maven multi thread build with a number of json2schema invocations, intermittently see this error ( not often)

[ERROR] Failed to execute goal org.jsonschema2pojo:jsonschema2pojo-maven-plugin:0.4.16:generate (default) on project telmgr-schema: Execution default of goal org.jsonschema2pojo:jsonschema2pojo-maven-plugin:0.4.16:generate failed. ConcurrentModificationException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jsonschema2pojo:jsonschema2pojo-maven-plugin:0.4.16:generate (default) on project telmgr-schema: Execution default of goal org.jsonschema2pojo:jsonschema2pojo-maven-plugin:0.4.16:generate failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at io.takari.maven.builder.smart.SmartBuilderImpl.buildProject(SmartBuilderImpl.java:334)
at io.takari.maven.builder.smart.SmartBuilderImpl$ProjectBuildTask.run(SmartBuilderImpl.java:104)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.jsonschema2pojo:jsonschema2pojo-maven-plugin:0.4.16:generate failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 10 more
Caused by: java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:901)
at java.util.ArrayList$Itr.next(ArrayList.java:851)
at org.jsonschema2pojo.util.Inflector.replaceWithFirstRule(Inflector.java:144)
at org.jsonschema2pojo.util.Inflector.singularize(Inflector.java:139)
at org.jsonschema2pojo.rules.ArrayRule.makeSingular(ArrayRule.java:101)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:81)
at org.jsonschema2pojo.rules.ArrayRule.apply(ArrayRule.java:37)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:106)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:73)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:30)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:74)
at org.jsonschema2pojo.rules.PropertyRule.apply(PropertyRule.java:41)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:60)
at org.jsonschema2pojo.rules.PropertiesRule.apply(PropertiesRule.java:31)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:122)
at org.jsonschema2pojo.rules.ObjectRule.apply(ObjectRule.java:66)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:88)
at org.jsonschema2pojo.rules.TypeRule.apply(TypeRule.java:38)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:73)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:66)
at org.jsonschema2pojo.rules.SchemaRule.apply(SchemaRule.java:30)
at org.jsonschema2pojo.SchemaMapper.generate(SchemaMapper.java:88)
at org.jsonschema2pojo.Jsonschema2Pojo.generateRecursive(Jsonschema2Pojo.java:109)
at org.jsonschema2pojo.Jsonschema2Pojo.generate(Jsonschema2Pojo.java:73)
at org.jsonschema2pojo.maven.Jsonschema2PojoMojo.execute(Jsonschema2PojoMojo.java:515)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)

@joelittlejohn
Copy link
Owner

This should be fixed if you upgrade to a later version (it was fixed in 0.4.17 and later as #435).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants