NetXMS Support Forum

English Support => General Support => Topic started by: cyril on May 22, 2017, 01:37:11 PM

Title: Netxms Java WebAPI build problem on Debian Jessie with jdk 7
Post by: cyril on May 22, 2017, 01:37:11 PM
Hi! I have tried to build Netxms WebAPI on Debian Jessie with openjdk 7.
I have followed these steps (https://wiki.netxms.org/wiki/NetXMS_WebAPI) to encountered such a problem:
On master (commit ecabd44ec20f8e7e1dfceba428490a42a184a72c) mvn install threw this error:

root@netxms:/opt/netxms/src/server/nxapisrv/java# mvn install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.netxms:netxms-websvc:war:2.1-RC1
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 77, column 18
[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 NetXMS REST API Server 2.1-RC1
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.netxms:netxms-base:jar:2.1-RC1 is missing, no dependency information available
[WARNING] The POM for org.netxms:netxms-client:jar:2.1-RC1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.438s
[INFO] Finished at: Mon May 22 10:14:32 UTC 2017
[INFO] Final Memory: 5M/30M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project netxms-websvc: Could not resolve dependencies for project org.netxms:netxms-websvc:war:2.1-RC1: The following artifacts could not be resolved: org.netxms:netxms-base:jar:2.1-RC1, org.netxms:netxms-client:jar:2.1-RC1: Failure to find org.netxms:netxms-base:jar:2.1-RC1 in http://maven.restlet.com was cached in the local repository, resolution will not be reattempted until the update interval of maven-restlet has elapsed or updates are forced -> [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/DependencyResolutionException

Then I tried to do the same on tag 2.1-M3 and mvn install threw this:

root@netxms:/opt/netxms/src/server/nxapisrv/java# mvn install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.netxms:netxms-websvc:war:2.1-M2
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 77, column 18
[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 NetXMS REST API Server 2.1-M2
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ netxms-websvc ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ netxms-websvc ---
[INFO] Compiling 17 source files to /opt/netxms/src/server/nxapisrv/java/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /opt/netxms/src/server/nxapisrv/java/src/main/java/org/netxms/websvc/json/JsonTools.java:[26,34] error: package org.netxms.base.annotations does not exist
[ERROR] /opt/netxms/src/server/nxapisrv/java/src/main/java/org/netxms/websvc/handlers/Objects.java:[51,58] error: incompatible types
[ERROR] /opt/netxms/src/server/nxapisrv/java/src/main/java/org/netxms/websvc/handlers/Objects.java:[133,38] error: cannot find symbol
[ERROR]   symbol:   method isWithinArea(double,double,double,double)
  location: class GeoLocation
/opt/netxms/src/server/nxapisrv/java/src/main/java/org/netxms/websvc/handlers/GrafanaDataCollection.java:[51,42] error: incompatible types
[ERROR] /opt/netxms/src/server/nxapisrv/java/src/main/java/org/netxms/websvc/json/JsonTools.java:[70,35] error: cannot find symbol
[ERROR]   symbol: class Internal
/opt/netxms/src/server/nxapisrv/java/src/main/java/org/netxms/websvc/json/JsonTools.java:[76,41] error: cannot find symbol
[INFO] 6 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.300s
[INFO] Finished at: Mon May 22 10:05:03 UTC 2017
[INFO] Final Memory: 11M/30M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project netxms-websvc: Compilation failure: Compilation failure:
[ERROR] /opt/netxms/src/server/nxapisrv/java/src/main/java/org/netxms/websvc/json/JsonTools.java:[26,34] error: package org.netxms.base.annotations does not exist
[ERROR] /opt/netxms/src/server/nxapisrv/java/src/main/java/org/netxms/websvc/handlers/Objects.java:[51,58] error: incompatible types
[ERROR] /opt/netxms/src/server/nxapisrv/java/src/main/java/org/netxms/websvc/handlers/Objects.java:[133,38] error: cannot find symbol
[ERROR] symbol:   method isWithinArea(double,double,double,double)
[ERROR] location: class GeoLocation
[ERROR] /opt/netxms/src/server/nxapisrv/java/src/main/java/org/netxms/websvc/handlers/GrafanaDataCollection.java:[51,42] error: incompatible types
[ERROR] /opt/netxms/src/server/nxapisrv/java/src/main/java/org/netxms/websvc/json/JsonTools.java:[70,35] error: cannot find symbol
[ERROR] symbol: class Internal
[ERROR] /opt/netxms/src/server/nxapisrv/java/src/main/java/org/netxms/websvc/json/JsonTools.java:[76,41] error: cannot find symbol
[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

Can you point what's wrong with it? Or will pre-built package of WebAPI available soon?
Title: Re: Netxms Java WebAPI build problem on Debian Jessie with jdk 7
Post by: tomaskir on May 22, 2017, 05:50:34 PM
2.1-RC1 netxms-client was not uploaded to Maven Central yet, that is why install fails.

Alex will have to do that, and it should install fine.
Title: Re: Netxms Java WebAPI build problem on Debian Jessie with jdk 7
Post by: Ēriks Jenkēvics on May 23, 2017, 11:23:42 AM
Try navigating to netxms/src/java/client and running package.sh
If it finishes without errors, try building the WebAPI again.
Title: Re: Netxms Java WebAPI build problem on Debian Jessie with jdk 7
Post by: cyril on May 23, 2017, 04:31:10 PM
Quote from: Ēriks Jenkēvics on May 23, 2017, 11:23:42 AM
Try navigating to netxms/src/java/client and running package.sh
If it finishes without errors, try building the WebAPI again.
Thanks, this has helped me.
Title: Re: Netxms Java WebAPI build problem on Debian Jessie with jdk 7
Post by: Ēriks Jenkēvics on May 23, 2017, 04:38:51 PM
Great! One of the things that the script does is it updates your local m2 repository to the latest version which is what you needed to be able to build the current WebAPI.