【问题标题】:javax.naming.CommunicationException: Request: 2 cancelledjavax.naming.CommunicationException:请求:2 已取消
【发布时间】:2018-02-13 15:52:30
【问题描述】:

我在确定应用程序是否要捕获和处理更多元素(枚举)时遇到此异常。

com.app.fr.chrom.batch.model.exception.ReaderException:com.app.fr.chrom.model.exception.TechnicalException:javax.naming.CommunicationException:请求:2 取消 在 com.app.fr.chrom.batch.ldap.reader.LdapItemReader.open(LdapItemReader.java:79) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:606) 在 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) 在 org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) 在 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) 在 org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:132) 在 org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:120) 在 org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 在 org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) 在 com.sun.proxy.$Proxy32.open(未知来源) 在 org.springframework.batch.item.support.CompositeItemStream.open(CompositeItemStream.java:96) 在 org.springframework.batch.core.step.tasklet.TaskletStep.open(TaskletStep.java:306) 在 org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:192) 在 org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:141) 在 org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:64) 在 org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60) 在 org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:151) 在 org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:130) 在 org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:135) 在 org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:301) 在 org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:134) 在 org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49) 在 org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:127) 在 com.app.fr.c4batch.C4Batch.launch(C4Batch.java:136) 在 com.app.fr.c4batch.BatchLauncher.main(BatchLauncher.java:54) 引起:com.app.fr.chrom.model.exception.TechnicalException:com.app.fr.chrom.model.exception.TechnicalException:javax.naming.CommunicationException:请求:2取消 在 com.app.fr.chrom.batch.service.impl.CollabLdapService.retrieveModifiedCollaborateur(CollabLdapService.java:116) 在 com.app.fr.chrom.batch.ldap.reader.LdapItemReader.open(LdapItemReader.java:77) ... 27 更多 引起:com.app.fr.chrom.model.exception.TechnicalException:javax.naming.CommunicationException:请求:2 取消 在 com.app.fr.chrom.dao.ldapimpl.RetrieveCollaborateurLdap.retrieveLastModified(RetrieveCollaborateurLdap.java:142) 在 com.app.fr.chrom.batch.service.impl.CollabLdapService.retrieveModifiedCollaborateur(CollabLdapService.java:82) ... 28 更多 引起:javax.naming.CommunicationException:请求:2 取消 在 com.sun.jndi.ldap.LdapRequest.getReplyBer(LdapRequest.java:105) 在 com.sun.jndi.ldap.Connection.readReply(Connection.java:452) 在 com.sun.jndi.ldap.LdapClient.getSearchReply(LdapClient.java:638) 在 com.sun.jndi.ldap.LdapClient.getSearchReply(LdapClient.java:606) 在 com.sun.jndi.ldap.LdapCtx.getSearchReply(LdapCtx.java:1920) 在 com.sun.jndi.ldap.LdapNamingEnumeration.getNextBatch(LdapNamingEnumeration.java:129) 在 com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreImpl(LdapNamingEnumeration.java:216) 在 com.sun.jndi.ldap.LdapNamingEnumeration.hasMore(LdapNamingEnumeration.java:189) 在 com.app.fr.chrom.dao.ldapimpl.RetrieveCollaborateurLdap.retrieveLastModified(RetrieveCollaborateurLdap.java:97) ... 29 更多
This my code:

<pre>

     InitialDirContext ctxLdap = new InitialDirContext(envLdap);
     final NamingEnumeration<?> userSearch = ctxLdap.search(getUsersSuffixDN(), searchFilter, searchControls);
     while (userSearch.hasMore()) {...} // <b>The HasMore method throws   <i>javax.naming.CommunicationException</i></b>

这个方法很少抛出这个异常,但我想知道它为什么会发生。感谢您的帮助

【问题讨论】:

  • 什么是searchFilter?
  • 您好,searchFilter 是我们用来从 LDAP 服务器获取结果的搜索过滤器。
  • 基于该链接:confluence.atlassian.com/hipchatkb/…,过滤器上的语法错误可能会发生错误

标签: java spring


【解决方案1】:

当您有一个注册用户并尝试再次注册时,可能会发生这种情况。

【讨论】:

    猜你喜欢
    • 2012-07-19
    • 2018-12-16
    • 1970-01-01
    • 2014-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多