VM crash with maven-surefire-plugin having module-info.java - java

Initially I had one unique module-info in the next folder:
src/main/java/module-info.java.
I was able to run the tests successfully.
Now I need to overwrite the module-info because I need to add some changes that are relevant only for the test. The change is about opening the module. I am adding this new module-info.java here:
src/main/test/module-info.java.
If I execute the tests with that, I get the next error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M4:test (default-test) on project myProject: There are test failures.
[ERROR]
[ERROR] Please refer to /home/xxxxxx/workspace/myProject/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd /home/xxxxxx/workspace/myProject && /home/xxxxxx/programs/java/jdk-11.0.10/bin/java --add-reads org.eclipse.yasson=ALL-UNNAMED --add-opens org.eclipse.yasson/org.eclipse.yasson.internal.cdi=ALL-UNNAMED --add-exports org.eclipse.yasson/org.eclipse.yasson.internal.cdi=java.naming #/home/xxxxxx/workspace/myProject/target/surefire/surefireargs1904933309274673454 /home/xxxxxx/workspace/myProject/target/surefire 2021-03-15T16-59-30_852-jvmRun1 surefire12108354424712784981tmp surefire_06907989403807941803tmp
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was /bin/sh -c cd /home/xxxxxx/workspace/myProject && /home/xxxxxx/programs/java/jdk-11.0.10/bin/java --add-reads org.eclipse.yasson=ALL-UNNAMED --add-opens org.eclipse.yasson/org.eclipse.yasson.internal.cdi=ALL-UNNAMED --add-exports org.eclipse.yasson/org.eclipse.yasson.internal.cdi=java.naming #/home/xxxxxx/workspace/myProject/target/surefire/surefireargs1904933309274673454 /home/xxxxxx/workspace/myProject/target/surefire 2021-03-15T16-59-30_852-jvmRun1 surefire12108354424712784981tmp surefire_06907989403807941803tmp
[ERROR] Error occurred in starting fork, check output in log
[ERROR] Process Exit Code: 1
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:690)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:285)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:248)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1217)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1063)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:889)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
There is a new file created in target/surefire-reports/2021-03-15T16-59-30_852-jvmRun1.dumpstream:
# Created at 2021-03-15T16:59:31.842
Corrupted STDOUT by directly writing to native stream in forked JVM 1. Stream 'Error occurred during initialization of boot layer'.
# Created at 2021-03-15T16:59:31.854
Corrupted STDOUT by directly writing to native stream in forked JVM 1. Stream 'java.lang.module.FindException: Error reading module: /home/xxxxxx/workspace/myProject/target/test-classes'.
This is the module-info in the test folder:
open module org.eclipse.yasson {
requires jakarta.json;
requires jakarta.json.bind;
requires java.logging;
requires org.junit.jupiter.api;
requires static jakarta.annotation;
requires static java.naming;
requires static java.sql;
requires static java.desktop;
requires static jakarta.cdi;
exports org.eclipse.yasson;
exports org.eclipse.yasson.spi;
provides jakarta.json.bind.spi.JsonbProvider with org.eclipse.yasson.JsonBindingProvider;
uses org.eclipse.yasson.spi.JsonbComponentInstanceCreator;
}
maven-surefire-plugin:3.0.0-M4
java version "11.0.10"

The issue was that there were some tests in the default package (no package). After updating maven-surefire-plugin:3.0.0-M5 I was able to see this.

Related

An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar

I have encountered problems while trying to run sonarqube on my application. When I execute the command it throws me an error which doesn't say much to me. Does anyone know where is the problem here?
The Error looks like this:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.257 s
[INFO] Finished at: 2022-12-07T15:10:39+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project TeamTracker: Execution default-cli of goal org.sonarsource.sca
nner.maven:sonar-maven-plugin:3.9.1.2184:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar: java.la
ng.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:sonar-maven-plugin:3.9.1.2184
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/A113408609/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.9.1.2184/sonar-maven-plugin-3.9.1.2184.jar
[ERROR] urls[1] = file:/C:/Users/A113408609/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[2] = file:/C:/Users/A113408609/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[3] = file:/C:/Users/A113408609/.m2/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
[ERROR] urls[4] = file:/C:/Users/A113408609/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.16.2.588/sonar-scanner-api-2.16.2.588.jar
[ERROR] urls[5] = file:/C:/Users/A113408609/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security
.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module #26f204a4
[ERROR] -> [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/PluginContainerException
'cmd' is not recognized as an internal or external command,
operable program or batch file.
This is a command I execute:
mvn sonar:sonar -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_AUTH_TOKEN -Dsonar.projectKey=$SONAR_PROJECT_KEY -Dsonar.projectName=$CI_PROJECT_PATH_SLUG
I have gone through documentations but I still really can't see what is the problem here :/
When I try to run mvn clean install the build is succesfull.
I am using Java 11, Maven 3.6.3 and Sonar Community Edition Version 8.9.10

Quarkus application is failing with message Failed to build quarkus application: io.quarkus.builder.BuildException:

I am trying to develop a simple Quarkus wrapper application to my Java based application Project-A. I am able to create the application but when I run the command mvn clean install then I am getting the error:
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.9.2.Final:build (default) on project project-a-service: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkus.amazon.common.deployment.AmazonServicesClientsProcessor#setup threw an exception: javax.enterprise.inject.spi.DeploymentException: Missing 'software.amazon.awssdk:url-connection-client' dependency on the classpath
[ERROR] at io.quarkus.amazon.common.deployment.AmazonServicesClientsProcessor.missingDependencyException(AmazonServicesClientsProcessor.java:171)
[ERROR] at io.quarkus.amazon.common.deployment.AmazonServicesClientsProcessor.setup(AmazonServicesClientsProcessor.java:120)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[ERROR] at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:925)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR] at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:833)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] -> [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
I tried adding the dependency:
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>url-connection-client</artifactId>
<version>2.17.224</version>
</dependency>
But still its not working for me. Can someone please let me know why am I getting this issue and how can I fix this please?
Having the same error and was not able to solve it with lates quarkus 2.10.2.
Worked around using the direkt dependency of the AWS SDK and not the quarkus dependency. In my case the service was SQS.
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>sqs</artifactId>
<version>2.17.229</version>
</dependency>

Caused by: org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process [ERROR] Cannot instantiate class

I am migrating my project to Java 15 version. We have done all the required changes and started building a maven clean install.
I am getting the below error. Tried many from google and Github other forums, nothing working.
TestNG version changes, and some plugin changes, but no luck.
Please find below the error. Can someone help...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project quarterback: There are test failures.
[ERROR]
[ERROR] Please refer to surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] ExecutionException There was an error in the forked process
[ERROR]
[ERROR] Cannot instantiate class com....ABCTest
[ERROR] ExecutionException There was an error in the forked process
[ERROR]
[ERROR] Cannot instantiate class com...DEFTest
[ERROR] ExecutionException There was an error in the forked process
[ERROR]
[ERROR] Cannot instantiate class com...GHITest
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: ExecutionException There was an error in the forked process
[ERROR]
[ERROR] Cannot instantiate class com...JKLTest
[ERROR] ExecutionException There was an error in the forked process
[ERROR]
[ERROR] Cannot instantiate class com...MNOTest
[ERROR] ExecutionException There was an error in the forked process
[ERROR]
[ERROR] Cannot instantiate class com...ABCTest
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.awaitResultsDone(ForkStarter.java:532)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.runSuitesForkOnceMultiple(ForkStarter.java:405)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:321)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:266)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1314)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1159)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:932)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[ERROR] Caused by: org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR]
[ERROR] Cannot instantiate class com....DEFTest
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:733)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.access$700(ForkStarter.java:121)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter$1.call(ForkStarter.java:393)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter$1.call(ForkStarter.java:370)
[ERROR] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[ERROR] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
[ERROR] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:832)
The thing that you see the stacktrace does not necessarily mean an error in the plugin.
I think the log with Cannot instantiate class com...ABCTest is printed by your framework, TestNG. Is the TestNG reliable in JDK 15?
You can see more in the dump files with detailed errors located in target/surefire-reports.
I found similar issue in https://sqa.stackexchange.com/questions/14680/cannot-instantiate-class-error-selenium-webdriver and the root cause looks like they called the driver
driver.findElement(...)
in the constructor of the test class.
I had a very similar problem with surefire and testng and it turned out that there was an error in the constructor of the test class that had been swallowed. My solution was to surround the whole costuctor code with try/catch and log the exception manually to find the real issue.

Maven command 'mvn clean test' causes build failure

I've got a Maven project for a java application. The software versions I'm using are following:
Maven 3.6.3, Java 1.8.0_241.
I've got few junit tests within this Maven project, that I'm trying to run using the Maven "mvn" command. When I run the command "mvn clean test" on my Maven project to run my unit tests, I get below mentioned build failure.
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:48 min
[INFO] Finished at: 2020-02-21T09:37:00+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project Myproject-restapis: There are test failures.
[ERROR]
[ERROR] Please refer to F:\eclipseWorkspaces\my_project\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was cmd.exe /X /C "C:\jdk1.8.0_241\jre\bin\java -jar C:\Users\mukul\AppData\Local\Temp\surefire4895736141834565700\surefirebooter185004090178601900.jar C:\Users\mukul\AppData\Local\Temp\surefire4895736141834565700 2020-02-21T09-34-41_267-jvmRun1 surefire413243705282645614tmp surefire_01613681214173913161tmp"
[ERROR] Process Exit Code: 0
[ERROR] Crashed tests:
[ERROR] com.example.test.SampleTest
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was cmd.exe /X /C "C:\jdk1.8.0_241\jre\bin\java -jar C:\Users\mukul\AppData\Local\Temp\surefire4895736141834565700\surefirebooter185004090178601900.jar C:\Users\mukul\AppData\Local\Temp\surefire4895736141834565700 2020-02-21T09-34-41_267-jvmRun1 surefire413243705282645614tmp surefire_01613681214173913161tmp"
[ERROR] Process Exit Code: 0
[ERROR] Crashed tests:
[ERROR] com.example.test.SampleTest
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:669)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
I've looked a lot on web about the above mentioned issue, but haven't been able to solve this for few days now.
The command 'mvn clean install -DskipTests' runs fine for me, and I get build success.
Can anyone please try to provide solution for the above mentioned issue, with the Maven command 'mvn clean test'.
Well, I had the exactly same issue, and the way that I sorted it out was to configure log properly for my tests..
I have a multi-module project, and I added a logback-test.xml in the root my my parent project and pointed my maven-surefire-plugin to load this file. See the config bellow:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Dlogback.configurationFile=${project.basedir}/../logback-test.xml</argLine>
</configuration>
</plugin>
In the logbook-test.xml I reduced a lot of the logs and added some library packages to print from WARN level.
<logger name="org.apache.solr" level="WARN" />
Important: Make sure you replace all System.out.println with log.debug

Talend Build Job - Compilation issue

I have been using Talend Data Integration Tool (Licensed Version) in my company.But,since its license is too much expensive,we have been told to use Talend Open Studio (Free Open source version).So,we have to move all our existing jobs to Free Version's work-space.Some components are not there in free version,so I have used possible alternatives to achieve similar functionality.Now,I am trying to Build the job from Talend,I am getting compilation error of routine and I am not able to Build job to test.Can anyone help me out in solving this ?
I have tried to remove dependency(import package) from job's source file manually but every time I Build the job,it is automatically getting imported into the source code.
I am getting this error :
org.talend.commons.exception.PersistenceException: org.talend.designer.runprocess.ProcessorException: java.lang.Exception: [ERROR] COMPILATION ERROR :
[ERROR] C:\Program Files\TOS_DI-Win32-20181026_1147-V7.1.1\workspace\MASTERDB\poms\jobs\process\Standard\GENERIC\Finalization_Scripts\is_golden_record\datablock_is_golden_record\company_identifier_is_golden_0.1\src\main\java\masterdb\company_identifier_is_golden_0_1\company_identifier_is_golden.java:[21]
[ERROR] COMPILATION ERROR :
[ERROR] C:\Program Files\TOS_DI-Win32-20181026_1147-V7.1.1\workspace\MASTERDB\poms\jobs\process\Standard\Factset\Automated_Jobs\factset_load_company_name_automated_0.1\src\main\java\masterdb\factset_load_company_name_automated_0_1\Factset_Load_Company_Name_Automated.java:[20]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project company_identifier_is_golden: Compilation failure
[ERROR] C:\Program Files\TOS_DI-Win32-20181026_1147-V7.1.1\workspace\MASTERDB\poms\jobs\process\Standard\GENERIC\Finalization_Scripts\is_golden_record\datablock_is_golden_record\company_identifier_is_golden_0.1\src\main\java\masterdb\company_identifier_is_golden_0_1\company_identifier_is_golden.java:[21]
[ERROR] import routines.TalendDataGenerator;
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The import routines.TalendDataGenerator cannot be resolved
[ERROR] 1 problem (1 error)
[ERROR] -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :company_identifier_is_golden
at org.talend.repository.ui.wizards.exportjob.scriptsmanager.BuildJobManager.buildJob(BuildJobManager.java:298)
at org.talend.repository.ui.wizards.exportjob.scriptsmanager.BuildJobManager.buildJob(BuildJobManager.java:210)
at org.talend.repository.ui.wizards.exportjob.scriptsmanager.BuildJobManager.buildJobs(BuildJobManager.java:125)
at org.talend.repository.ui.wizards.exportjob.JobScriptsExportWizardPage.buildJobWithMaven(JobScriptsExportWizardPage.java:1491)
at org.talend.repository.ui.wizards.exportjob.JobScriptsExportWizardPage$8.run(JobScriptsExportWizardPage.java:1394)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:466)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:374)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1059)
at org.talend.repository.ui.wizards.exportjob.JobScriptsExportWizardPage.finish(JobScriptsExportWizardPage.java:1399)
at org.talend.repository.ui.wizards.exportjob.JavaJobScriptsExportWSWizardPage.finish(JavaJobScriptsExportWSWizardPage.java:1643)
at org.talend.repository.ui.wizards.exportjob.JobScriptsExportWizard.performFinish(JobScriptsExportWizard.java:126)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:853)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:438)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:619)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:832)
at org.eclipse.jface.window.Window.open(Window.java:808)
at org.talend.repository.ui.actions.ExportJobScriptAction.doRun(ExportJobScriptAction.java:122)
at org.talend.repository.ui.actions.AContextualAction$2.run(AContextualAction.java:673)
at org.talend.repository.RepositoryWorkUnit.executeRun(RepositoryWorkUnit.java:99)
at org.talend.core.repository.model.AbstractRepositoryFactory.executeRepositoryWorkUnit(AbstractRepositoryFactory.java:258)
at org.talend.repository.localprovider.model.LocalRepositoryFactory.executeRepositoryWorkUnit(LocalRepositoryFactory.java:3495)
at org.talend.core.repository.model.ProxyRepositoryFactory.executeRepositoryWorkUnit(ProxyRepositoryFactory.java:2265)
at org.talend.repository.ui.actions.AContextualAction.run(AContextualAction.java:686)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:519)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.talend.rcp.intro.Application.start(Application.java:265)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
Caused by: org.talend.designer.runprocess.ProcessorException: java.lang.Exception: [ERROR] COMPILATION ERROR :
[ERROR] C:\Program Files\TOS_DI-Win32-20181026_1147-V7.1.1\workspace\MASTERDB\poms\jobs\process\Standard\GENERIC\Finalization_Scripts\is_golden_record\datablock_is_golden_record\company_identifier_is_golden_0.1\src\main\java\masterdb\company_identifier_is_golden_0_1\company_identifier_is_golden.java:[21]
[ERROR] COMPILATION ERROR :
[ERROR] C:\Program Files\TOS_DI-Win32-20181026_1147-V7.1.1\workspace\MASTERDB\poms\jobs\process\Standard\Factset\Automated_Jobs\factset_load_company_name_automated_0.1\src\main\java\masterdb\factset_load_company_name_automated_0_1\Factset_Load_Company_Name_Automated.java:[20]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project company_identifier_is_golden: Compilation failure
[ERROR] C:\Program Files\TOS_DI-Win32-20181026_1147-V7.1.1\workspace\MASTERDB\poms\jobs\process\Standard\GENERIC\Finalization_Scripts\is_golden_record\datablock_is_golden_record\company_identifier_is_golden_0.1\src\main\java\masterdb\company_identifier_is_golden_0_1\company_identifier_is_golden.java:[21]
[ERROR] import routines.TalendDataGenerator;
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The import routines.TalendDataGenerator cannot be resolved
[ERROR] 1 problem (1 error)
[ERROR] -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :company_identifier_is_golden
Sorry but I can't use the comment option (for the moment).
"So, we have to move all our existing jobs to Free Version's work-space."
Did you manually move the files from your old workspace to the new Open Studio workspace?
Did you only export the elements (Jobs, Contexts, Routines, etc.)? With/without the dependencies?
Did you export all the Talend project(s) and import it/them into the Open Studio version?
I suggest you to use the third option, export then import the whole project(s), by means of the option dedicated.
Let me know.

Categories