OHDSI Home | Forums | Wiki | Github

Error deploying webapi on linux

I am attempting to deploy webapi and atlas on a linux (debian) server. Read up on instructions at https://academy.ehden.eu/mod/page/view.php?id=187&forceview=1 and following along on https://github.com/OHDSI/WebAPI/wiki/WebAPI-Installation-Guide. At step " ```
mvn clean package -DskipTests -s WebAPIConfig/settings.xml -P {profile id}


[INFO] --- maven-war-plugin:2.2:war (default-war) @ WebAPI ---
[INFO] Packaging webapp
[INFO] Assembling webapp [WebAPI] in [/home/gkovaig/develop/webapi/target/WebAPI]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/gkovaig/develop/webapi/src/main/webapp]
[INFO] Webapp assembled in [975 msecs]
[INFO] Building war: /home/gkovaig/develop/webapi/target/WebAPI.war
[INFO] Packaging classes
[INFO] Building jar: /home/gkovaig/develop/webapi/target/WebAPI-classes.jar
[INFO] 
[INFO] --- miredot-plugin:2.1.2:restdoc (default) @ WebAPI ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  27.556 s
[INFO] Finished at: 2020-11-17T05:34:36Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.qmino:miredot-plugin:2.1.2:restdoc (default) on project WebAPI: Execution default of goal com.qmino:miredot-plugin:2.1.2:restdoc failed: Plugin com.qmino:miredot-plugin:2.1.2 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.6.0 at specified path /usr/lib/jvm/java-11-openjdk-amd64/../lib/tools.jar -> [Help 1]

Environment:
OS: debian buster
Database: postgres 10.x
Java JDK 8.x (have also tied with 11.x, with similar error message)

Searching on stackoverflow, others have pointed out this could happen if only JRE was available, instead of JDK.  I have verified that I installed the JDK (and not the JRE).

I have also tried setting JAVA_HOME environment variable, with the same result.

Appreciate any help pointing me in the right direction.  Thank you!

After a lot of experimentation (er, hair-pulling), learnt that tools.jar is specific to Oracle JDK 8.x. It is not available in any later version of JDK or JRE, Oracle’s native version or openjdk version.

Next problem (and more hair-pulling) - JDK 8 is no longer available via normal package managers on linux (thus, sudo apt install openjdk-8-openjdk will not work).

The solution? Follow instructions exactly as outlined here: https://docs.datastax.com/en/jdk-install/doc/jdk-install/installOracleJdkDeb.html (thank you, DataStax!)

Fear not, next version of WebAPI will be moving up to something more recent, probably jdk 12 or 14. There’s been some resistance to move on the HADES front, but I think it’s only a matter of time.

t