[ 
https://issues.apache.org/jira/browse/SUREFIRE-1837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17311570#comment-17311570
 ] 

Tibor Digana edited comment on SUREFIRE-1837 at 3/30/21, 3:09 PM:
------------------------------------------------------------------

[~Enigo]
A perfect motivation is in 
https://github.com/mvndaemon/mvnd/issues/103#issuecomment-714448066
There are two exceptions.
As I have understood the comment, both exceptions are about the same problem.
Look, we as Surefire plugin do no cause this problem for sure, otherwise your 
project would not download anything at all.
So my recommendation is to go to the Maven mailinglist for developers open a 
discussion and put there exactly these two stacktraces.
I have been impressed by the existence of this:

{noformat}
apiguardian-api-1.0.0.pom.lastUpdated (Zugriff verweigert)
{noformat}

LastUpdated?
This means that the artifact is locked and it would expire after some time and 
you have to run {{mvn -U ..}}? Or it means that you share one local repository 
in your Jenkinsfile for all concurrent builds? And two Maven builds or two 
concurrent modules (therefore -T 2) attempt to download and override one 
artifact?
These are the question to the Maven team and you.
And yes there is one more. If you see the following two lines, it means that 
Surefire only calls the library {{maven-compact:3.0}} and Takari impl 
consequently. Is it buggy, or is the above problem?

{noformat}
at 
io.takari.aether.localrepo.TakariUpdateCheckManager.touchArtifact(TakariUpdateCheckManager.java:394)
at 
org.apache.maven.repository.legacy.LegacyRepositorySystem.resolve(LegacyRepositorySystem.java:367)
{noformat}

I don't know. But I know that Surefire calls some external components, that's 
all I can say to this issue right now.


was (Author: tibor17):
[~Enigo]
A perfect motivation is in 
https://github.com/mvndaemon/mvnd/issues/103#issuecomment-714448066
There are two exceptions.
As I have understood the comment, both exceptions are about the same problem.
Look, we as Surefire plugin do no cause this problem for sure, otherwise your 
project would not download anything at all.
So my recommendation is to go to the Maven mailinglist for developers open a 
discussion and put there exactly these two stacktraces.
I have been impressed by the existence of this:

{noformat}
apiguardian-api-1.0.0.pom.lastUpdated (Zugriff verweigert)
{noformat}

LastUpdated?
This means that the artifact is locked and it would expire after some time and 
you have to run {{mvn -U ..}}? Or it means that you share one local repository 
in your Jenkinsfile for all concurrent builds and two Maven builds attempt to 
download and override the artifact?
These are the question to the Maven team and you.
And yes there is one more. If you see the following two lines, it means that 
Surefire only calls the library {{maven-compact:3.0}} and Takari impl 
consequently. Is it buggy, or is the above problem?

{noformat}
at 
io.takari.aether.localrepo.TakariUpdateCheckManager.touchArtifact(TakariUpdateCheckManager.java:394)
at 
org.apache.maven.repository.legacy.LegacyRepositorySystem.resolve(LegacyRepositorySystem.java:367)
{noformat}

I don't know. But I know that Surefire calls some external components, that's 
all I can say to this issue right now.

> NullPointerException at AbstractSurefireMojo$ClasspathCache.setCachedClasspath
> ------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1837
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1837
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>    Affects Versions: 3.0.0-M5
>         Environment: mvn --version
> Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
> Maven home: /opt/apache-maven-3.6.3
> Java version: 11.0.8, vendor: Amazon.com Inc., runtime: 
> /usr/lib/jvm/java-11-amazon-corretto
> Jenkins ver. 2.204.6 on Ubuntu 18
>            Reporter: Ruslan Sibgatullin
>            Priority: Major
>
> While migrating a rather old and big project from Java 8 to Java 11 the 
> following exception happens occasionally (once in 3-4 builds):
> {code:java}
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) 
> on project my_project: Execution default-test of goal 
> org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test failed.: 
> NullPointerException -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute 
> goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test 
> (default-test) on project cachereloader-validation: Execution default-test of 
> goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test failed.
>  at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:215)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:156)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:148)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:117)
> at 
> org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call
>  (MultiThreadedBuilder.java:190)
> at 
> org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call
>  (MultiThreadedBuilder.java:186)
> at java.util.concurrent.FutureTask.run (FutureTask.java:264)
> at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
> at java.util.concurrent.FutureTask.run (FutureTask.java:264)
> at java.util.concurrent.ThreadPoolExecutor.runWorker 
> (ThreadPoolExecutor.java:1128)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run 
> (ThreadPoolExecutor.java:628)
> at java.lang.Thread.run (Thread.java:834)
> Caused by: org.apache.maven.plugin.PluginExecutionException: Execution 
> default-test of goal 
> org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test failed.
>  at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:148)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:210)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:156)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:148)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:117)
> at 
> org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call
>  (MultiThreadedBuilder.java:190)
> at 
> org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call
>  (MultiThreadedBuilder.java:186)
> at java.util.concurrent.FutureTask.run (FutureTask.java:264)
> at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
> at java.util.concurrent.FutureTask.run (FutureTask.java:264)
> at java.util.concurrent.ThreadPoolExecutor.runWorker 
> (ThreadPoolExecutor.java:1128)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run 
> (ThreadPoolExecutor.java:628)
> at java.lang.Thread.run (Thread.java:834)
> Caused by: java.lang.NullPointerException
> at 
> org.apache.maven.plugin.surefire.AbstractSurefireMojo$ClasspathCache.setCachedClasspath
>  (AbstractSurefireMojo.java:4121)
> at 
> org.apache.maven.plugin.surefire.AbstractSurefireMojo$ClasspathCache.access$200
>  (AbstractSurefireMojo.java:4102)
> at 
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.newStartupConfigWithClasspath
>  (AbstractSurefireMojo.java:1913)
> at 
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.createStartupConfiguration
>  (AbstractSurefireMojo.java:1894)
> at org.apache.maven.plugin.surefire.AbstractSurefireMojo.createForkStarter 
> (AbstractSurefireMojo.java:2374)
> at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider 
> (AbstractSurefireMojo.java:1310)
> at 
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked
>  (AbstractSurefireMojo.java:1159)
> at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute 
> (AbstractSurefireMojo.java:932)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:137)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:210)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:156)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:148)
> at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:117)
> at 
> org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call
>  (MultiThreadedBuilder.java:190)
> at 
> org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call
>  (MultiThreadedBuilder.java:186)
> at java.util.concurrent.FutureTask.run (FutureTask.java:264)
> at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
> at java.util.concurrent.FutureTask.run (FutureTask.java:264)
> at java.util.concurrent.ThreadPoolExecutor.runWorker 
> (ThreadPoolExecutor.java:1128)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run 
> (ThreadPoolExecutor.java:628)
> at java.lang.Thread.run (Thread.java:834){code}
> With exactly the same setup but using Java 8 this exception doesn't occur.
> The tests run on Jenkins ver. 2.204.6 like this:
> {code:java}
>  realtimeJUnit('**/target/surefire-reports/*.xml') {
>      sh "mvn test -e -T 1C"
>  }
> {code}
> {code:java}
> mvn --version
> Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
> Maven home: /opt/apache-maven-3.6.3
> Java version: 11.0.8, vendor: Amazon.com Inc., runtime: 
> /usr/lib/jvm/java-11-amazon-corretto
> {code}
> Also, with the plugin version 2.22.2 there is no exception but also 
> occasionally some random tests fail with 
> {code:java}
> java.lang.NoClassDefFoundError: 
> ....
> Caused by: java.lang.ClassNotFoundException: 
> {code}
> even thought classes are located right next to each other (sometimes it even 
> fails to find  inner static class)
> Plugin configuration
> {code:java}
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-surefire-plugin</artifactId>
>     <version>${surefire.version}</version>
>     <configuration>
>         <argLine>@{jacoco.agent.argLine} -Xmx512m -Xms256m 
> ${custom.test.argLine}</argLine>
>         <includes>
>             <include>**/*Test.java</include>
>             <include>**/*Specification.java</include>
>         </includes>
>         <excludes>
>             <exclude>**/*IntegrationTest.java</exclude>
>         </excludes>
>         <forkCount>1</forkCount>
>         
> <forkedProcessTimeoutInSeconds>${test.timeout}</forkedProcessTimeoutInSeconds>
>         <runOrder>random</runOrder>
>         <reuseForks>true</reuseForks>
>         <rerunFailingTestsCount>1</rerunFailingTestsCount>
>         <testFailureIgnore>true</testFailureIgnore>
>     </configuration>
> </plugin>
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to