Leshan LWM2M SERVER - java

I'm working on Leshan (https://github.com/eclipse/leshan).
I've run the Leshan project in command line, so I use this command to launch tests:
mvn test
and I have errors:
Results :
Failed tests:
BootstrapTest.bootstrap:59 expected:<1> but was:<0>
SecurityTest.register_update_reregister_device_with_psk_to_server_with_psk:130 Values should be different. Actual: qtjLtAHNqi
Tests in error:
ObserveTest.can_observe_object:137 NullPointer
WriteTest.can_write_string_resource_in_tlv:74->write_string_resource:90 NullPointer
Tests run: 100, Failures: 2, Errors: 2, Skipped: 13
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] leshan ............................................. SUCCESS [0.092 s]
[INFO] leshan - core ...................................... SUCCESS [9.903 s]
[INFO] leshan - server core ............................... SUCCESS [1.666 s]
[INFO] leshan - server californium ........................ SUCCESS [2.778 s]
[INFO] leshan - client core ............................... SUCCESS [1.663 s]
[INFO] leshan - client californium ........................ SUCCESS [0.260 s]
[INFO] leshan - integration tests .........................FAILURE [33.324 s]
[INFO] leshan - server demo ............................... SKIPPED
[INFO] leshan - client demo ............................... SKIPPED
[INFO] leshan - bootstrap server demo ..................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51.197 s
[INFO] Finished at: 2016-06-07T13:50:17+02:00
[INFO] Final Memory: 29M/288M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project leshan-integration-tests: There are test failures.
[ERROR]
[ERROR] Please refer to C:\dvp_win\leshan-master\leshan-integration-tests\target\surefire-reports for the individual test results.
[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 :leshan-integration-tests
Please can you help me to solve this problem?

Not a great question. But your answer is there in the Maven output.
Failed tests:
BootstrapTest.bootstrap:59 expected:<1> but was:<0>
SecurityTest.register_update_reregister_device_with_psk_to_server_with_psk:130 Values should be different. Actual: qtjLtAHNqi
Tests in error:
ObserveTest.can_observe_object:137 NullPointer
WriteTest.can_write_string_resource_in_tlv:74->write_string_resource:90 NullPointer
Look at the BootstrapTest and SecurityTest .

If you want to run project without fail, you better skip the test.
command - mvn clean install -DskipTests
Refer to github https://github.com/eclipse/leshan/issues/323

Related

Maven dependency tree without install

I would like to run the mvn dependency:tree command on a lot of projects, but I sometimes get this error (example on google guava):
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Guava Maven Parent 31.1-jre:
[INFO]
[INFO] Guava Maven Parent ................................. SUCCESS [ 9.360 s]
[INFO] Guava: Google Core Libraries for Java .............. SUCCESS [ 1.473 s]
[INFO] Guava BOM .......................................... SUCCESS [ 4.277 s]
[INFO] Guava Testing Library .............................. SUCCESS [ 1.845 s]
[INFO] Guava Unit Tests ................................... SUCCESS [ 4.133 s]
[INFO] Guava GWT compatible libs .......................... FAILURE [ 8.632 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.051 s
[INFO] Finished at: 2022-03-15T15:22:05+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:tree (default-cli) on project guava-gwt: Execution default-cli of goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:tree failed: Plugin org.apache.maven.plugins:maven-dependency-plugin:3.1.1 or one of its dependencies could not be resolved: Could not find artifact com.google.guava:guava-tests:jar:test-sources:31.1-jre in sonatype-snapshots (https://oss.sonatype.org/content/repositories/snapshots/) -> [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/PluginResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :guava-gwt
If I run mvn install before this error does not appear. My problem is that sometimes the mvn install does not work.
Is there a way to make mvn dependency:tree work without using mvn install before?

Maven : Facing issue is creating the google Endpoint Liberary

Getting Error At the time of running the
mvn appengine:endpoints_get_client_lib
I got their are some issue with the maven plugin but how can i solve them.
error Log is given below.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building claritus-travelaware 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- appengine-maven-plugin:1.9.42:endpoints_get_client_lib (default-cli) # claritus-travelaware ---
[INFO]
[INFO] Google App Engine Java SDK - Generate endpoints get client lib
[INFO] Using Class Name:com.claritus.travelaware.endpoint.UserLocationEP
[INFO] Using Class Name:com.claritus.travelaware.endpoint.SubscribeUserEP
[INFO] Using Class Name:com.claritus.travelaware.YourFirstAPI
[INFO] Executing endpoints Command=[get-client-lib, -cp, /home/claritus/Desktop/workspace/claritus-travelaware/target/claritus-travelaware-1.0-SNAPSHOT/WEB-INF/classes:/home/claritus/Desktop/workspace/claritus-travelaware/target/classes:/home/claritus/.m2/repository/com/google/appengine/appengine-api-1.0-sdk/1.9.42/appengine-api-1.0-sdk-1.9.42.jar:/home/claritus/.m2/repository/com/google/appengine/appengine-endpoints/1.9.42/appengine-endpoints-1.9.42.jar:/home/claritus/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/home/claritus/.m2/repository/mysql/mysql-connector-java/5.1.31/mysql-connector-java-5.1.31.jar:/home/claritus/.m2/repository/org/hibernate/hibernate-core/4.2.0.Final/hibernate-core-4.2.0.Final.jar:/home/claritus/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar:/home/claritus/.m2/repository/org/jboss/logging/jboss-logging/3.1.0.GA/jboss-logging-3.1.0.GA.jar:/home/claritus/.m2/repository/org/jboss/spec/javax/transaction/jboss-transaction-api_1.1_spec/1.0.0.Final/jboss-transaction-api_1.1_spec-1.0.0.Final.jar:/home/claritus/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/home/claritus/.m2/repository/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.1.Final/hibernate-jpa-2.0-api-1.0.1.Final.jar:/home/claritus/.m2/repository/org/javassist/javassist/3.15.0-GA/javassist-3.15.0-GA.jar:/home/claritus/.m2/repository/org/hibernate/common/hibernate-commons-annotations/4.0.1.Final/hibernate-commons-annotations-4.0.1.Final.jar:/home/claritus/.m2/repository/org/springframework/security/spring-security-core/4.0.4.RELEASE/spring-security-core-4.0.4.RELEASE.jar:/home/claritus/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/home/claritus/.m2/repository/org/springframework/spring-beans/4.2.5.RELEASE/spring-beans-4.2.5.RELEASE.jar:/home/claritus/.m2/repository/org/springframework/spring-context/4.2.5.RELEASE/spring-context-4.2.5.RELEASE.jar:/home/claritus/.m2/repository/org/springframework/spring-expression/4.2.5.RELEASE/spring-expression-4.2.5.RELEASE.jar:/home/claritus/.m2/repository/org/springframework/spring-core/4.2.5.RELEASE/spring-core-4.2.5.RELEASE.jar:/home/claritus/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/home/claritus/.m2/repository/org/springframework/spring-aop/4.2.5.RELEASE/spring-aop-4.2.5.RELEASE.jar:/home/claritus/.m2/repository/org/springframework/spring-webmvc/4.2.5.RELEASE/spring-webmvc-4.2.5.RELEASE.jar:/home/claritus/.m2/repository/org/springframework/spring-web/4.2.5.RELEASE/spring-web-4.2.5.RELEASE.jar, -o, /home/claritus/Desktop/workspace/claritus-travelaware/target/generated-sources/appengine-endpoints/WEB-INF, -w, /home/claritus/Desktop/workspace/claritus-travelaware/target/generated-sources/appengine-endpoints, -l, java, -bs, maven, com.claritus.travelaware.endpoint.UserLocationEP, com.claritus.travelaware.endpoint.SubscribeUserEP, com.claritus.travelaware.YourFirstAPI]
API client library written to /home/claritus/Desktop/workspace/claritus-travelaware/target/generated-sources/appengine-endpoints/WEB-INF/userLocation-v1-java.zip
API client library written to /home/claritus/Desktop/workspace/claritus-travelaware/target/generated-sources/appengine-endpoints/WEB-INF/subscribeUsers-v1-java.zip
API client library written to /home/claritus/Desktop/workspace/claritus-travelaware/target/generated-sources/appengine-endpoints/WEB-INF/firstApi-v1-java.zip
[INFO] BUILDING Endpoints Client Library from: /home/claritus/Desktop/workspace/claritus-travelaware/target/endpoints-client-libs/firstApi/pom.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.227 s
[INFO] Finished at: 2016-09-16T10:07:40+05:30
[INFO] Final Memory: 19M/170M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.appengine:appengine-maven-plugin:1.9.42:endpoints_get_client_lib (default-cli) on project claritus-travelaware: Execution default-cli of goal com.google.appengine:appengine-maven-plugin:1.9.42:endpoints_get_client_lib failed: ${maven.home} is not specified as a directory: '/home/claritus/Desktop/workspace/claritus-travelaware/EMBEDDED'. -> [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/PluginExecutionException

MAVEN SUREFIRE PLUGIN ERROR

Im building a custom maven project for jenkins. After using the command
mvn -Plight-test install
I recieve this error .Please help. I have also added the plugin for surefire exception in the pom.xml file, but it isn't working! The error log is as follows :
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Jenkins main module ................................ SUCCESS [ 11.809 s]
[INFO] Jenkins cli ........................................ SUCCESS [ 38.319 s]
[INFO] Jenkins core ....................................... FAILURE [11:15 min]
[INFO] Jenkins war ........................................ SKIPPED
[INFO] Tests for Jenkins core ............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:10 min
[INFO] Finished at: 2016-05-05T12:26:54+05:30
[INFO] Final Memory: 39M/277M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project jenkins-core:
.
[ERROR]
[ERROR] Please refer to C:\Users\Anishas\git\jenkins\core\target\surefire-reports for the individual test results.
[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 :jenkins-core
Compile :
I had the same issues and I found out that the problem was that some of tests tried to create a System link and it was not possible because I didn't start my IDE (IntellijIdea) as administrator in Windows.
I started Intellij as administrator and that solved the problem.
Skipping test is not a good practice when developing.
mvn -Dmaven.test.skip=true -DskipTests=true clean install
use this command
Rerun with mvn -Plight-test install -rf jenkins-core -X to isolate the error

Keycloak: Error deploying project with maven

I just downloaded the version 1.8 of Keycloak (the version called Demo), containing some projects already done on a JBoss application server that should be easily tested.
I installed the product and I'm able to access to it.
I checked the pre-requirements:
java -version > 1.8.0_65 (1.8.* needed)
mvn -version > 3.10.0 (3.2.1 needed)
git --version > Installed
Just following the tutorial in YouTube ("Keycloak Tutorial: The Basics Part 2"), when I enter in the directory where is present the pom.xml file, I launch "mvn jboss-as:deploy", but the JBoss showes me this error:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Examples ........................................... SUCCESS [ 2.093 s]
[INFO] Customer Portal - Secured via Valve ................ FAILURE [ 6.766 s]
[INFO] Customer Portal CLI ................................ SKIPPED
[INFO] Customer Portal JS ................................. SKIPPED
[INFO] Product Portal ..................................... SKIPPED
[INFO] EAR example ........................................ SKIPPED
[INFO] Admin Access Example ............................... SKIPPED
[INFO] Angular Product Portal JS .......................... SKIPPED
[INFO] JAX-RS Database Service Using OAuth Bearer Tokens .. SKIPPED
[INFO] Simple OAuth Client ................................ SKIPPED
[INFO] Simple OAuth Client Using CDI and JSF .............. SKIPPED
[INFO] Service Account Example App ........................ SKIPPED
[INFO] Offline Access Portal .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.568 s
[INFO] Finished at: 2016-01-15T00:35:37+01:00
[INFO] Final Memory: 34M/168M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.5.Final:deploy (default-cli) on project customer-portal-example: Could not execute goal deploy on /home/user/keycloak-demo-1.8.0.CR1/examples/unconfigured-demo/customer-app/target/customer-portal.war. Reason: I/O Error could not execute operation '{
[ERROR] "operation" => "read-attribute",
[ERROR] "address" => [],
[ERROR] "name" => "launch-type"
[ERROR] }': java.net.ConnectException: JBAS012144: Could not connect to remote://localhost:9999. The connection timed out
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :customer-portal-example
How should I address this error?

Kura source code maven build failed with jdk:jdk.dio:jar:1.0.1 not found

I am on Ubuntu 14.04 LTS, Java 7, have installed Rasperry Pi, have also setup the kura eclipse workspace. Now I want to use the Kura source code to start the sample application.
I followed the Eclipse Kura getting started guide here
but when i ran `mvn clean install` in the kura/target-platform directory,
it failed with the following message:
[INFO] Reactor Summary:
[INFO]
[INFO] target-platform .................................... SUCCESS [ 0.147 s]
[INFO] Java API for working with Human Interface USB Devices (HID) SUCCESS [ 1.832 s]
[INFO] javax.usb API from javax-usb ....................... SUCCESS [ 0.226 s]
[INFO] javax.usb Common from javax-usb .................... SUCCESS [ 0.239 s]
[INFO] javax.usb Linux implementation from javax-usb ...... SUCCESS [ 0.190 s]
[INFO] Serial Device based on SODA DK comm ................ SUCCESS [ 0.483 s]
[INFO] p2-repo-common ..................................... FAILURE [ 0.491 s]
[INFO] p2-repo-equinox_3.8.1 .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.008 s
[INFO] Finished at: 2015-05-14T18:05:23+08:00
[INFO] Final Memory: 31M/427M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.9:copy (copy-dio-bundle-for-publishing) on project p2-repo-common: Unable to find artifact. Could not find artifact jdk:jdk.dio:jar:1.0.1 in nexus-releases (http://192.168.0.119:8081/nexus/content/groups/public)
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=jdk -DartifactId=jdk.dio -Dversion=1.0.1 -Dpackaging=jar -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=jdk -DartifactId=jdk.dio -Dversion=1.0.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR]
[ERROR] jdk:jdk.dio:jar:1.0.1
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] nexus-releases (http://192.168.0.119:8081/nexus/content/groups/public, releases=true, snapshots=true)
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :p2-repo-common
It is complaining not finding artifact jdk:jdk.dio:jar:1.0.1 which is provided in Java ME as far as I know. Do I need to install anything first before building the Kura source code?
The jdk.dio artifact is available in the "Add-ons" repo provided by Eurotech at https://raw.github.com/eurotech/kura_addons/mvn-repo
It looks like you may have a custom Maven settings file that causes everything to be searched in your local Nexus? (http://192.168.0.119:8081)
HTH.

Categories

Resources