mulesoft/mongo-connector — Issue #10: Username and password must exist in the connector configuration
Author: balinju
Created: 2012-01-11 16:30:43+00:00
State: open

In some cases, mongo authentication is switched off which means no username and password need to be set on the configuration. However, if these fields are not configured, the connector throws an exception stating:

Caused by: org.mule.api.MessagingException: Failed to create insertObject. Message payload is of type: BasicDBObject
at org.mule.module.mongo.config.InsertObjectMessageProcessor.process(InsertObjectMessageProcessor.java:410)
... 74 more
Caused by: java.lang.RuntimeException: You must provide a username at the config or the message processor level.
at org.mule.module.mongo.config.InsertObjectMessageProcessor.process(InsertObjectMessageProcessor.java:410)
at org.mule.processor.AsyncInterceptingMessageProcessor.process(AsyncInterceptingMessageProcessor.java:97)
at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:55)

If authentication is switched off from the mongo side, setting any username/password is sufficient as a workaround to get the connector to work.