ERROR MailServiceIT.testSendEmailFromTemplate:143 - spring-boot

I'm using JHipster 7.6.0 (Spring boot + React), when I run integration tests I got the following error. I searched on the internet but I have found nothing
Thanks in advance!
[ERROR] MailServiceIT.testSendEmailFromTemplate:143
expected: "test title"
but was: "Activation de votre compte gestionUtilisateurs"
[INFO]
[ERROR] Tests run: 225, Failures: 1, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.7:report-integration (post-integration-tests) # gestion-utilisateurs ---
[INFO] Loading execution data file C:\Users\ASUS\.jenkins\workspace\apisation portnet\target\jacoco-it.exec
[INFO] Analyzed bundle 'Gestion Utilisateurs' with 83 classes
[INFO]
[INFO] --- maven-checkstyle-plugin:3.1.2:check (default) # gestion-utilisateurs ---
[INFO] You have 0 Checkstyle violations.
[INFO]
[INFO] --- maven-failsafe-plugin:3.0.0-M5:verify (verify) # gestion-utilisateurs ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:20 min
[INFO] Finished at: 2022-02-21T14:36:42+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M5:verify (verify) on project gestion-utilisateurs: There are test failures.
[ERROR]

This failure happens if you choose French as a native language of the application. I reported this on JHipster GitHub repository. Also I mentioned how did I solve it so that the integration test won't fail.
here is the details of the failure:
https://github.com/jhipster/generator-jhipster/issues/17946
You can find my solution for the problem in Suggest a Fix
section in the link above
UPDATE
this issue is fixed since JHipster versoin 7.9.0

Related

VSTS Maven build - no JUnit tests run

[Update: Problem cause found! read below]
Problem: VSTS Maven build does not seem to run JUnit, does not show any JUnit results, does not seem to produce any JUnit testreports.
In VSTS, we have a Java project with a Contact and TestContact class with 1 testcase;
source\module\src\main\java\nl\customer\model\situation\Contact.java
source\module\src\test\java\nl\customer\model\ContactTest.java
source\module\pom.xml
Running Maven from Eclipse works fine. Console shows Maven using Surefire reports, running/passing the 1 unit test.
Running the project with Maven on a Windows PC also works:
mvn test
Logging:
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Domain Model
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # module ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 30 resources
[INFO] skip non existing resourceDirectory C:\project\source\projectdomain\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # module ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # module ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\project\source\module\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # module ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.20.1:test (default-test) # module ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running nl.customer.module.ContactTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 s - in nl.customer.module.ContactTest
[INFO]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.109 s
[INFO] Finished at: 2018-01-09T14:05:03+01:00
[INFO] Final Memory: 10M/196M
[INFO] ------------------------------------------------------------------------
In VSTS, using the Maven build step (goal: install) succeeds, but the log does not show anything about JUnit, even with system.debug = true.
Consequently, trying the "Publish test results" always fails (both when using a seperate build task or the Publish TFS option in the maven build task).
It seems I have found the cause of the problem: in VSTS, the Maven build task has the option
Set MAVEN_OPTS to
In our build definition, this was set to
-Xmx1024m -X
The first parameter is correct, it sets the maximum memory.
The second parameter is incorrect. If you want Maven to give debug output, you should put the "-X" parameter under Goal(s).
There is no real warning about the second parameter in the logging.

StreamingWordCount example maven compile time errors

I am getting the following errors while running compiling the Google dataflow example on the cloud instance. I am trying to run the streaming example by the name of StreamingWordCount using the following command
mvn compile exec:java -Dexec.mainClass=com.google.cloud.dataflow.examples.complete.StreamingWordCount.java
Is there something that I am doing wrong?Any help is appreciated.
Thanks
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Google Cloud Dataflow Java Examples - All manual_build
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- build-helper-maven-plugin:1.10:add-source (add-java8-main-source) # google-cloud-dataflow-java-examples-all ---
[INFO] Source directory: /home/gaurav_bareja/pipeline/DataflowJavaSDK-examples/src/main/java8 added.
[INFO]
[INFO] --- build-helper-maven-plugin:1.10:add-test-source (add-java8-test-source) # google-cloud-dataflow-java-exam
ples-all ---
[INFO] Test Source directory: /home/gaurav_bareja/pipeline/DataflowJavaSDK-examples/src/test/java8 added.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # google-cloud-dataflow-java-examples-all ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/gaurav_bareja/pipeline/DataflowJavaSDK-examples/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # google-cloud-dataflow-java-examples-all ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (java8-compile) # google-cloud-dataflow-java-examples-all ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] >>> exec-maven-plugin:1.1:java (default-cli) > validate # google-cloud-dataflow-java-examples-all >>>
[INFO]
[INFO] <<< exec-maven-plugin:1.1:java (default-cli) < validate # google-cloud-dataflow-java-examples-all <<<
[INFO]
[INFO] --- exec-maven-plugin:1.1:java (default-cli) # google-cloud-dataflow-java-examples-all ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.496 s
[INFO] Finished at: 2016-03-19T13:23:56+00:00
[INFO] Final Memory: 15M/56M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1:java (default-cli) on project google-cloud-d
ataflow-java-examples-all: An exception occured while executing the Java class. com.google.cloud.dataflow.examples.
complete.StreamingWordCount.java -> [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/MojoExecution
Exception
You seem to be attempting to run the StreamingWordCount example that comes with the Google Cloud Dataflow SDK for Java. The example under that name doesn't exist -- hence, the exception you are seeing.
You likely want to run WindowedWordCount instead, an example that shows how to run the same pipeline over either unbounded PCollections in the streaming mode or bounded PCollections in the batch mode.
Please follow the instructions here.

Running Hadoop Wordcount Job Error

I am new to using Hadoop, and I am currently trying to run wordcount on a single node cluster on my ubuntu desktop. I am trying to follow this guide to run the hadoop job:
http://javabeginnerstutorial.com/hadoop/your-first-hadoop-map-reduce-job/
Currently I am stuck on step 3, when I try to mvn clean install, this is the error I receive. I am using the exact same pom.xml file that is linked on step 3. Was I supposed to edit something in the pom.xml file in order to successfully compile? Or do the links possibly not work? Any help would be great. Thanks.
hduser#venus:~/development/Hadoop_projects/word_count$ mvn clean install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.impetus.code:hadoop-examples:jar:1.0
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # line 38, column 12
[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 hadoop-examples 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # hadoop-examples ---
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) # hadoop-examples ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/hduser/development/Hadoop_projects/word_count/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) # hadoop-examples ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.3:testResources (default-testResources) # hadoop-examples ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/hduser/development/Hadoop_projects/word_count/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) # hadoop-examples ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) # hadoop-examples ---
[INFO] No tests to run.
[INFO] Surefire report directory: /home/hduser/development/Hadoop_projects/word_count/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.874s
[INFO] Finished at: Wed Jul 15 00:34:04 PDT 2015
[INFO] Final Memory: 7M/240M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project hadoop-examples: Error creating properties files for forking; nested exception is java.io.IOException: No such file or directory -> [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
Try to get the pom and maven dependice from this http://mvnrepository.com/artifact/org.apache.hadoop/hadoop-mapreduce-client-core
Try to check the hadoop version before adding this pom file.
Run the maven command with -DskipTests

java project not getting analysed in sonar 3.3.5

When I give mvn sonar:sonar for sample java project in sonar I get this error.The sample project is from link
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Simple Java Maven Project 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:2.0:sonar (default-cli) # example-java-maven ---
[INFO] Sonar version: 3.5.1
[INFO] [12:29:59.781] Load batch settings
[INFO] [12:30:00.000] User cache: C:\Documents and Settings\xxx\.sonar\cache
[INFO] [12:30:00.156] Install plugins
INFO] [12:30:03.250] ------------- Executing Project Scan
[INFO] [12:30:04.500] Install JDBC driver
INFO] [12:30:04.515] Apply project exclusions
[WARN] [12:30:04.531] H2 database should be used for evaluation purpose only
[INFO] [12:30:04.531] Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
[INFO] [12:30:04.890] Initializing Hibernate
[INFO] [12:30:09.500] ------------- Inspecting Simple Java Maven Project
[INFO] [12:30:09.515] Load module settings
[INFO] [12:30:09.937] Excluded tests:
[INFO] [12:30:09.937] **/package-info.java
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.125s
[INFO] Finished at: Thu Jun 13 12:30:11 IST 2013
[INFO] Final Memory: 9M/28M
[INFO] ------------------------------------------------------------------------
ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (d
efault-cli) on project example-java-maven: Can not execute Sonar: You must insta
ll a plugin that supports the language 'java' -> [Help 1]
ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
Should I manually put any plugin to analyze java project?
It looks like you have removed the Java plugins from your Sonar home directory. You can upload the latest version at http://docs.codehaus.org/display/SONAR/Java+Ecosystem, copy the plugins into SONAR_HOME/extensions/plugins and restart your Sonar server.

Maven gives MojoExecutionException when Maven install

I am trying to install a Maven project, I am getting the following error message.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mail maven webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # mail ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) # mail ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 13 source files to C:\Users\gk\workspace-juno\mail\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # mail
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) # mail ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to C:\Users\gk\workspace-juno\mail\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.13:test (default-test) # mail ---
[INFO] Surefire report directory: C:\Users\gk\workspace-juno\mail\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Configuring TestNG with: TestNG652Configurator
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.684 sec
Results :
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-war-plugin:2.3:war (default-war) # mail ---
[INFO] Packaging webapp
[INFO] Assembling webapp [mail] in [C:\Users\gk\workspace-juno\mail\target\mail-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Users\gk\workspace-juno\mail\src\main\webapp]
[INFO] Webapp assembled in [895 msecs]
[INFO] Building war: C:\Users\gk\workspace-juno\mail\target\mail.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.398s
[INFO] Finished at: Mon May 20 12:28:45 IST 2013
[INFO] Final Memory: 15M/35M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:war (default-war) on project mail: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [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
Please help me in resolving this issue.
This error is self explainable:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:war (default-war) on project mail: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]
It says that you either need to have a "web.xml" file pre-existing in "WEB-INF" directory, or specify its location explicitly using a "webxml" parameter in the pom.xml or command line.

Resources