How to prevent java.lang.OutOfMemoryError: PermGen space? [duplicate] - scala

This question already has answers here:
How to prevent java.lang.OutOfMemoryError: PermGen space at Scala compilation?
(9 answers)
Closed 9 years ago.
I am frequently getting an OutOfMemoryError from SBT.
> test
[error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
[error] Use 'last' for the full log.
> last
[debug] Running task... Cancelable: false, check cycles: false
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set()
[debug] Removed products: Set()
[debug] Modified external sources: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set()
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] Initially invalidated: Set()
[debug] Copy resource mappings:
[debug]
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set()
[debug] Removed products: Set()
[debug] Modified external sources: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set()
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] Initially invalidated: Set()
[debug] Copy resource mappings:
[debug]
[debug] Framework implementation 'org.scalacheck.ScalaCheckFramework' not present.
[debug] Framework implementation 'org.specs.runner.SpecsFramework' not present.
[debug] Framework implementation 'org.scalatest.tools.ScalaTestFramework' not present.
[debug] Framework implementation 'com.novocode.junit.JUnitFramework' not present.
[debug] Subclass fingerprints: Stream((org.specs2.specification.SpecificationStructure,false,org.specs2.runner.Fingerprints$$anon$1#34d6488c), ?)
[debug] Annotation fingerprints: Stream()
[debug] Running Test ExpandoObjectTest : subclass(false, org.specs2.specification.SpecificationStructure) with arguments
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at sbt.ConcurrentRestrictions$$anon$4.take(ConcurrentRestrictions.scala:196)
at sbt.Execute.next$1(Execute.scala:85)
at sbt.Execute.processAll(Execute.scala:88)
at sbt.Execute.runKeep(Execute.scala:68)
at sbt.EvaluateTask$.run$1(EvaluateTask.scala:162)
at sbt.EvaluateTask$.runTask(EvaluateTask.scala:177)
at sbt.Aggregation$$anonfun$4.apply(Aggregation.scala:46)
at sbt.Aggregation$$anonfun$4.apply(Aggregation.scala:44)
at sbt.EvaluateTask$.withStreams(EvaluateTask.scala:137)
at sbt.Aggregation$.runTasksWithResult(Aggregation.scala:44)
at sbt.Aggregation$.runTasks(Aggregation.scala:59)
at sbt.Aggregation$$anonfun$applyTasks$1.apply(Aggregation.scala:31)
at sbt.Aggregation$$anonfun$applyTasks$1.apply(Aggregation.scala:30)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:62)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:62)
at sbt.Command$.process(Command.scala:90)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(MainLoop.scala:71)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(MainLoop.scala:71)
at sbt.State$$anon$2.process(State.scala:170)
at sbt.MainLoop$$anonfun$next$1.apply(MainLoop.scala:71)
at sbt.MainLoop$$anonfun$next$1.apply(MainLoop.scala:71)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.MainLoop$.next(MainLoop.scala:71)
at sbt.MainLoop$.run(MainLoop.scala:64)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:53)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:50)
at sbt.Using.apply(Using.scala:25)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:50)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:33)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:17)
at sbt.MainLoop$.runLogged(MainLoop.scala:13)
at sbt.xMain.run(Main.scala:26)
at xsbt.boot.Launch$.run(Launch.scala:55)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:45)
at xsbt.boot.Launch$.launch(Launch.scala:69)
at xsbt.boot.Launch$.apply(Launch.scala:16)
at xsbt.boot.Boot$.runImpl(Boot.scala:31)
at xsbt.boot.Boot$.main(Boot.scala:20)
at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at sbt.Project$$anon$5.apply(Project.scala:130)
at sbt.Project$$anon$5.apply(Project.scala:128)
at sbt.LogManager$.commandBase$1(LogManager.scala:59)
at sbt.LogManager$.command$1(LogManager.scala:60)
at sbt.LogManager$$anonfun$suppressedMessage$1.apply(LogManager.scala:61)
at sbt.LogManager$$anonfun$suppressedMessage$1.apply(LogManager.scala:61)
at sbt.ConsoleLogger.trace(ConsoleLogger.scala:163)
at sbt.AbstractLogger.log(Logger.scala:32)
at sbt.MultiLogger$$anonfun$dispatch$1.apply(MultiLogger.scala:40)
at sbt.MultiLogger$$anonfun$dispatch$1.apply(MultiLogger.scala:38)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:76)
at sbt.MultiLogger.dispatch(MultiLogger.scala:38)
at sbt.MultiLogger.trace(MultiLogger.scala:30)
at sbt.TestLogger$$anon$2.trace(TestReportListener.scala:71)
at sbt.TestLogger.endGroup(TestReportListener.scala:88)
at sbt.TestRunner$$anonfun$run$5.apply(TestFramework.scala:87)
at sbt.TestRunner$$anonfun$run$5.apply(TestFramework.scala:87)
at sbt.TestFramework$$anonfun$safeForeach$1.apply(TestFramework.scala:112)
at sbt.TestFramework$$anonfun$safeForeach$1.apply(TestFramework.scala:112)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
[error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
[error] Use 'last' for the full log.
Sometimes it also exits abruptly with:
sbt appears to be exiting abnormally.
The log file for this session is at /var/folders/vf/3khb58091wd0_1rz1yh6knb00000gp/T/sbt3242766352271599341.log
java.lang.OutOfMemoryError: PermGen space
Error during sbt execution: java.lang.OutOfMemoryError: PermGen space
Any solutions?

This sometimes happens if you compile huge codebases - a lot of classes get loaded into the VM running sbt.
You need to increase the PermGen space for sbt - use the flag -XX:MaxPermSize=256m, where 256 you can change with the desired size of the permanent generation.
Run:
cat `which sbt`
to locate you sbt startup script. Then edit it to include the flag with the java command that runs the sbt launcher in the similar way as it is described here for modifying -Xmx and -Xms.
Adding the -XX:+CMSClassUnloadingEnabled flag should also enable sbt to unload the classloaders with classes from the previous compilation runs that are no longer being used.
EDIT:
Alternatively, you can set these options in the SBT_OPTS environment variable if you are using the extended script for running sbt.

Related

Tomcat 9.0.52 crashes with "java.util.zip.ZipException: invalid LOC header (bad signature)" when started in debug mode - any work-around?

When trying to start Tomcat (9.0.52) in debug mode ("Debug on Server") from Eclipse (v2020-12 (4.18.0) / Build id: 20201210-1552) I get the following error (see full stacktrace further below):
16-Aug-2021 13:52:14.019 SEVERE [main] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#61322f9d]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
...
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#61322f9d]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
...
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:143)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
... 33 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method)
...
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:143)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
... 33 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
While the reasons seems clear - there is some issue reading a .jar file - the question I have is:
How can I find out, WHICH .jar is causing this issue? Is there some option to get more info on the root cause: which library (either from Tomcat or which application-jar?) that it tries to read is causing this?
The odd thing is: When I start this up in normal "run" mode in Eclipse or as a Windows Service, then Tomcat as well as the application start up fine. This zip-file problem only happens when I try to start it in debug mode! And - when starting Tomcat from Eclipse - then no .war-file is created but rather Tomcat's classpath is adjusted such, that the class files are used in-situ (i.e. directly from the target directory where they have been compiled to). So there is no additional .jar file created compared to the non-debug mode (which is why I am puzzled why this happens only in debug mode).
Eclipse uses Java 14 (if I am correct) but is configured to compile to 1.8 compatibility and the runtime (i.e. Tomcat and our application) uses Java 1.8 (I have installed the "almost latest" AdoptOpenJDK v1.8 / jdk-8.0.292.10-hotspot).
Tomcat's download page (https://tomcat.apache.org/whichversion.html) claims, that Tomcat 9.0.52 runs with Java "8 and later", so IMHO I should be OK in terms of prereq's.
Any idea how to get the above setup starting up/working in debug mode?
Full stacktrace:
...
16-Aug-2021 13:52:11.275 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1232] milliseconds
16-Aug-2021 13:52:11.343 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
16-Aug-2021 13:52:11.343 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.52]
16-Aug-2021 13:52:11.866 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
16-Aug-2021 13:52:13.860 WARNING [main] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [1,954] milliseconds.
16-Aug-2021 13:52:14.019 SEVERE [main] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#61322f9d]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:926)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#61322f9d]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:726)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4885)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5023)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
... 21 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:143)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
... 33 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method)
at java.util.zip.ZipFile.access$1400(ZipFile.java:60)
at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:734)
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:434)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at sun.misc.IOUtils.readNBytes(IOUtils.java:180)
at sun.misc.IOUtils.readAllBytes(IOUtils.java:116)
at java.util.jar.JarFile.getBytes(JarFile.java:426)
at java.util.jar.JarFile.getManifestFromReference(JarFile.java:193)
at java.util.jar.JarFile.getManifest(JarFile.java:180)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:141)
... 34 more
Later addition: I also tried the entire setup using a Java 11 VM for Tomcat but with the same result. So, this issue with some .jar-file having an invalid header or signature is apparently NOT a Java<=(1.)8 vs. Java >=v9 issue. So I reverted back to Java 1.8.
A day later:
This morning when I tried to restart Tomcat again in debug mode to investigate further, the server started up! No more .zip-file issues! The problem just vanished... :-)
Thanks to all who responded!

ERRAI Tutorial (3.1.1) error during deployment on Wildfly server

I am running the stock Errai-Tutorial (3.1.1) in Eclipse using Maven 3.2.1. It runs fine in SuperDev mode, but when I try to deploy it using 'clean package wildfly:deploy', everything compiles fine but I get an error during deployment (with the Debug flag set):
[INFO] <<< wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) # errai-tutorial <<<
[INFO]
[INFO] --- wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) # errai-tutorial ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=1, ConflictMarker.nodeCount=130, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=53, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=1, ConflictResolver.conflictItemCount=109, DefaultDependencyCollector.collectTime=84, DefaultDependencyCollector.transformTime=2}
[DEBUG] org.wildfly.plugins:wildfly-maven-plugin:jar:1.0.2.Final:
[DEBUG] org.apache.commons:commons-compress:jar:1.5:compile
[DEBUG] org.tukaani:xz:jar:1.2:compile
[DEBUG] org.apache.maven:maven-core:jar:3.0.5:compile
[DEBUG] org.apache.maven:maven-model:jar:3.0.5:compile
[DEBUG] org.apache.maven:maven-settings:jar:3.0.5:compile
[DEBUG] org.apache.maven:maven-settings-builder:jar:3.0.5:compile
[DEBUG] org.apache.maven:maven-repository-metadata:jar:3.0.5:compile
[DEBUG] org.apache.maven:maven-artifact:jar:3.0.5:compile
[DEBUG] org.apache.maven:maven-model-builder:jar:3.0.5:compile
[DEBUG] org.apache.maven:maven-aether-provider:jar:3.0.5:compile
[DEBUG] org.sonatype.aether:aether-spi:jar:1.13.1:compile
[DEBUG] org.sonatype.aether:aether-impl:jar:1.13.1:compile
[DEBUG] org.sonatype.aether:aether-api:jar:1.13.1:compile
[DEBUG] org.sonatype.aether:aether-util:jar:1.13.1:compile
[DEBUG] org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0:compile
[DEBUG] org.sonatype.sisu:sisu-inject-bean:jar:2.3.0:compile
[DEBUG] org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0:compile
[DEBUG] org.sonatype.sisu:sisu-guava:jar:0.9.9:compile
[DEBUG] org.codehaus.plexus:plexus-interpolation:jar:1.14:compile
[DEBUG] org.codehaus.plexus:plexus-classworlds:jar:2.4:compile
[DEBUG] org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[DEBUG] org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3:compile
[DEBUG] org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[DEBUG] org.apache.maven:maven-plugin-api:jar:3.0.5:compile
[DEBUG] org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.2:compile
[DEBUG] org.codehaus.plexus:plexus-utils:jar:3.0.10:compile
[DEBUG] org.jboss.jdf:stacks-client:jar:1.0.2.Final:compile
[DEBUG] org.yaml:snakeyaml:jar:1.10:compile
[DEBUG] org.apache.httpcomponents:httpclient:jar:4.0.1:compile
[DEBUG] org.apache.httpcomponents:httpcore:jar:4.0.1:compile
[DEBUG] commons-logging:commons-logging:jar:1.1.1:compile
[DEBUG] commons-codec:commons-codec:jar:1.3:compile
[DEBUG] org.jboss.logging:jboss-logging:jar:3.1.2.GA:compile
[DEBUG] org.wildfly:wildfly-cli:jar:8.1.0.Final:compile
[DEBUG] org.jboss.aesh:aesh:jar:0.33.11:compile
[DEBUG] org.fusesource.jansi:jansi:jar:1.9:compile
[DEBUG] org.jboss:staxmapper:jar:1.1.0.Final:compile
[DEBUG] org.wildfly.security:wildfly-security-manager:jar:1.0.0.Final:compile
[DEBUG] org.jboss.sasl:jboss-sasl:jar:1.0.4.Final:compile
[DEBUG] org.jboss.remoting:jboss-remoting:jar:4.0.3.Final:compile
[DEBUG] org.jboss.remotingjmx:remoting-jmx:jar:2.0.0.Final:compile
[DEBUG] org.jboss.marshalling:jboss-marshalling:jar:1.4.2.Final:compile
[DEBUG] org.jboss.marshalling:jboss-marshalling-river:jar:1.4.2.Final:compile
[DEBUG] org.jboss:jboss-vfs:jar:3.2.5.Final:compile
[DEBUG] sun.jdk:jconsole:jar:jdk:system
[DEBUG] org.wildfly:wildfly-build-config:jar:8.1.0.Final:compile
[DEBUG] org.wildfly:wildfly-controller-client:jar:8.1.0.Final:compile
[DEBUG] org.jboss:jboss-dmr:jar:1.2.0.Final:compile
[DEBUG] org.jboss.threads:jboss-threads:jar:2.1.1.Final:compile
[DEBUG] org.wildfly:wildfly-protocol:jar:8.1.0.Final:compile
[DEBUG] org.jboss.xnio:xnio-api:jar:3.2.2.Final:compile
[DEBUG] org.jboss.xnio:xnio-nio:jar:3.2.2.Final:compile
[DEBUG] Created new class realm plugin>org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final
[DEBUG] Importing foreign packages into class realm plugin>org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final
[DEBUG] Imported: < maven.api
[DEBUG] Populating class realm plugin>org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final
[DEBUG] Included: org.wildfly.plugins:wildfly-maven-plugin:jar:1.0.2.Final
[DEBUG] Included: org.apache.commons:commons-compress:jar:1.5
[DEBUG] Included: org.tukaani:xz:jar:1.2
[DEBUG] Included: org.sonatype.aether:aether-util:jar:1.13.1
[DEBUG] Included: org.sonatype.sisu:sisu-inject-bean:jar:2.3.0
[DEBUG] Included: org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0
[DEBUG] Included: org.sonatype.sisu:sisu-guava:jar:0.9.9
[DEBUG] Included: org.codehaus.plexus:plexus-interpolation:jar:1.14
[DEBUG] Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
[DEBUG] Included: org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3
[DEBUG] Included: org.sonatype.plexus:plexus-cipher:jar:1.4
[DEBUG] Included: org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.2
[DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:3.0.10
[DEBUG] Included: org.jboss.jdf:stacks-client:jar:1.0.2.Final
[DEBUG] Included: org.yaml:snakeyaml:jar:1.10
[DEBUG] Included: org.apache.httpcomponents:httpclient:jar:4.0.1
[DEBUG] Included: org.apache.httpcomponents:httpcore:jar:4.0.1
[DEBUG] Included: commons-logging:commons-logging:jar:1.1.1
[DEBUG] Included: commons-codec:commons-codec:jar:1.3
[DEBUG] Included: org.jboss.logging:jboss-logging:jar:3.1.2.GA
[DEBUG] Included: org.wildfly:wildfly-cli:jar:8.1.0.Final
[DEBUG] Included: org.jboss.aesh:aesh:jar:0.33.11
[DEBUG] Included: org.fusesource.jansi:jansi:jar:1.9
[DEBUG] Included: org.jboss:staxmapper:jar:1.1.0.Final
[DEBUG] Included: org.wildfly.security:wildfly-security-manager:jar:1.0.0.Final
[DEBUG] Included: org.jboss.sasl:jboss-sasl:jar:1.0.4.Final
[DEBUG] Included: org.jboss.remoting:jboss-remoting:jar:4.0.3.Final
[DEBUG] Included: org.jboss.remotingjmx:remoting-jmx:jar:2.0.0.Final
[DEBUG] Included: org.jboss.marshalling:jboss-marshalling:jar:1.4.2.Final
[DEBUG] Included: org.jboss.marshalling:jboss-marshalling-river:jar:1.4.2.Final
[DEBUG] Included: org.jboss:jboss-vfs:jar:3.2.5.Final
[DEBUG] Included: sun.jdk:jconsole:jar:jdk
[DEBUG] Included: org.wildfly:wildfly-build-config:jar:8.1.0.Final
[DEBUG] Included: org.wildfly:wildfly-controller-client:jar:8.1.0.Final
[DEBUG] Included: org.jboss:jboss-dmr:jar:1.2.0.Final
[DEBUG] Included: org.jboss.threads:jboss-threads:jar:2.1.1.Final
[DEBUG] Included: org.wildfly:wildfly-protocol:jar:8.1.0.Final
[DEBUG] Included: org.jboss.xnio:xnio-api:jar:3.2.2.Final
[DEBUG] Included: org.jboss.xnio:xnio-nio:jar:3.2.2.Final
[DEBUG] Excluded: org.apache.maven:maven-core:jar:3.0.5
[DEBUG] Excluded: org.apache.maven:maven-model:jar:3.0.5
[DEBUG] Excluded: org.apache.maven:maven-settings:jar:3.0.5
[DEBUG] Excluded: org.apache.maven:maven-settings-builder:jar:3.0.5
[DEBUG] Excluded: org.apache.maven:maven-repository-metadata:jar:3.0.5
[DEBUG] Excluded: org.apache.maven:maven-artifact:jar:3.0.5
[DEBUG] Excluded: org.apache.maven:maven-model-builder:jar:3.0.5
[DEBUG] Excluded: org.apache.maven:maven-aether-provider:jar:3.0.5
[DEBUG] Excluded: org.sonatype.aether:aether-spi:jar:1.13.1
[DEBUG] Excluded: org.sonatype.aether:aether-impl:jar:1.13.1
[DEBUG] Excluded: org.sonatype.aether:aether-api:jar:1.13.1
[DEBUG] Excluded: org.sonatype.sisu:sisu-inject-plexus:jar:2.3.0
[DEBUG] Excluded: org.codehaus.plexus:plexus-classworlds:jar:2.4
[DEBUG] Excluded: org.apache.maven:maven-plugin-api:jar:3.0.5
[DEBUG] Configuring mojo org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:deploy from plugin realm ClassRealm[plugin>org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final, parent: sun.misc.Launcher$AppClassLoader#21a722ef]
[DEBUG] Configuring mojo 'org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:deploy' with basic configurator -->
[DEBUG] (f) checkPackaging = true
[DEBUG] (f) force = true
[DEBUG] (f) hostname = localhost
[DEBUG] (f) port = 9990
[DEBUG] (f) project = MavenProject: org.jboss.errai.demo:errai-tutorial:1.0.0-SNAPSHOT # /Users/steve/Documents/eclipse_workspace/errai-tutorial-master/pom.xml
[DEBUG] (f) settings = org.apache.maven.execution.SettingsAdapter#253217dd
[DEBUG] (f) skip = false
[DEBUG] (f) targetDir = /Users/steve/Documents/eclipse_workspace/errai-tutorial-master/target
[DEBUG] -- end configuration --
[DEBUG] No <id> element was found in the POM - Getting credentials from CLI entry
Feb 21, 2015 5:20:36 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.2.2.Final
Feb 21, 2015 5:20:37 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.2.2.Final
Feb 21, 2015 5:20:37 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 4.0.3.Final
[DEBUG] Executing deployment
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:40 min
[INFO] Finished at: 2015-02-21T17:20:37-05:00
[INFO] Final Memory: 50M/710M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) on project errai-tutorial: Deployment failed and was rolled back. "java.io.IOException: No such file or directory" -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) on project errai-tutorial: Deployment failed and was rolled back.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
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:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.wildfly.plugin.common.DeploymentExecutionException: Deployment failed and was rolled back.
at org.wildfly.plugin.deployment.standalone.StandaloneDeployment.execute(StandaloneDeployment.java:180)
at org.wildfly.plugin.deployment.AbstractDeployment.executeDeployment(AbstractDeployment.java:121)
at org.wildfly.plugin.deployment.AbstractDeployment.doExecute(AbstractDeployment.java:146)
at org.wildfly.plugin.deployment.AbstractAppDeployment.doExecute(AbstractAppDeployment.java:70)
at org.wildfly.plugin.deployment.AbstractDeployment.execute(AbstractDeployment.java:111)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.lang.Exception: "java.io.IOException: No such file or directory"
at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.getActionResult(ServerDeploymentPlanResultFuture.java:134)
at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.getResultFromNode(ServerDeploymentPlanResultFuture.java:123)
at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.get(ServerDeploymentPlanResultFuture.java:85)
at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.get(ServerDeploymentPlanResultFuture.java:42)
at org.wildfly.plugin.deployment.standalone.StandaloneDeployment.execute(StandaloneDeployment.java:169)
... 25 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
The only other error I see during compilation is the following (but this does not seem to impact SuperDev mode, so it is probably just a warning):
[INFO] ERROR [Ejb3Configuration] HHH000050: Container is providing a null PersistenceUnitRootUrl: discovery impossible
[INFO] WARN [ConnectionProviderInitiator] HHH000181: No appropriate connection provider encountered, assuming application will be supplying connections
Any ideas on why the deployment is failing?
Thanks,
Steve

Weird spurious errors during compilation of Play / Activator program?

I have a large and moderately complex web application, using the standard Typesafe Stack of Play, Scala and Akka. (I'm in the process of adding scala.js, but this problem predates that.)
A couple of months ago, I upgraded to the current Activator-based version of the world (having fallen behind the times), and that's mostly worked fine. But ever since then, I am semi-frequently getting a weird error when I try to compile:
[Querki] $ compile
[trace] Stack trace suppressed: run last scalajvm/compile:compile for the full output.
[error] (scalajvm/compile:compile) java.io.FileNotFoundException: C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\target\scala-2.11\classes.bak\sbt2595416303704565240.class (Access is denied)
[error] Total time: 3 s, completed Sep 2, 2014 3:26:43 PM
Once it starts, it usually keeps recurring until I do a clean recompilation, so it's kind of a pain in the tuchus -- full recompilation of the system takes a while, and this is typically happening a couple of times a day. (OTOH, sometimes it simply stops happening, apparently for no reason.) Restarting Activator does not appear to help.
Anyone have any idea what's going on here? As far as I can tell, the classes.bak folder gets created temporarily during the compile process -- I can see it appear and then disappear again once the compile is finished, regardless of whether it succeeds. It definitely does not exist before the failed compiles start. It appears as if sbt is creating a temp folder in a broken state, or something like that.
If it's relevant, this is running on a Windows 7 box; I am using sbt 0.13.5, scala 2.11.1 and Activator 1.2.10.
ETA: Also conceivably relevant, now that I think of it -- I'm also running GitHub for Windows. I mention this because it's a Java-based app that is clearly doing something to check for changes to the tree periodically. (It auto-refreshes now and then; whether it is scanning the tree for changes or listening a la JNotify, I don't know.)
ETA2: Hah -- finally remembered to print the full log before cleaning. Here's the full stack traceback: I don't know what to make of it, but possibly someone on the sbt side of things can use it:
[Querki] $ compile
[info] Compiling 1 Scala source to C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajs\target\scala-2.11\classes...
[info] Fast optimizing C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\target\scala-2.11\classes\public\javascripts\querki-client-fastopt.js
[trace] Stack trace suppressed: run last scalajvm/compile:compile for the full output.
[error] (scalajvm/compile:compile) java.io.FileNotFoundException: C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\target\scala-2.11\classes.bak\sbt1117112335838311075.class (Access is denied)
[error] Total time: 22 s, completed Sep 5, 2014 3:17:25 PM
[Querki] $ last scalajvm/compile:compile
scalajs/compile:compile
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set(C:\Users\jducoeur\Documents\GitHub\Querki\querki\scala\src\main\scala\qtexttest\LineParsers.scala)
[debug] Removed products: Set()
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set(C:\Users\jducoeur\Documents\GitHub\Querki\querki\scala\src\main\scala\qtexttest\LineParsers.scala)
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] All initially invalidated sources: Set(C:\Users\jducoeur\Documents\GitHub\Querki\querki\scala\src\main\scala\qtexttest\LineParsers.scala)
[info] Compiling 1 Scala source to C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajs\target\scala-2.11\classes...
[debug] Getting compiler-interface from component compiler for Scala 2.11.1
[debug] Getting compiler-interface from component compiler for Scala 2.11.1
[debug] Running cached compiler 1f1ebd37, interfacing (CompilerInterface) with Scala compiler version 2.11.1
[debug] Calling Scala compiler with arguments (CompilerInterface):
[debug] -Xplugin:C:\Users\jducoeur\.ivy2\cache\org.scala-lang.modules.scalajs\scalajs-compiler_2.11.1\jars\scalajs-compiler_2.11.1-0.5.4.jar
[debug] -bootclasspath
[debug] C:\Program Files\Java\jdk1.6.0_38\jre\lib\resources.jar;C:\Program Files\Java\jdk1.6.0_38\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_38\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.6.0_38\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_38\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0_38\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.6.0_38\jre\lib\modules\jdk.boot.jar;C:\Program Files\Java\jdk1.6.0_38\jre\classes;C:\Users\jducoeur\.ivy2\cache\org.scala-lang\scala-library\jars\scala-library-2.11.1.jar
[debug] -classpath
[debug] C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajs\target\scala-2.11\classes;C:\Users\jducoeur\.ivy2\cache\org.scala-lang.modules.scalajs\scalajs-library_2.11\jars\scalajs-library_2.11-0.5.4.jar;C:\Users\jducoeur\.ivy2\cache\org.scala-lang.modules.scalajs\scalajs-dom_sjs0.5_2.11\jars\scalajs-dom_sjs0.5_2.11-0.6.jar;C:\Users\jducoeur\.ivy2\cache\org.scala-lang.modules.scalajs\scalajs-jquery_sjs0.5_2.11\jars\scalajs-jquery_sjs0.5_2.11-0.6.jar;C:\Users\jducoeur\.ivy2\cache\org.webjars\jquery\jars\jquery-1.10.2.jar
[debug] Scala compilation took 6.133828284 s
[debug] New invalidations:
[debug] Set()
[debug] Initial set of included nodes: Set()
[debug] Previously invalidated, but (transitively) depend on new invalidations:
[debug] Set()
[debug] All newly invalidated sources after taking into account (previously) recompiled sources:Set()
scalajvm/compile:compile
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set(C:\Users\jducoeur\Documents\GitHub\Querki\querki\scala\src\main\scala\qtexttest\LineParsers.scala, C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\app\qtext\LineParsers.scala)
[debug] Removed products: Set()
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set(C:\Users\jducoeur\Documents\GitHub\Querki\querki\scala\src\main\scala\qtexttest\LineParsers.scala, C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\app\qtext\LineParsers.scala)
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] All initially invalidated sources: Set(C:\Users\jducoeur\Documents\GitHub\Querki\querki\scala\src\main\scala\qtexttest\LineParsers.scala, C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\app\qtext\LineParsers.scala)
java.io.FileNotFoundException: C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\target\scala-2.11\classes.bak\sbt1117112335838311075.class (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
at sbt.Using$$anonfun$fileOutputChannel$1.apply(Using.scala:82)
at sbt.Using$$anonfun$fileOutputChannel$1.apply(Using.scala:82)
at sbt.Using$$anon$2.openImpl(Using.scala:72)
at sbt.OpenFile$class.open(Using.scala:46)
at sbt.Using$$anon$2.open(Using.scala:70)
at sbt.Using$$anon$2.open(Using.scala:70)
at sbt.Using.apply(Using.scala:24)
at sbt.IO$$anonfun$copyFile$3.apply(IO.scala:583)
at sbt.IO$$anonfun$copyFile$3.apply(IO.scala:582)
at sbt.Using.apply(Using.scala:25)
at sbt.IO$.copyFile(IO.scala:582)
at sbt.IO$.move(IO.scala:764)
at sbt.inc.ClassfileManager$$anonfun$transactional$1$$anon$2.sbt$inc$ClassfileManager$$anonfun$$anon$$move(ClassfileManager.scala:77)
at sbt.inc.ClassfileManager$$anonfun$transactional$1$$anon$2$$anonfun$delete$3.apply(ClassfileManager.scala:53)
at sbt.inc.ClassfileManager$$anonfun$transactional$1$$anon$2$$anonfun$delete$3.apply(ClassfileManager.scala:52)
at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:153)
at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:306)
at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:306)
at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:306)
at sbt.inc.ClassfileManager$$anonfun$transactional$1$$anon$2.delete(ClassfileManager.scala:52)
at sbt.inc.Incremental$.prune(Incremental.scala:58)
at sbt.inc.IncrementalCommon.cycle(Incremental.scala:96)
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:38)
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:37)
at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:65)
at sbt.inc.Incremental$.compile(Incremental.scala:37)
at sbt.inc.IncrementalCompile$.apply(Compile.scala:27)
at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:157)
at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:71)
at sbt.compiler.AggressiveCompile.apply(AggressiveCompile.scala:46)
at sbt.Compiler$.apply(Compiler.scala:75)
at sbt.Compiler$.apply(Compiler.scala:66)
at sbt.Defaults$.sbt$Defaults$$compileTaskImpl(Defaults.scala:770)
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:762)
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:762)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
at sbt.std.Transform$$anon$4.work(System.scala:64)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:244)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
[error] (scalajvm/compile:compile) java.io.FileNotFoundException: C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\target\scala-2.11\classes.bak\sbt1117112335838311075.class (Access is denied)
[Querki] $

java.lang.NoClassDefFoundError: org/apache/maven/repository/internal/MavenRepositorySystemUtils

I am working on a maven plugin project which invokes a jar file calling a function from MavenRepositorySystemUtils in maven-aether-provider.jar. However, I kept receiving exception as below,
Caused by: java.lang.NoClassDefFoundError: org/apache/maven/repository/internal/MavenRepositorySystemUtils
at com.dbx.upload.Utils.NexusUtils.ManualRepositorySystemFactory.newRepositorySystem(ManualRepositorySystemFactory.java:27)
at com.dbx.upload.Utils.NexusUtils.Booter.newRepositorySystem(Booter.java:39)
at com.dbx.upload.Downloader.NexusDownloader.download(NexusDownloader.java:69)
at com.dbx.upload.UploadTool.<init>(UploadTool.java:60)
at com.dbx.upload.plugin.UploadMojo.execute(UploadMojo.java:221)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20 more
Caused by: java.lang.ClassNotFoundException: org.apache.maven.repository.internal.MavenRepositorySystemUtils
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
... 26 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
I have deleted my local repo and re-run the maven plugin without success.
I verified that maven-aether-provider.jar:3.1.0 is under local repo.
One thing weird is that the pluin realm seems to exclude some usefule classes as shown here,
> [DEBUG] Created new class realm plugin>com.dbx.upload.plugin:veracode-maven-plugin:1.0.2-SNAPSHOT
[DEBUG] Importing foreign packages into class realm plugin>com.dbx.upload.plugin:veracode-maven-plugin:1.0.2-SNAPSHOT
[DEBUG] Imported: < maven.api
[DEBUG] Populating class realm plugin>com.dbx.upload.plugin:veracode-maven-plugin:1.0.2-SNAPSHOT
[DEBUG] Included: com.dbx.upload.plugin:veracode-maven-plugin:jar:1.0.2-SNAPSHOT
[DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:3.0.10
[DEBUG] Included: org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.0.0.M2a
[DEBUG] Included: javax.enterprise:cdi-api:jar:1.0
[DEBUG] Included: javax.annotation:jsr250-api:jar:1.0
[DEBUG] Included: javax.inject:javax.inject:jar:1
[DEBUG] Included: org.sonatype.sisu:sisu-guice:jar:no_aop:3.1.0
[DEBUG] Included: aopalliance:aopalliance:jar:1.0
[DEBUG] Included: org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.0.0.M2a
[DEBUG] Included: asm:asm:jar:3.3.1
[DEBUG] Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
[DEBUG] Included: org.codehaus.plexus:plexus-interpolation:jar:1.16
[DEBUG] Included: org.eclipse.aether:aether-api:jar:0.9.0.M4
[DEBUG] Included: org.eclipse.aether:aether-spi:jar:0.9.0.M4
[DEBUG] Included: org.eclipse.aether:aether-util:jar:0.9.0.M4
[DEBUG] Included: org.eclipse.aether:aether-impl:jar:0.9.0.M4
[DEBUG] Included: org.eclipse.aether:aether-connector-basic:jar:0.9.0.M4
[DEBUG] Included: org.eclipse.aether:aether-transport-file:jar:0.9.0.M4
[DEBUG] Included: org.eclipse.aether:aether-transport-http:jar:0.9.0.M4
[DEBUG] Included: org.slf4j:jcl-over-slf4j:jar:1.6.2
[DEBUG] Included: org.slf4j:slf4j-api:jar:1.6.2
[DEBUG] Excluded: org.apache.maven:maven-plugin-api:jar:3.1.0
[DEBUG] Excluded: org.apache.maven:maven-model:jar:3.1.0
[DEBUG] Excluded: org.apache.maven:maven-artifact:jar:3.1.0
[DEBUG] Excluded: org.codehaus.plexus:plexus-classworlds:jar:2.4
[DEBUG] Excluded: org.apache.maven:maven-aether-provider:jar:3.1.0
[DEBUG] Excluded: org.apache.maven:maven-model-builder:jar:3.1.0
[DEBUG] Excluded: org.apache.maven:maven-repository-metadata:jar:3.1.0
Any clue for the exception? Much Appreciate for your help.

Maven build failure: Read time out

I have tried all the possible solutions found here, including:
find ~/.m2 -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec rm {} \;
mvn -U clean
It does not work anyway, the specific log is as below:
btw: I was trying to run a struts2 sample code from mkyong site
[DEBUG] =======================================================================
[DEBUG] com.mkyong.common:Struts2Example:war:com.mkyong.common
[DEBUG] junit:junit:jar:3.8.1:test
[DEBUG] org.apache.struts:struts2-core:jar:2.1.8:compile
[DEBUG] com.opensymphony:xwork-core:jar:2.1.6:compile
[DEBUG] org.springframework:spring-test:jar:2.5.6:compile
[DEBUG] commons-logging:commons-logging:jar:1.1.1:compile
[DEBUG] org.freemarker:freemarker:jar:2.3.15:compile
[DEBUG] ognl:ognl:jar:2.7.3:compile
[DEBUG] commons-fileupload:commons-fileupload:jar:1.2.1:compile
[DEBUG] commons-io:commons-io:jar:1.3.2:compile
[DEBUG] com.sun:tools:jar:1.5.0:system
[DEBUG] org.apache.struts:struts2-convention-plugin:jar:2.1.8:compile
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://repo
.maven.apache.org/maven2
Downloading: http://repo.maven.apache.org/maven2/org/apache/struts/struts2-core/
2.1.8/struts2-core-2.1.8.jar
[DEBUG] Writing resolution tracking file D:\ProgramData\apache-maven-repo\.m2\re
pository\org\apache\struts\struts2-core\2.1.8\struts2-core-2.1.8.jar.lastUpdated
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 52:31.162s
[INFO] Finished at: Fri Jan 18 20:16:49 CST 2013
[INFO] Final Memory: 2M/5M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Struts2Example: Could not resolve depe
ndencies for project com.mkyong.common:Struts2Example:war:com.mkyong.common: Cou
ld not transfer artifact org.apache.struts:struts2-core:jar:2.1.8 from/to centra
l (http://repo.maven.apache.org/maven2): GET request of: org/apache/struts/strut
s2-core/2.1.8/struts2-core-2.1.8.jar from central failed: Read timed out -> [Hel
p 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
n project Struts2Example: Could not resolve dependencies for project com.mkyong.
common:Struts2Example:war:com.mkyong.common: Could not transfer artifact org.apa
che.struts:struts2-core:jar:2.1.8 from/to central (http://repo.maven.apache.org/
maven2): GET request of: org/apache/struts/struts2-core/2.1.8/struts2-core-2.1.8
.jar from central failed
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.java:210)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resol
veProjectDependencies(LifecycleDependencyResolver.java:117)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAr
eResolved(MojoExecutor.java:258)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:201)
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.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not res
olve dependencies for project com.mkyong.common:Struts2Example:war:com.mkyong.co
mmon: Could not transfer artifact org.apache.struts:struts2-core:jar:2.1.8 from/
to central (http://repo.maven.apache.org/maven2): GET request of: org/apache/str
uts/struts2-core/2.1.8/struts2-core-2.1.8.jar from central failed
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(D
efaultProjectDependenciesResolver.java:189)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.java:185)
... 22 more
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: Could n
ot transfer artifact org.apache.struts:struts2-core:jar:2.1.8 from/to central (h
ttp://repo.maven.apache.org/maven2): GET request of: org/apache/struts/struts2-c
ore/2.1.8/struts2-core-2.1.8.jar from central failed
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDepe
ndencies(DefaultRepositorySystem.java:375)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(D
efaultProjectDependenciesResolver.java:183)
... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not
transfer artifact org.apache.struts:struts2-core:jar:2.1.8 from/to central (htt
p://repo.maven.apache.org/maven2): GET request of: org/apache/struts/struts2-cor
e/2.1.8/struts2-core-2.1.8.jar from central failed
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def
aultArtifactResolver.java:538)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti
facts(DefaultArtifactResolver.java:216)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDepe
ndencies(DefaultRepositorySystem.java:358)
... 24 more
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not tra
nsfer artifact org.apache.struts:struts2-core:jar:2.1.8 from/to central (http://
repo.maven.apache.org/maven2): GET request of: org/apache/struts/struts2-core/2.
1.8/struts2-core-2.1.8.jar from central failed
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(W
agonRepositoryConnector.java:951)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(W
agonRepositoryConnector.java:941)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.
run(WagonRepositoryConnector.java:669)
at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(Run
nableErrorForwarder.java:60)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.maven.wagon.TransferFailedException: GET request of: org/a
pache/struts/struts2-core/2.1.8/struts2-core-2.1.8.jar from central failed
at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:3
49)
at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:3
10)
at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:2
87)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:97)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.
run(WagonRepositoryConnector.java:601)
... 4 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.apache.maven.wagon.providers.http.httpclient.impl.io.AbstractSess
ionInputBuffer.read(AbstractSessionInputBuffer.java:187)
at org.apache.maven.wagon.providers.http.httpclient.impl.io.ContentLengt
hInputStream.read(ContentLengthInputStream.java:176)
at org.apache.maven.wagon.providers.http.httpclient.conn.EofSensorInputS
tream.read(EofSensorInputStream.java:138)
at org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:493)
at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:3
39)
... 9 more
Read timed out means you have a network problem. Either repo.maven.apache.org is down (very unlikely) or you have connectivity issues on your end.
Read Timeout errors can also happen with big dependency resolution on slow networks (that you may not be able to fix by yourself). You may also want to consider this other thread, here you will find how to increase the Maven Wagon timeout which will help you in such cases.
Also check the official documentation for more details.
But using wget I am able to download instance. It is almost halt here..waited more than 15 mins..
INFO]
[INFO] --- maven-checkstyle-plugin:2.13:check (validate-checkstyle) # onos ---
[DEBUG] Using connector WagonRepositoryConnector with priority 0.0 for http://repo.maven.apache.org/maven2
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-module-xhtml/1.2/doxia-module-xhtml-1.2.pom
2/2 KB
Regards,
Bala