CoberturaInstrumenter - Unable to instrument file? - java

My project is using Java 1.8 and maven 3.2.1
I am using Corbetura plugin as
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.6</version>
<configuration>
<format>xml</format>
<maxmem>256m</maxmem>
<aggregate>true</aggregate>
<outputDirectory>shippable/codecoverage</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit4</artifactId>
<version>2.17</version>
</dependency>
</dependencies>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<reportsDirectory>shippable/testresults</reportsDirectory>
</configuration>
</plugin>
and then I do
mvn clean cobertura:cobertura
and I see following
[WARNING]
[WARNING] Some problems were encountered while building the effective settings
[WARNING] 'usePluginRegistry' is deprecated and has no effect. # /Users/harith/.m2/settings.xml
[WARNING]
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Oauth: Assembling Modules
[INFO] OAuth: Persistence
[INFO] OAuth: Business
[INFO] OAuth: REST
[INFO] OAuth: Integration Tests
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Oauth: Assembling Modules 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # oauth ---
[INFO] Deleting /Users/harith/code/IdeaProjects/others/oauth/target
[INFO]
[INFO] >>> cobertura-maven-plugin:2.6:cobertura (default-cli) # oauth >>>
[INFO]
[INFO] --- cobertura-maven-plugin:2.6:instrument (default-cli) # oauth ---
[INFO] Skipping cobertura mojo for project with packaging type 'pom'
[INFO]
[INFO] <<< cobertura-maven-plugin:2.6:cobertura (default-cli) # oauth <<<
[INFO]
[INFO] --- cobertura-maven-plugin:2.6:cobertura (default-cli) # oauth ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building OAuth: Persistence 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # persistence ---
[INFO] Deleting /Users/harith/code/IdeaProjects/others/oauth/persistence/target
[INFO]
[INFO] >>> cobertura-maven-plugin:2.6:cobertura (default-cli) # persistence >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # persistence ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to /Users/harith/code/IdeaProjects/others/oauth/persistence/target/classes
[INFO]
[INFO] --- cobertura-maven-plugin:2.6:instrument (default-cli) # persistence ---
[INFO] Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[cobertura] WARN [main] net.sourceforge.cobertura.instrument.CoberturaInstrumenter - Unable to instrument file /Users/harith/code/IdeaProjects/others/oauth/persistence/target/generated-classes/cobertura/com/self/oauth/persistence/entities/services/OauthEntityManager.class
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:147)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
[cobertura] WARN [main] net.sourceforge.cobertura.instrument.CoberturaInstrumenter - Unable to instrument file /Users/harith/code/IdeaProjects/others/oauth/persistence/target/generated-classes/cobertura/com/self/oauth/persistence/entities/services/OauthEntityManagerProducer.class
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:147)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
[cobertura] WARN [main] net.sourceforge.cobertura.instrument.CoberturaInstrumenter - Unable to instrument file /Users/harith/code/IdeaProjects/others/oauth/persistence/target/generated-classes/cobertura/com/self/oauth/persistence/entities/User.class
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:147)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
[cobertura] WARN [main] net.sourceforge.cobertura.instrument.CoberturaInstrumenter - Unable to instrument file /Users/harith/code/IdeaProjects/others/oauth/persistence/target/generated-classes/cobertura/com/self/oauth/persistence/entities/UserService.class
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:147)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
[ERROR] Aug 13, 2014 11:21:26 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler saveCoverageData
INFO: Cobertura: Saved information on 0 classes.
[INFO] Instrumentation was successful.
[INFO] NOT adding cobertura ser file to attached artifacts list.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # persistence ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # persistence ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/harith/code/IdeaProjects/others/oauth/persistence/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) # persistence ---
[INFO] Surefire report directory: /Users/harith/code/IdeaProjects/others/oauth/persistence/shippable/testresults
[INFO] Using configured provider org.apache.maven.surefire.junit4.JUnit4Provider
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.self.oauth.persistence.entities.UserServiceTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.404 sec - in com.self.oauth.persistence.entities.UserServiceTest
Results :
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] <<< cobertura-maven-plugin:2.6:cobertura (default-cli) # persistence <<<
[INFO]
[INFO] --- cobertura-maven-plugin:2.6:cobertura (default-cli) # persistence ---
[INFO] Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Report time: 40ms
[ERROR] Aug 13, 2014 11:21:28 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler loadCoverageData
INFO: Cobertura: Loaded information on 0 classes.
[INFO] Cobertura Report generation was successful.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building OAuth: Business 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # business ---
[INFO] Deleting /Users/harith/code/IdeaProjects/others/oauth/business/target
[INFO]
[INFO] >>> cobertura-maven-plugin:2.6:cobertura (default-cli) # business >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # business ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/harith/code/IdeaProjects/others/oauth/business/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # business ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to /Users/harith/code/IdeaProjects/others/oauth/business/target/classes
[INFO]
[INFO] --- cobertura-maven-plugin:2.6:instrument (default-cli) # business ---
[INFO] Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[cobertura] WARN [main] net.sourceforge.cobertura.instrument.CoberturaInstrumenter - Unable to instrument file /Users/harith/code/IdeaProjects/others/oauth/business/target/generated-classes/cobertura/com/self/oauth/business/oauth/ClientRegistrationManager.class
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:147)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
[cobertura] WARN [main] net.sourceforge.cobertura.instrument.CoberturaInstrumenter - Unable to instrument file /Users/harith/code/IdeaProjects/others/oauth/business/target/generated-classes/cobertura/com/self/oauth/business/oauth/TokenManager.class
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:147)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
[cobertura] WARN [main] net.sourceforge.cobertura.instrument.CoberturaInstrumenter - Unable to instrument file /Users/harith/code/IdeaProjects/others/oauth/business/target/generated-classes/cobertura/com/self/oauth/business/oauth/UniqueIdGenerator.class
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:147)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
[cobertura] WARN [main] net.sourceforge.cobertura.instrument.CoberturaInstrumenter - Unable to instrument file /Users/harith/code/IdeaProjects/others/oauth/business/target/generated-classes/cobertura/com/self/oauth/business/outbound/ClientDetail.class
java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:147)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
[ERROR] Aug 13, 2014 11:21:29 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler saveCoverageData
INFO: Cobertura: Saved information on 0 classes.
[INFO] Instrumentation was successful.
[INFO] NOT adding cobertura ser file to attached artifacts list.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # business ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # business ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /Users/harith/code/IdeaProjects/others/oauth/business/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) # business ---
[INFO] Surefire report directory: /Users/harith/code/IdeaProjects/others/oauth/business/shippable/testresults
[INFO] Using configured provider org.apache.maven.surefire.junit4.JUnit4Provider
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.self.oauth.business.oauth.ClientRegistrationManagerTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.608 sec - in com.self.oauth.business.oauth.ClientRegistrationManagerTest
Running com.self.oauth.business.oauth.TokenManagerTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.15 sec - in com.self.oauth.business.oauth.TokenManagerTest
Running com.self.oauth.business.oauth.UniqueIdGeneratorTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec - in com.self.oauth.business.oauth.UniqueIdGeneratorTest
Results :
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building OAuth: Integration Tests 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # integration ---
[INFO] Deleting /Users/harith/code/IdeaProjects/others/oauth/integration/target
[INFO]
[INFO] >>> cobertura-maven-plugin:2.6:cobertura (default-cli) # integration >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # integration ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # integration ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- sql-maven-plugin:1.5:execute (default) # integration ---
[INFO] Executing commands
[INFO] 1 of 1 SQL statements executed successfully
[INFO]
[INFO] --- cobertura-maven-plugin:2.6:instrument (default-cli) # integration ---
[WARNING] No files to instrument.
[INFO] NOT adding cobertura ser file to attached artifacts list.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # integration ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/harith/code/IdeaProjects/others/oauth/integration/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # integration ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to /Users/harith/code/IdeaProjects/others/oauth/integration/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.17:test (default-test) # integration ---
[INFO] Surefire report directory: /Users/harith/code/IdeaProjects/others/oauth/integration/shippable/testresults
[INFO] Using configured provider org.apache.maven.surefire.junit4.JUnit4Provider
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] <<< cobertura-maven-plugin:2.6:cobertura (default-cli) # integration <<<
[INFO]
[INFO] --- cobertura-maven-plugin:2.6:cobertura (default-cli) # integration ---
[INFO] Executing aggregate cobertura:report for Oauth: Assembling Modules
Aug 13, 2014 11:21:33 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler loadCoverageData
INFO: Cobertura: Loaded information on 0 classes.
Aug 13, 2014 11:21:33 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler loadCoverageData
INFO: Cobertura: Loaded information on 0 classes.
Aug 13, 2014 11:21:33 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler loadCoverageData
INFO: Cobertura: Loaded information on 0 classes.
[INFO] Saving aggregate cobertura information in /Users/harith/code/IdeaProjects/others/oauth/target/cobertura/cobertura.ser
Aug 13, 2014 11:21:33 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler saveCoverageData
INFO: Cobertura: Saved information on 0 classes.
[INFO] Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Report time: 42ms
[ERROR] Aug 13, 2014 11:21:33 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler loadCoverageData
INFO: Cobertura: Loaded information on 0 classes.
[INFO] Cobertura Report generation was successful.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Oauth: Assembling Modules ......................... SUCCESS [ 0.597 s]
[INFO] OAuth: Persistence ................................ SUCCESS [ 3.532 s]
[INFO] OAuth: Business ................................... SUCCESS [ 2.784 s]
[INFO] OAuth: REST ....................................... SUCCESS [ 0.694 s]
[INFO] OAuth: Integration Tests .......................... SUCCESS [ 0.976 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.784 s
[INFO] Finished at: 2014-08-13T11:21:33-08:00
[INFO] Final Memory: 28M/101M
[INFO] --------------------------------------------------------
at the end it says
Cobertura: Loaded information on 0 classes.
Whats wrong here?

Update 05/10/2015: As of now version 2.7 (apparently) supports this - thanks #tomasz_kusmierczyk
Looks like this is because Cobertura 2.0.3 depends on ASM 4.1, which doesn't support Java 8. I managed to "fix" this by forcing cobertura-maven-plugin to use ASM 5.0.3, but I'm not completely sure that this is the correct way of doing things. It did however get rid of all of those warnings.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.6</version>
...
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>5.0.3</version>
</dependency>
</dependencies>
</plugin>
The right way to go is probably to use a different code coverage tool, like JaCoCo which is meant to have support for Java 8.
Update: Looks like you lose some code coverage info if you go down this route, and so another CC tool is indeed the way to go.

From https://github.com/cobertura/cobertura/wiki/FAQ#classnotfoundexception-during-instrumentation:
"This is because during instrumentation in cobertura 2.0, we use ASM to rebuild the .class files. We rebuild the stackmap which is a requirement to be compatible with java 7 and anything after. This does not mean that we recompile the code, however ASM requires that we provide the binaries of the other classes just in case it needs to look up any super methods. To fix this we use an argument called auxClasspath."
Adding the following code to your ant file (build.xml) should resolve the issue.
<path id="cobertura.auxpath">
<pathelement location="${bin}"/>
</path>
<target name="instrument_coverage" depends="init_coverage"
description="Instruments source code for coverage measurement">
<cobertura-instrument datafile="${coverage.datafile}">
<fileset refid="coverage-files"/>
<auxClasspath>
<path refid="cobertura.auxpath" />
</auxClasspath>
</cobertura-instrument>
</target>
This worked for me.

Related

Maven must compile before install (package) in mutil module maven project

I have a Spring boot maven project (mutil-module) like this:
-parent
|
|-child1
| |-src
| |-pom.xml
|
|-child2
| |-src
| |-pom.xml
|
|-pom.xml
Problem:
I always must be run mvn compile before can run mvn package or mvn install.
If I run mvn clean install then build will failed
I guess: Something happen when install(package) ignore compile in lifecycle.
-- Trace error if package without compile first
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /F:/Workspace/Chinese-Chess-World/Public-Repo/Chinese-Chess-World/Chinese-Chess-World/ccw-game-service-contract/src/main/java/com/doubleat/ccw/usermanagement/CcwGameServiceContractApplication.java:[3,40] package com.doubleat
.ccw.common.constant does not exist
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for ccw-platform 1.0:
[INFO]
[INFO] ccw-platform ....................................... SUCCESS [ 0.479 s]
[INFO] ccw-common ......................................... SUCCESS [ 2.070 s]
[INFO] ccw-config-service ................................. SUCCESS [ 0.585 s]
[INFO] ccw-game-service-contract .......................... FAILURE [ 0.666 s]
[INFO] ccw-game-service ................................... SKIPPED
[INFO] ccw-user-management-service-contract ............... SKIPPED
[INFO] ccw-user-management-service ........................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.110 s
[INFO] Finished at: 2021-02-27T19:21:18+07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ccw-game-service-contract: Compilation failure
[ERROR] /F:/Workspace/Chinese-Chess-World/Public-Repo/Chinese-Chess-World/Chinese-Chess-World/ccw-game-service-contract/src/main/java/com/doubleat/ccw/usermanagement/CcwGameServiceContractApplication.java:[3,40] package com.doubleat
.ccw.common.constant does not exist
[ERROR]
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ccw-game-service-contract: Compilation failure
/F:/Workspace/Chinese-Chess-World/Public-Repo/Chinese-Chess-World/Chinese-Chess-World/ccw-game-service-contract/src/main/java/com/doubleat/ccw/usermanagement/CcwGameServiceContractApplication.java:[3,40] package com.doubleat.ccw.com
mon.constant does not exist
-- Full details
F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World>mvn install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-common:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-common:${ccw-common.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-common\pom.xml, line
14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-config-service:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-config-service:${ccw-config-service.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-confi
g-service\pom.xml, line 14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-game-service-contract:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-game-service-contract:${ccw-game-service-contract.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-W
orld\ccw-game-service-contract\pom.xml, line 14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-user-management-service:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-user-management-service:${ccw-user-management-service.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Che
ss-World\ccw-user-management-service\pom.xml, line 14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-user-management-service-contract:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-user-management-service-contract:${ccw-user-management-service-contract.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess
-World\Chinese-Chess-World\ccw-user-management-service-contract\pom.xml, line 14, column 14
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] ccw-platform [pom]
[INFO] ccw-common [jar]
[INFO] ccw-config-service [jar]
[INFO] ccw-game-service-contract [jar]
[INFO] ccw-game-service [jar]
[INFO] ccw-user-management-service-contract [jar]
[INFO] ccw-user-management-service [jar]
[INFO]
[INFO] -------------------< com.doubleat.ccw:ccw-platform >--------------------
[INFO] Building ccw-platform 1.0 [1/7]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.3:repackage (repackage) # ccw-platform ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # ccw-platform ---
[INFO] Installing F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\pom.xml to C:\Users\Admin\.m2\repository\com\doubleat\ccw\ccw-platform\1.0\ccw-platform-1.0.pom
[INFO]
[INFO] --------------------< com.doubleat.ccw:ccw-common >---------------------
[INFO] Building ccw-common 1.0 [2/7]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # ccw-common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # ccw-common ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-common\target\classes
Terminate batch job (Y/N)? y
F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World>mvn -e install -Dmaven.test.skip=true
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-common:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-common:${ccw-common.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-common\pom.xml, line
14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-config-service:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-config-service:${ccw-config-service.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-confi
g-service\pom.xml, line 14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-game-service-contract:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-game-service-contract:${ccw-game-service-contract.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-W
orld\ccw-game-service-contract\pom.xml, line 14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-user-management-service:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-user-management-service:${ccw-user-management-service.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Che
ss-World\ccw-user-management-service\pom.xml, line 14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-user-management-service-contract:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-user-management-service-contract:${ccw-user-management-service-contract.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess
-World\Chinese-Chess-World\ccw-user-management-service-contract\pom.xml, line 14, column 14
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] ccw-platform [pom]
[INFO] ccw-common [jar]
[INFO] ccw-config-service [jar]
[INFO] ccw-game-service-contract [jar]
[INFO] ccw-game-service [jar]
[INFO] ccw-user-management-service-contract [jar]
[INFO] ccw-user-management-service [jar]
[INFO]
[INFO] -------------------< com.doubleat.ccw:ccw-platform >--------------------
[INFO] Building ccw-platform 1.0 [1/7]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.3:repackage (repackage) # ccw-platform ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # ccw-platform ---
[INFO] Installing F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\pom.xml to C:\Users\Admin\.m2\repository\com\doubleat\ccw\ccw-platform\1.0\ccw-platform-1.0.pom
[INFO]
[INFO] --------------------< com.doubleat.ccw:ccw-common >---------------------
[INFO] Building ccw-common 1.0 [2/7]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # ccw-common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # ccw-common ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-common\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # ccw-common ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # ccw-common ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # ccw-common ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) # ccw-common ---
[INFO] Building jar: F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-common\target\ccw-common-1.0.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.3:repackage (repackage) # ccw-common ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # ccw-common ---
[INFO] Installing F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-common\target\ccw-common-1.0.jar to C:\Users\Admin\.m2\repository\com\doubleat\ccw\ccw-common\1.0\ccw-common-1.0.jar
[INFO] Installing F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-common\pom.xml to C:\Users\Admin\.m2\repository\com\doubleat\ccw\ccw-common\1.0\ccw-common-1.0.pom
[INFO]
[INFO] ----------------< com.doubleat.ccw:ccw-config-service >-----------------
[INFO] Building ccw-config-service 1.0 [3/7]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # ccw-config-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 2 resources
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # ccw-config-service ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-config-service\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # ccw-config-service ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # ccw-config-service ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # ccw-config-service ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) # ccw-config-service ---
[INFO] Building jar: F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-config-service\target\ccw-config-service-1.0.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.3:repackage (repackage) # ccw-config-service ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # ccw-config-service ---
[INFO] Installing F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-config-service\target\ccw-config-service-1.0.jar to C:\Users\Admin\.m2\repository\com\doubleat\ccw\ccw-config-service\1.0\ccw
-config-service-1.0.jar
[INFO] Installing F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-config-service\pom.xml to C:\Users\Admin\.m2\repository\com\doubleat\ccw\ccw-config-service\1.0\ccw-config-service-1.0.pom
[INFO]
[INFO] -------------< com.doubleat.ccw:ccw-game-service-contract >-------------
[INFO] Building ccw-game-service-contract 1.0 [4/7]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # ccw-game-service-contract ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # ccw-game-service-contract ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-game-service-contract\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /F:/Workspace/Chinese-Chess-World/Public-Repo/Chinese-Chess-World/Chinese-Chess-World/ccw-game-service-contract/src/main/java/com/doubleat/ccw/usermanagement/CcwGameServiceContractApplication.java:[3,40] package com.doubleat
.ccw.common.constant does not exist
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for ccw-platform 1.0:
[INFO]
[INFO] ccw-platform ....................................... SUCCESS [ 0.479 s]
[INFO] ccw-common ......................................... SUCCESS [ 2.070 s]
[INFO] ccw-config-service ................................. SUCCESS [ 0.585 s]
[INFO] ccw-game-service-contract .......................... FAILURE [ 0.666 s]
[INFO] ccw-game-service ................................... SKIPPED
[INFO] ccw-user-management-service-contract ............... SKIPPED
[INFO] ccw-user-management-service ........................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.110 s
[INFO] Finished at: 2021-02-27T19:21:18+07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ccw-game-service-contract: Compilation failure
[ERROR] /F:/Workspace/Chinese-Chess-World/Public-Repo/Chinese-Chess-World/Chinese-Chess-World/ccw-game-service-contract/src/main/java/com/doubleat/ccw/usermanagement/CcwGameServiceContractApplication.java:[3,40] package com.doubleat
.ccw.common.constant does not exist
[ERROR]
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ccw-game-service-contract: Compilation failure
/F:/Workspace/Chinese-Chess-World/Public-Repo/Chinese-Chess-World/Chinese-Chess-World/ccw-game-service-contract/src/main/java/com/doubleat/ccw/usermanagement/CcwGameServiceContractApplication.java:[3,40] package com.doubleat.ccw.com
mon.constant does not exist
Problem Diagnostics
The spring-boot-maven-plugin executes for each of the modules in the project as evidenced by the following lines in Maven output:
[INFO] --- spring-boot-maven-plugin:2.4.3:repackage (repackage) # ccw-game-service-contract ---
[INFO] Replacing main artifact with repackaged archive
The JAR artifact of such modules is not a usual library after that, but an executable JAR packaged as described in the Spring Boot documentation
That executable JAR is not suitable for consumption by a Java compiler - or compiler for any other JVM-based language for that matter.
Solution
Only the Maven module which represents the final executable artifact of the project should include the invocation of the spring-boot-maven-plugin.
You may check the official guide from Spring Boot - Creating a Multi Module Project - for a step-by-step guide and explanation.

Testing a single package skips parametrized tests in TestNG

Overall description
I have a simple Maven project with a parameterized TestNG test. The parameter is specified through a suite XML file. When I run tests for the whole project, the suite XML file is read, parameter is used and the parameterized test is executed. However, when I attempt to test a single package only, then the suite XML file is not used apparently and the test is skipped with a complaint such as "Parameter '...' is required by #Test on method ... but has not been marked #Optional or defined". The question is how to run individual tests and test packages with parameters.
For more details see below.
Testing the whole project
This works as expected. Two test methods are executed. One test method is parameterless, other is parameterized and the parameter value is taken from the suite XML file. This is a equivalent of Run\Test project in NetBeans.
C:\Users\Andrew\Documents\NetBeansProjects\TestNGDemo>"c:\Program Files\NetBeans 8.2\java\maven\bin\mvn" test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestNGDemo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # TestNGDemo ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # TestNGDemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # TestNGDemo ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Andrew\Documents\NetBeansProjects\TestNGDemo\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # TestNGDemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) # TestNGDemo ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
testGetChangedString
getTrue
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.844 s - in TestSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.702s
[INFO] Finished at: Wed Jun 06 23:42:20 ACST 2018
[INFO] Final Memory: 9M/245M
[INFO] ------------------------------------------------------------------------
C:\Users\Andrew\Documents\NetBeansProjects\TestNGDemo>
Testing a single package
In this case only one test method runs, the parameterless one. The parameterized test method is skipped. This is a equivalent of right-clicking a package in NetBeans and selecting "Test package".
C:\Users\Andrew\Documents\NetBeansProjects\TestNGDemo>"c:\Program Files\NetBeans 8.2\java\maven\bin\mvn" test -Dtest=com.endersoft.testngdemo.**.*
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestNGDemo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # TestNGDemo ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # TestNGDemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # TestNGDemo ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Andrew\Documents\NetBeansProjects\TestNGDemo\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # TestNGDemo ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) # TestNGDemo ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.endersoft.testngdemo.SimpleClassNGTest
getTrue
[WARNING] Tests run: 2, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 2.422 s - in com.endersoft.testngdemo.SimpleClassNGTest
[INFO]
[INFO] Results:
[INFO]
[WARNING] Tests run: 2, Failures: 0, Errors: 0, Skipped: 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.268s
[INFO] Finished at: Wed Jun 06 23:47:28 ACST 2018
[INFO] Final Memory: 9M/245M
[INFO] ------------------------------------------------------------------------
Project source
The zipped project source can be downloaded from here (very small)
You need separate XML files for separate package. When running TestNG with package as parameter, TestNG is not automatically aware about the XML file, like it doesn't exist.
So you have multiple options, specify the parameters in properties file, or hardcode them, or create separate XML files for every package that you can then pass as parameter.

GWT migration from 2.6.1 to 2.7 compilation error at asm library

I am currently migrating GWT to higher version (from 2.6.1 to 2.7).
My app is a mutlimodule maven build on top of stack like: hibernate, spring, gwt.
I've done already a lot of stuff to make it work. Now I struggle with asm library, base on error:
[INFO] [ERROR] Unexpected internal compiler error
[INFO] java.lang.ArrayIndexOutOfBoundsException: 8192
[INFO] at org.objectweb.asm.ClassReader.readUTF8(Unknown Source)
[INFO] at org.objectweb.asm.ClassReader.accept(Unknown Source)
[INFO] at org.objectweb.asm.ClassReader.accept(Unknown Source)
I've done already a lot of exclusion of asm from spring.
Here is the asm occurence in dependency tree:
+- com.google.gwt:gwt-dev:jar:2.7.0:provided
| +- (org.ow2.asm:asm:jar:5.0.3:provided - omitted for duplicate)
| +- org.ow2.asm:asm-util:jar:5.0.3:provided
| | \- org.ow2.asm:asm-tree:jar:5.0.3:provided
| | \- (org.ow2.asm:asm:jar:5.0.3:provided - omitted for duplicate)
| \- org.ow2.asm:asm-commons:jar:5.0.3:provided
| \- (org.ow2.asm:asm-tree:jar:5.0.3:provided - omitted for duplicate)
\- org.ow2.asm:asm:jar:5.0.3:compile
I don't know where this error comes. Here is whole stack trace:
[INFO] ------------------------------------------------------------------------
[INFO] Building HenixWAR 2.50.30-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.google.gwt:gwt-vl:jar:2.0b is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # HenixWAR ---
[INFO] Deleting C:\Henix2\workspace\HenixWAR\target
[INFO]
[INFO] --- build-helper-maven-plugin:1.7:add-source (add-source) # HenixWAR ---
[INFO] Source directory: C:\Henix2\workspace\HenixWAR\target\filtered-sources\java added.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # HenixWAR ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource to ../../src/main/webapp
[INFO] Copying 1 resource to ../../src/main/java/pl/com/casus/Henix/resources
[INFO] Copying 1 resource to ../../target/spring-resources
[INFO] Copying 1 resource
[INFO] Copying 4 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) # HenixWAR ---
[INFO] Compiling 2849 source files to C:\Henix2\workspace\HenixWAR\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # HenixWAR ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Henix2\workspace\HenixWAR\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) # HenixWAR ---
[INFO] Compiling 424 source files to C:\Henix2\workspace\HenixWAR\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.19:test (default-test) # HenixWAR ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- gwt-maven-plugin:2.7.0:compile (default) # HenixWAR ---
[INFO] auto discovered modules [pl.com.casus.Henix.modules.main.Main, pl.com.casus.Henix.resources.MavenFilteredUserAgent, pl.com.casus.Henix.resources.Resources, pl.com.casus.Henix.modules.library.Library, MavenFilteredUserAgent]
[INFO] pl.com.casus.Henix.resources.MavenFilteredUserAgent has no EntryPoint - compilation skipped
[INFO] pl.com.casus.Henix.resources.Resources has no EntryPoint - compilation skipped
[INFO] pl.com.casus.Henix.modules.library.Library has no EntryPoint - compilation skipped
[INFO] MavenFilteredUserAgent has no EntryPoint - compilation skipped
[ERROR] wrz 14, 2017 8:28:52 AM java.util.prefs.WindowsPreferences <init>
[ERROR] WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
[INFO] Loading inherited module 'pl.com.casus.Henix.modules.main.Main'
[INFO] [WARN] Line 4: Setting configuration property named 'UiBinder.useSafeHtmlTemplates' in module 'pl.com.casus.Henix.modules.main.Main' that has not been previously defined
[INFO] Loading inherited module 'com.google.gwt.user.User'
[INFO] Loading inherited module 'com.google.gwt.media.Media'
[INFO] Loading inherited module 'com.google.gwt.user.UI'
[INFO] Loading inherited module 'com.google.gwt.uibinder.UiBinder'
[INFO] [WARN] Definition of already set configuration property named UiBinder.useSafeHtmlTemplates in com.google.gwt.uibinder.UiBinder (set in pl.com.casus.Henix.modules.main.Main). This may be disallowed in the future.
[INFO] [ERROR] Unexpected internal compiler error
[INFO] java.lang.ArrayIndexOutOfBoundsException: 8192
[INFO] at org.objectweb.asm.ClassReader.readUTF8(Unknown Source)
[INFO] at org.objectweb.asm.ClassReader.accept(Unknown Source)
[INFO] at org.objectweb.asm.ClassReader.accept(Unknown Source)
[INFO] at com.google.gwt.dev.javac.BytecodeSignatureMaker.visitCompileDependenciesInBytecode(BytecodeSignatureMaker.java:228)
[INFO] at com.google.gwt.dev.javac.BytecodeSignatureMaker.getCompileDependencySignature(BytecodeSignatureMaker.java:209)
[INFO] at com.google.gwt.dev.javac.CompiledClass.getSignatureHash(CompiledClass.java:166)
[INFO] at com.google.gwt.dev.javac.Dependencies$Ref.<init>(Dependencies.java:42)
[INFO] at com.google.gwt.dev.javac.Dependencies$Ref.<init>(Dependencies.java:37)
[INFO] at com.google.gwt.dev.javac.Dependencies.resolve(Dependencies.java:114)
[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:366)
[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:580)
[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:513)
[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:499)
[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:668)
[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:255)
[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)
[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:145)
[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:206)
[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:158)
[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:120)
[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:127)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Henix .............................................. SUCCESS [ 0.257 s]
[INFO] HenixDAO ........................................... SUCCESS [ 14.418 s]
[INFO] HenixApp ........................................... SUCCESS [ 13.549 s]
[INFO] HenixWS ............................................ SUCCESS [ 2.079 s]
[INFO] HenixWAR ........................................... FAILURE [ 42.005 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:12 min
[INFO] Finished at: 2017-09-14T08:29:06+02:00
[INFO] Final Memory: 145M/975M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.7.0:compile (default) on project HenixWAR: Command [[
And more detailed build:
Translatable source found in...
[INFO] Persistent unit cache dir set to: C:\Henix2\workspace\HenixWAR\src\main\gwt-unitCache
[INFO] Looking for previously cached Compilation Units in C:\Henix2\workspace\HenixWAR\src\main\gwt-unitCache
[INFO] Compiling module pl.com.tartus.Henix.modules.main.Main
[INFO] Looking for precompiled archives. To disable, use -Dgwt.usearchives=false
[INFO] Loading archived module: jar:file:/C:/Users/korbeda/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/core/Core.gwtar
[INFO] Loading archived module: jar:file:/C:/Users/korbeda/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/user/User.gwtar
[INFO] Loading archived module: jar:file:/C:/Users/korbeda/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/regexp/RegExp.gwtar
[INFO] Loading archived module: jar:file:/C:/Users/korbeda/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/web/bindery/event/Event.gwtar
[INFO] Loading archived module: jar:file:/C:/Users/korbeda/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/user/UI.gwtar
[INFO] Loading archived module: jar:file:/C:/Users/korbeda/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/user/UserAgent.gwtar
[INFO] Loading archived module: jar:file:/C:/Users/korbeda/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/user/DOM.gwtar
[INFO] Loading archived module: jar:file:/C:/Users/korbeda/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/user/RemoteService.gwtar
[INFO] Loading archived module: jar:file:/C:/Users/korbeda/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/activity/Activity.gwtar
[INFO] Loading archived module: jar:file:/C:/Users/korbeda/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/place/Place.gwtar
[INFO] Loading archived module: jar:file:/C:/Users/korbeda/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/logging/LoggingDisabled.gwtar
[INFO] Loading archived module: jar:file:/C:/Users/korbeda/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/json/JSON.gwtar
[INFO] Loading archived module: jar:file:/C:/Users/korbeda/.m2/repository/com/google/gwt/gwt-user/2.7.0/gwt-user-2.7.0.jar!/com/google/gwt/xml/XML.gwtar
[INFO] Found 3017 cached/archived units. Used 3017 / 6194 units from cache.
[INFO] Compiling...
[INFO] 60% complete (ETR: 3 seconds)
[INFO] 60% complete (ETR: 3 seconds)
[INFO] 60% complete (ETR: 3 seconds)
[INFO] 60% complete (ETR: 3 seconds)
[INFO] 60% complete (ETR: 3 seconds)
[INFO] 60% complete (ETR: 3 seconds)
[INFO] 60% complete (ETR: 3 seconds)
[INFO] 70% complete (ETR: 2 seconds)
[INFO] 80% complete (ETR: 1 seconds)
[INFO] 90% complete (ETR: 1 seconds)
[INFO] 100% complete (ETR: 0 seconds)
[INFO] Compilation completed in 9,81 seconds
[INFO] [ERROR] Unexpected internal compiler error
[INFO] java.lang.ArrayIndexOutOfBoundsException: 8960
[INFO] at org.objectweb.asm.ClassReader.readUTF8(Unknown Source)
[INFO] at org.objectweb.asm.ClassReader.accept(Unknown Source)
[INFO] at org.objectweb.asm.ClassReader.accept(Unknown Source)
[INFO] at com.google.gwt.dev.javac.BytecodeSignatureMaker.visitCompileDependenciesInBytecode(BytecodeSignatureMaker.java:228)
[INFO] at com.google.gwt.dev.javac.BytecodeSignatureMaker.getCompileDependencySignature(BytecodeSignatureMaker.java:209)
[INFO] at com.google.gwt.dev.javac.CompiledClass.getSignatureHash(CompiledClass.java:166)
[INFO] at com.google.gwt.dev.javac.Dependencies$Ref.<init>(Dependencies.java:42)
[INFO] at com.google.gwt.dev.javac.Dependencies$Ref.<init>(Dependencies.java:37)
[INFO] at com.google.gwt.dev.javac.Dependencies.resolve(Dependencies.java:114)
[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:366)
[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:580)
[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:513)
[INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:499)
[INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:668)
[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:255)
[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)
[INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:145)
[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:206)
[INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:158)
[INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:120)
[INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
[INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
[INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:127)
[INFO] Shutting down PersistentUnitCache thread

Why manually maven clean, install and run the server works, but maven clean install tomcat7:run give A child container failed during start?

Extenal tools configuration:
location:
C:\Users\IMT 02\eclipse\jee-mars\eclipse\apache-maven-3.3.3\bin\mvn.cmd
working:
${workspace_loc:/SpringRestCrud}
arguments:
clean install tomcat7:run
tool log:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.beingjavaguys.sample:SpringRestCrud:war:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # line 21, column 12
[WARNING] The expression ${pom.artifactId} is deprecated. Please use ${project.artifactId} instead.
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SpringRestCrud Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # SpringRestCrud ---
[INFO] Deleting C:\Users\IMT 02\git\rest\SpringRestCrud\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # SpringRestCrud ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # SpringRestCrud ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 56 source files to C:\Users\IMT 02\git\rest\SpringRestCrud\target\classes
[WARNING] /C:/Users/IMT 02/git/rest/SpringRestCrud/src/main/java/com/beingjavaguys/dao/ControleDAOImpl.java: Some input files use unchecked or unsafe operations.
[WARNING] /C:/Users/IMT 02/git/rest/SpringRestCrud/src/main/java/com/beingjavaguys/dao/ControleDAOImpl.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # SpringRestCrud ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # SpringRestCrud ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 7 source files to C:\Users\IMT 02\git\rest\SpringRestCrud\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # SpringRestCrud ---
[INFO] Surefire report directory: C:\Users\IMT 02\git\rest\SpringRestCrud\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.avenuecode.ProductRCTest
In Unit test
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.052 sec
Results :
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) # SpringRestCrud ---
[INFO] Packaging webapp
[INFO] Assembling webapp [SpringRestCrud] in [C:\Users\IMT 02\git\rest\SpringRestCrud\target\SpringRestCrud]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\IMT 02\git\rest\SpringRestCrud\src\main\webapp]
[INFO] Webapp assembled in [1680 msecs]
[INFO] Building war: C:\Users\IMT 02\git\rest\SpringRestCrud\target\SpringRestCrud.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # SpringRestCrud ---
[INFO] Installing C:\Users\IMT 02\git\rest\SpringRestCrud\target\SpringRestCrud.war to C:\Users\IMT 02\.m2\repository\com\beingjavaguys\sample\SpringRestCrud\1.0-SNAPSHOT\SpringRestCrud-1.0-SNAPSHOT.war
[INFO] Installing C:\Users\IMT 02\git\rest\SpringRestCrud\pom.xml to C:\Users\IMT 02\.m2\repository\com\beingjavaguys\sample\SpringRestCrud\1.0-SNAPSHOT\SpringRestCrud-1.0-SNAPSHOT.pom
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.1:run (default-cli) > process-classes # SpringRestCrud >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # SpringRestCrud ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # SpringRestCrud ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.1:run (default-cli) < process-classes # SpringRestCrud <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.1:run (default-cli) # SpringRestCrud ---
[INFO] Running war on http://localhost:8080/
[INFO] Creating Tomcat server configuration at C:\Users\IMT 02\git\rest\SpringRestCrud\target\tomcat
[INFO] create webapp with contextPath:
dez 01, 2016 8:38:17 AM org.apache.coyote.AbstractProtocol init
INFORMAÇÕES: Initializing ProtocolHandler ["http-bio-8080"]
dez 01, 2016 8:38:17 AM org.apache.catalina.core.StandardService startInternal
INFORMAÇÕES: Starting service Tomcat
dez 01, 2016 8:38:17 AM org.apache.catalina.core.StandardEngine startInternal
INFORMAÇÕES: Starting Servlet Engine: Apache Tomcat/7.0.37
dez 01, 2016 8:38:17 AM org.apache.catalina.core.ContainerBase startInternal
GRAVE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
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:1123)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
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.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
... 6 more
Caused by: java.lang.ClassCastException: org.springframework.web.SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer
at org.apache.catalina.startup.ContextConfig.getServletContainerInitializer(ContextConfig.java:1661)
at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1569)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1277)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more
dez 01, 2016 8:38:17 AM org.apache.catalina.core.ContainerBase startInternal
GRAVE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]
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:1123)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:335)
at org.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo.startContainer(AbstractRunMojo.java:1091)
at org.apache.tomcat.maven.plugin.tomcat7.run.AbstractRunMojo.execute(AbstractRunMojo.java:512)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
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 org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
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.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.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
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.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.510 s
[INFO] Finished at: 2016-12-01T08:38:17-02:00
[INFO] Final Memory: 27M/161M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:run (default-cli) on project SpringRestCrud: Could not start Tomcat: Failed to start component [StandardServer[-1]]: Failed to start component [StandardService[Tomcat]]: Failed to start component [StandardEngine[Tomcat]]: A child container failed during start -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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
clean log:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.beingjavaguys.sample:SpringRestCrud:war:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # line 21, column 12
[WARNING] The expression ${pom.artifactId} is deprecated. Please use ${project.artifactId} instead.
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SpringRestCrud Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # SpringRestCrud ---
[INFO] Deleting C:\Users\IMT 02\git\rest\SpringRestCrud\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.746 s
[INFO] Finished at: 2016-12-01T09:03:05-02:00
[INFO] Final Memory: 5M/153M
[INFO] ------------------------------------------------------------------------

Apache Tomcat 7 HTTP Connector node not found in intelliJ

I am developing an application using GWT, Maven on Apache Tomcat 7 with intelliJ idea. i have recently debugged and run my application but faced the following problem:Error running Tomcat 7: HTTP Connector node not found: set up one in the server.xml.
Apache Tomcat run code:
"c:\program files (x86)\jetbrains\intellij idea 11.1.4\jre\jre\bin\java" -Dclassworlds.conf=C:\Tools\apache-maven-3.1.1\bin\m2.conf -Dmaven.home=C:\Tools\apache-maven-3.1.1 -Dfile.encoding=UTF-8 -classpath C:\Tools\apache-maven-3.1.1\boot\plexus-classworlds-2.5.1.jar org.codehaus.classworlds.Launcher --offline --no-plugin-registry --fail-fast --strict-checksums --update-snapshots -f D:\Projects\ebank\pom.xml package -P gwtDebug,oracle
[WARNING] Command line option -npr is deprecated and will be removed in future Maven versions.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building AppFuse GWT Application 1.0
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.sun.xml.bind:jaxb-impl:jar:2.1.13 is missing, no dependency information available
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # AppfuseGWT ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 33 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # AppfuseGWT ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- native2ascii-maven-plugin:1.0-beta-1:native2ascii (native2ascii-utf8) # AppfuseGWT ---
[INFO] Includes: [ApplicationResources_zh*.properties, ApplicationResources_ko*.properties, displaytag_zh*.properties]
[INFO] Excludes: []
[INFO]
[INFO] --- exec-maven-plugin:1.2:exec (default) # AppfuseGWT ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # AppfuseGWT ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 17 resources
[INFO] Copying 9 resources
[INFO]
[INFO] >>> hibernate3-maven-plugin:2.2:hbm2ddl (default) # AppfuseGWT >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # AppfuseGWT ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 33 resources
[INFO]
[INFO] <<< hibernate3-maven-plugin:2.2:hbm2ddl (default) # AppfuseGWT <<<
[INFO]
[INFO] --- hibernate3-maven-plugin:2.2:hbm2ddl (default) # AppfuseGWT ---
[INFO] skipping hibernate3 execution
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # AppfuseGWT ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- dbunit-maven-plugin:1.0-beta-3:operation (test-compile) # AppfuseGWT ---
[INFO] Skip operation: CLEAN_INSERT execution
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # AppfuseGWT ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- dbunit-maven-plugin:1.0-beta-3:operation (test) # AppfuseGWT ---
[INFO] Skip operation: CLEAN_INSERT execution
[INFO]
[INFO] --- gwt-maven-plugin:2.5.0:compile (gwtcompile) # AppfuseGWT ---
[INFO] uz.eopc.webapp.MainModuleDebug is up to date. GWT compilation skipped
[INFO]
[INFO] --- maven-war-plugin:2.3:war (default-war) # AppfuseGWT ---
[INFO] Packaging webapp
[INFO] Assembling webapp [AppfuseGWT] in [D:\Projects\ebank\target\AppfuseGWT-1.0]
[INFO] Processing war project
[INFO] Copying webapp webResources [D:\Projects\ebank\src/main/resources/packaged] to [D:\Projects\ebank\target\AppfuseGWT-1.0]
[INFO] Copying webapp resources [D:\Projects\ebank\src\main\webapp]
[INFO] Webapp assembled in [279 msecs]
[INFO] Building war: D:\Projects\ebank\target\AppfuseGWT-1.0.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.405s
[INFO] Finished at: Mon Dec 09 10:54:04 UZT 2013
[INFO] Final Memory: 12M/29M
[INFO] ------------------------------------------------------------------------
[INFO] Maven execution finished
What should be done to fix this problem?
I have found the answer to fix this problem. I was using ubuntu 12.04 and in linux systems everything is connected with permissions. After i have opened read and write permission to my tomcat directory, it has worked out. to open read and write permission to a directory in ubuntu just write:
$ sudo chmod 777 -R folder_name/

Categories