第一次连接后,Mule4上的MongoDb连接器5出错

时间:2018-01-15 10:16:55

标签: mongodb mule

我正在新的Mule运行时4上移动一个流程,但我的mongodb连接器版本5有问题。 在第一个连接工作得很好之后,从第二个连接引发错误:

ERROR 2018-01-15 10:37:53,319 [[MuleRuntime].io.02: [Payments].PaymentsFlow.BLOCKING @6f02d89b] org.mule.runtime.core.internal.exception.OnErrorPropagateHandler: 
********************************************************************************
Message               : An exception occurred while converting from java.io.ByteArrayInputStream@1a1e83e.
Element               : PaymentsFlow/processors/0 @ Payments:Payments.xml:69 (Find one document)
Element XML           : <mongo:find-one-document collectionName="Errors" doc:name="Find one document" doc:id="401053b0-2e5d-4c56-adcf-2ee07f8c67d6" config-ref="MongoDB_Config" failOnNotFound="false">
                        <mongo:find-query>{"Process":true}</mongo:find-query>
                        </mongo:find-one-document>
Error type            : MULE:UNKNOWN
--------------------------------------------------------------------------------
Root Exception stack trace:
org.bson.BsonInvalidOperationException: readStartDocument can only be called when CurrentBSONType is DOCUMENT, not when CurrentBSONType is END_OF_DOCUMENT.
    at org.bson.AbstractBsonReader.verifyBSONType(AbstractBsonReader.java:655)
    at org.bson.AbstractBsonReader.checkPreconditions(AbstractBsonReader.java:687)
    at org.bson.AbstractBsonReader.readStartDocument(AbstractBsonReader.java:421)
    at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:138)
    at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:45)
    at org.bson.Document.parse(Document.java:105)
    at org.bson.Document.parse(Document.java:90)
    at org.mule.modules.mongo.internal.util.ConverterUtils.toDocument(ConverterUtils.java:69)
    at org.mule.connectors.atlantic.commons.builder.execution.GenericExecutionBuilder.withParam(GenericExecutionBuilder.java:23)
    at org.mule.modules.mongo.internal.operation.DocumentOperations.findOneDocument(DocumentOperations.java:295)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:203)
    at org.mule.runtime.module.extension.internal.runtime.execution.ReflectiveMethodComponentExecutor.lambda$execute$0(ReflectiveMethodComponentExecutor.java:76)
    at org.mule.runtime.core.api.util.ExceptionUtils.tryExpecting(ExceptionUtils.java:215)
    at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:847)
    at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:813)
    at org.mule.runtime.module.extension.internal.runtime.execution.ReflectiveMethodComponentExecutor.execute(ReflectiveMethodComponentExecutor.java:75)
    at org.mule.runtime.module.extension.internal.runtime.operation.ReflectiveMethodOperationExecutor.execute(ReflectiveMethodOperationExecutor.java:64)
    at org.mule.runtime.module.extension.internal.runtime.execution.InterceptableOperationExecutorWrapper.execute(InterceptableOperationExecutorWrapper.java:60)
    at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$null$3(DefaultExecutionMediator.java:142)
    at org.mule.runtime.core.api.util.ExceptionUtils.tryExpecting(ExceptionUtils.java:215)
    at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:847)
    at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:813)
    at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$executeWithInterceptors$9(DefaultExecutionMediator.java:142)
    at reactor.core.* (23 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
    at org.mule.runtime.core.internal.processor.interceptor.ReactiveInterceptionAction.proceed(ReactiveInterceptionAction.java:70)
    at com.mulesoft.mule.debugger.server.DebuggerInterceptor.around(DebuggerInterceptor.java:70)
    at org.mule.runtime.core.internal.processor.interceptor.ReactiveAroundInterceptorAdapter.lambda$doAround$3(ReactiveAroundInterceptorAdapter.java:93)
    at org.mule.runtime.core.api.util.ExceptionUtils.tryExpecting(ExceptionUtils.java:215)
    at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:847)
    at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:813)
    at org.mule.runtime.core.internal.processor.interceptor.ReactiveAroundInterceptorAdapter.doAround(ReactiveAroundInterceptorAdapter.java:92)
    at org.mule.runtime.core.internal.processor.interceptor.ReactiveAroundInterceptorAdapter.lambda$null$1(ReactiveAroundInterceptorAdapter.java:59)
    at reactor.core.* (31 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
    at org.mule.runtime.core.privileged.processor.chain.* (1 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
    at reactor.core.* (40 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
    at org.mule.runtime.core.privileged.processor.chain.* (1 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
    at reactor.core.* (46 elements filtered from stack; set debug level logging or '-Dmule.verbose.exceptions=true' for everything)(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at org.mule.service.scheduler.internal.AbstractRunnableFutureDecorator.doRun(AbstractRunnableFutureDecorator.java:93)
    at org.mule.service.scheduler.internal.RunnableFutureDecorator.run(RunnableFutureDecorator.java:56)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

有人可以暗示发生了什么吗?我真的被卡住了。

2 个答案:

答案 0 :(得分:0)

自收集文档以来,我认为它会在集合中为下一个对象挂起。

你能否尝试使用

<mongo:find-documents>

取代

and let me now if it works..

答案 1 :(得分:0)

好的,我已经弄明白了。 mongo查询(在标记<mongo:find-query>{"Process":true}</mongo:find-query>之间)无法在mongo形状中解析。 将它放在mongo形状之前的变换中,解决问题