无法使用 Java 连接到 Marklogic 数据库端口 8000

Unable to connect to Marklogic database port 8000 using Java

我无法使用 Java 代码库连接到 Marklogic 端口 8000 并收到以下错误:我正在使用管理员连接到此文档数据库

2017-09-07 12:14:58.494 INFO 25192 --- [main] c.h.c.b.testdata.DatabaseIndexWorker : ...使用文件中的索引 [range-path-index.json]

2017-09-07 12:14:58.496 INFO 25192 --- [main] c.h.c.b.testdata.DatabaseIndexWorker : ...读取管理员凭据

2017-09-07 12:14:58.496 INFO 25192 --- [main] c.h.c.b.testdata.DatabaseIndexWorker : ...URL 是 http://localhost:8002/manage/LATEST/databases/Documents/properties

2017-09-07 12:14:59.141 INFO 25192 --- [main].h.c.b.p.BackendPersistenceConfiguration:连接到位于 localhost:8000

的 MarkLogic 数据库

2017-09-07 12:14:59.142 WARN 25192 --- [main].h.c.b.p.BackendPersistenceConfiguration:在没有 SSL 的情况下连接到 MarkLogic 数据库

2017-09-07 12:14:59.175 DEBUG 25192 --- [main] c.marklogic.client.impl.JerseyServices:以 admin

身份连接到 8000 的本地主机

2017-09-07 12:14:59.405 DEBUG 25192 --- [main] c.marklogic.client.impl.JerseyServices : 在事务 null

中请求 some_document_that_does_not_need_to_exist 的头

2017-09-07 12:14:59.507 INFO 25192 --- [main] o.a.http.impl.client.DefaultHttpClient : I/O 异常 (java.net.SocketException) 在处理对 { 的请求时捕获}->http://localhost:8000: 连接重置

2017-09-07 12:14:59.509 INFO 25192 --- [main] o.a.http.impl.client.DefaultHttpClient : 重试对 {}->http://localhost:8000

的请求

2017-09-07 12:14:59.512 INFO 25192 --- [main] o.a.http.impl.client.DefaultHttpClient : I/O 异常 (java.net.SocketException) 在处理对 { 的请求时捕获}->http://localhost:8000: 连接重置

2017-09-07 12:14:59.512 INFO 25192 --- [main] o.a.http.impl.client.DefaultHttpClient : 重试对 {}->http://localhost:8000

的请求

2017-09-07 12:14:59.519 INFO 25192 --- [main] o.a.http.impl.client.DefaultHttpClient : I/O 异常 (java.net.SocketException) 在处理对 { 的请求时捕获}->http://localhost:8000: 连接重置

2017-09-07 12:14:59.519 INFO 25192 --- [main] o.a.http.impl.client.DefaultHttpClient:重试对 {}->http://localhost:8000

的请求

2017-09-07 12:14:59.522 WARN 25192 --- [main] s.c.a.AnnotationConfigApplicationContext:上下文初始化期间遇到异常 - 取消刷新尝试: org.springframework.beans.factory.BeanCreationException: 创建名称为 'testDataApplication' 的 bean 时出错:调用 init 方法失败; 嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建名称为 'databaseClient' 的 bean 在 com.hbi.ce.backend.persistence.BackendPersistenceConfiguration 中定义时出错:通过工厂方法实例化 Bean 失败; 嵌套异常是 org.springframework.beans.BeanInstantiationException:无法实例化 [com.marklogic.client.DatabaseClient]:工厂方法 'databaseClient' 抛出异常; 嵌套异常是 com.hbi.ce.backend.common.ConnectionException:MarkLogic 连接有问题;嵌套异常是 com.sun.jersey.api.client.ClientHandlerException:java.net.SocketException:连接重置

2017-09-07 12:14:59.528 信息 25192 --- [主要] utoConfigurationReportLoggingInitializer:

如果我尝试打开页面 https://localhost:8000/qconsole/:它工作正常 但是这个不起作用:http://localhost:8000/qconsole/

Admin 用户拥有 rest reader、rest writer 和 rest admin 权限。

如果我尝试创建一个单独的数据库(test 和附加的林 test-01 并在端口 8015 上创建相应的 rest 服务器,我可以使用此端口进行连接)。但是有了这个,我无法使用 Marklogic 的 dataMovementManager api 创建 writeBatcher。

任何输入出了什么问题?

我在 Marklogic 8 和 9 上都面临同样的问题

您将只能在 MarkLogic 9 上使用 writeBatcher 和 dataMovementManager,因为它们需要 MarkLogic 8 中没有的未记录的 REST 端点。

如果您只能连接到端口 8000 上的 https,那么您必须在该应用程序服务器 (App-Sevices 8000) 上安装 "ssl certificate template"。请参阅该应用服务器的管理页面以删除该 ssl 证书模板。

有关详细信息,请参阅安全指南中的 Configuring SSL on App Servers