marklogicmarklogic-10ml-gradle

Fail to initialize ml gradle project (mlDeployApp) with the rest-api-server


Fail to deploy a brand new mlgradle project to Marklogic 10.0-9.2-centos-1.0.0-ea4 in docker desktop.

Execution failed for task ':mlDeployApp'. > java.net.ConnectException: Failed to connect to localhost/127.0.0.1:8900

Steps to replicate the issues.

  1. Set up a brand new docker container from the official dockerhub marklogic image.
  2. Follow the readme.md file from the official ml-gradle GitHub site to create a brand new project like the below screenshot.

Notes:

(a) java version "18.0.1.1" 2022-04-22

(b) gradle 7.2 gradle wrapper --gradle-version 7.2

(c) build.gradle

plugins {
  id "net.saliman.properties" version "1.5.1"
  id "com.marklogic.ml-gradle" version "4.3.4"
}

vsc image


Solution

  • Make sure you have mapped the following ports from container to host:

    If you exposed 8000, 8001, and/or 8002 on a different number, than add properties to override those values.

    If you exposed 8900 and 9100 on different numbers, than you have to take extra measures, or pick different numbers that work both on host and inside the container.

    HTH!