mulesoft/twitter-connector — Issue #7: send-direct-message-by-screen-name operation throwing "JSONObject["sender"] not found error" error intermittently
Author: ealdinio
Created: 2011-10-11 21:34:41+00:00
State: open

I am testing the Twitter Cloud Connector in Mule 3.2 Runtime in Mule Studio but I am experiencing intermittent errors when running an application with the send-direct-message-by-screen-name operation.

I am following the person who I am sending the direct message. It works once and then it starts to fail.

""html

""

Logs from the console:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Started app 'twitter_test' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
INFO 2011-10-11 18:18:17,477 [[twitter_test].connector.http.mule.default.receiver.02] org.mule.api.security.provider.AutoDiscoverySecurityProviderFactory: Using org.mule.api.security.provider.SunSecurityProviderInfo
INFO 2011-10-11 18:18:17,551 [[twitter_test].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Initialising connector: connector.https.mule.default
INFO 2011-10-11 18:18:17,566 [[twitter_test].connector.http.mule.default.receiver.02] org.mule.api.security.tls.TlsPropertiesMapper: Defaulting javax.net trust store to client Key Store
INFO 2011-10-11 18:18:17,580 [[twitter_test].connector.http.mule.default.receiver.02] org.mule.transport.http.HttpsConnector: Connected: HttpsConnector
{
name=connector.https.mule.default
lifecycle=initialise
this=5106def2
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[https]
serviceOverrides=
}

INFO 2011-10-11 18:18:17,580 [[twitter_test].connector.http.mule.default.receiver.02] org.mule.transport.http.HttpsConnector: Starting: HttpsConnector
{
name=connector.https.mule.default
lifecycle=initialise
this=5106def2
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[https]
serviceOverrides=
}

INFO 2011-10-11 18:18:17,580 [[twitter_test].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Starting connector: connector.https.mule.default
INFO 2011-10-11 18:18:17,614 [[twitter_test].connector.http.mule.default.receiver.02] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default outbound transformer: org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest
INFO 2011-10-11 18:18:17,619 [[twitter_test].connector.http.mule.default.receiver.02] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse
INFO 2011-10-11 18:18:17,620 [[twitter_test].connector.http.mule.default.receiver.02] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default outbound transformer: org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest
INFO 2011-10-11 18:18:17,620 [[twitter_test].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'connector.https.mule.default.dispatcher.122010525'. Object is: HttpsClientMessageDispatcher
INFO 2011-10-11 18:18:17,622 [[twitter_test].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'connector.https.mule.default.dispatcher.122010525'. Object is: HttpsClientMessageDispatcher
ERROR 2011-10-11 18:18:20,731 [[twitter_test].connector.http.mule.default.receiver.02] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Failed to invoke sendDirectMessageByScreenName. Message payload is of type: String
Code : MULE_ERROR-29999
--------------------------------------------------------------------------------
Exception stack is:
1. JSONObject["sender"] not found. (twitter4j.internal.org.json.JSONException)
twitter4j.internal.org.json.JSONObject:461 (null)
2. JSONObject["sender"] not found. (twitter4j.TwitterException)
twitter4j.DirectMessageJSONImpl:74 (null)
3. Failed to invoke sendDirectMessageByScreenName. Message payload is of type: String (org.mule.api.MessagingException)
org.mule.twitter.config.SendDirectMessageByScreenNameMessageProcessor:340 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
twitter4j.internal.org.json.JSONException: JSONObject["sender"] not found.
at twitter4j.internal.org.json.JSONObject.get(JSONObject.java:461)
at twitter4j.internal.org.json.JSONObject.getJSONObject(JSONObject.java:560)
at twitter4j.DirectMessageJSONImpl.init(DirectMessageJSONImpl.java:71)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

ERROR 2011-10-11 18:18:51,604 [[twitter_test].connector.http.mule.default.receiver.02] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Failed to invoke sendDirectMessageByScreenName. Message payload is of type: String
Code : MULE_ERROR-29999
--------------------------------------------------------------------------------
Exception stack is:
1. JSONObject["sender"] not found. (twitter4j.internal.org.json.JSONException)
twitter4j.internal.org.json.JSONObject:461 (null)
2. JSONObject["sender"] not found. (twitter4j.TwitterException)
twitter4j.DirectMessageJSONImpl:74 (null)
3. Failed to invoke sendDirectMessageByScreenName. Message payload is of type: String (org.mule.api.MessagingException)
org.mule.twitter.config.SendDirectMessageByScreenNameMessageProcessor:340 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
twitter4j.internal.org.json.JSONException: JSONObject["sender"] not found.
at twitter4j.internal.org.json.JSONObject.get(JSONObject.java:461)
at twitter4j.internal.org.json.JSONObject.getJSONObject(JSONObject.java:560)
at twitter4j.DirectMessageJSONImpl.init(DirectMessageJSONImpl.java:71)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

This is the error I get in the HTTP response:

Failed to invoke sendDirectMessageByScreenName. Message payload is of type: String