Java客户端连接MarkLogic 10服务器失败问题排查求助
MarkLogic 8→10迁移客户端连接异常原因分析
根异常信息
Root exception: org.apache.http.NoHttpResponseException: ml-onecms.dev.tsg.hmhco.com:9004 failed to respond at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:141) at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56) at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259) at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163) at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:165) at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273) at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108) at com.ixxus.hmh.service.http.connector.HttpClientExecutor.execute(HttpClientExecutor.java:114) at com.ixxus.hmh.jobs.CDMJobProcessor.doProcess(CDMJobProcessor.java:411) at com.ixxus.hmh.jobs.CDMJobProcessor.access$000(CDMJobProcessor.java:99) at com.ixxus.hmh.jobs.CDMJobProcessor$1.execute(CDMJobProcessor.java:194) at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:464) at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:333) at com.ixxus.hmh.jobs.CDMJobProcessor.executeJob(CDMJobProcessor.java:209) at org.alfresco.schedule.ScheduledJobLockExecuter.execute(ScheduledJobLockExecuter.java:94) at org.alfresco.schedule.AbstractScheduledLockedJob.executeInternal(AbstractScheduledLockedJob.java:72) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:114) at org.quartz.core.JobRunShell.run(JobRunShell.java:216) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
可能的问题原因
- TLS协议与加密套件不兼容:MarkLogic 10默认禁用了TLS 1.0/1.1等旧协议,若Java客户端使用的Apache HttpClient版本过低,或未配置支持TLS 1.2+,会导致无法建立安全连接,服务端直接断开无响应。
- 端口服务配置异常:检查9004端口在MarkLogic 10中是否绑定了正确的REST API服务,是否存在服务未启动、绑定地址限制(如仅允许本地访问)的情况。MarkLogic 10可能对默认端口或服务配置有调整,需确认端口映射正确。
- 连接池复用无效连接:客户端使用的Apache HttpClient连接池若未配置合理的连接校验机制,迁移后MarkLogic 10可能主动关闭闲置连接,但连接池仍持有旧连接,复用这些连接时就会触发无响应异常。建议设置
validateAfterInactivity参数,确保复用前验证连接有效性。 - 认证权限配置不符:MarkLogic 10对认证机制做了强化,比如默认启用更严格的身份验证策略,若客户端的认证信息(用户名密码、证书)不符合要求,服务端可能拒绝响应但不返回明确错误,导致客户端抛出该异常。
- 网络层面拦截:迁移后防火墙、负载均衡器的规则未更新,阻止了客户端到MarkLogic 10 9004端口的流量;或网络超时设置过短,请求未完成就被中断,引发无响应异常。
内容的提问来源于stack exchange,提问作者user1168655
相关产品推荐
相关产品推荐

