Unable to setup MarkLogic spring batch basic app

178 Views Asked by At

I'm trying to setup the sample app to load 100 docs in MarkLogic server using the spring batch git documentation but I get this error everytime I try to run my job:

    *** What went wrong:
Execution failed for task ':runYourJob'.
> Could not resolve all files for configuration ':testRuntimeClasspath'.
   > Could not download marklogic-xcc.jar (com.marklogic:marklogic-xcc:9.0.2)
      > Could not get resource 'https://jcenter.bintray.com/com/marklogic/marklogic-xcc/9.0.2/marklogic-xcc-9.0.2.jar'.
         > Could not GET 'https://repo.jfrog.org/artifactory/libs-release-bintray/com/marklogic/marklogic-xcc/9.0.2/marklogic-xcc-9.0.2.jar?referrer'.
            > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target**

The URL for the basic setup is here: https://github.com/marklogic-community/marklogic-spring-batch/wiki/Getting-Started

I'm using IntelliJ as the IDE & also tried to download & add the .jar to the classpath dependency. I'd appreciate any help here. I'm not sur if this could be a gradle issue.

EDIT: This error is common while building any marklogic gradle app & not specific to spring. I'm using MarkLogic 10 & gradle version 5.4.1 on adoptOpenJDK11 in a windows 10 machine.

2

There are 2 best solutions below

1
On

Could not get resource 'https://jcenter.bintray.com/com/marklogic/marklogic-xcc/9.0.2/marklogic-xcc-9.0.2.jar'

The location https://jcenter.bintray.com/com/marklogic/marklogic-xcc/9.0.2/ does not contain the requested jar marklogic-xcc-9.0.2.jar. Make sure to point to a valid maven repository containing that jar.

0
On

The root cause of your error is that a dependency is missing in the build.gradle.

My Spring framework MVC version is:

MarkLogic Java API      5.3.0
JDK                     11
Spring Framework        5.2.7
Spring Batch            4.2.4           

If you clone the whole project and have not upgraded any dependencies:

  1. Add line 24 in the core:build.gradle

enter image description here

  1. Load gradle change in IntelliJ and clean deploy the project.

Upon the successful gradle build, an App server (in my case, App name is ml-spring-batch @ 7010) is scaffolded:

enter image description here

  1. In IntelliJ, execute gradle task against samples ONLY. In cmd, run task: gradle runYourJob. Upon the gradle task completion, 100 documents are loaded in the content database.