2

我正在尝试设置示例应用程序以使用 Spring Batch git 文档在 MarkLogic 服务器中加载 100 个文档,但每次尝试运行我的工作时都会出现此错误:

    *** 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**

基本设置的 URL 在这里:https ://github.com/marklogic-community/marklogic-spring-batch/wiki/Getting-Started

我使用 IntelliJ 作为 IDE,还尝试下载 .jar 并将其添加到类路径依赖项中。我很感激这里的任何帮助。我不确定这是否是一个 gradle 问题。

编辑:此错误在构建任何 marklogic gradle 应用程序时很常见,而不是特定于 spring。我在 windows 10 机器上的采用 OpenJDK11 上使用 MarkLogic 10 和 gradle 版本 5.4.1。

4

2 回答 2

0

无法获取资源“https://jcenter.bintray.com/com/marklogic/marklogic-xcc/9.0.2/marklogic-xcc-9.0.2.jar”

位置https://jcenter.bintray.com/com/marklogic/marklogic-xcc/9.0.2/不包含请求的 jar marklogic-xcc-9.0.2.jar。确保指向包含该 jar 的有效 Maven 存储库。

于 2020-10-16T12:25:07.217 回答
0

您的错误的根本原因是build.gradle.

我的 Spring 框架 MVC 版本是:

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

如果您克隆整个项目并且没有升级任何依赖项:

  1. 24在中添加行core:build.gradle

在此处输入图像描述

  1. 加载 gradle 更改IntelliJ并清理部署项目。

成功构建 gradle 后,将搭建一个 App 服务器(在我的例子中,App 名称是ml-spring-batch@ 7010):

在此处输入图像描述

  1. IntelliJ中,仅针对执行 gradle 任务samples。在cmd中,运行任务:gradle runYourJob。gradle 任务完成后,内容数据库中加载了 100 个文档。
于 2020-10-25T00:56:03.490 回答