How to get twitter screenname on mule - twitter

I want to send a tweet with mule but I get a NullPointerException on the #[payload.user.screenName], how can I get the screenName??and all the other ways neither worked
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:twitter="http://www.mulesoft.org/schema/mule/twitter" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/twitter http://www.mulesoft.org/schema/mule/twitter/current/mule-twitter.xsd">
<http:request-config name="HTTP_Request_Configuration" host="api.openweathermap.org" port="80" basePath="data/2.5/weather?q=Cadiz,es&APPID=mykey" doc:name="HTTP Request Configuration"/>
<twitter:config name="Twitter" accessKey="${twitter.accessKey}" accessSecret="${twitter.accessSecret}" consumerKey="${twitter.consumerKey}" consumerSecret="${twitter.consumerSecret}" doc:name="Twitter"/>
<flow name="pruebaFlow">
<poll doc:name="Poll">
<fixed-frequency-scheduler frequency="10000"/>
<http:request config-ref="HTTP_Request_Configuration" path="/" method="GET" doc:name="HTTP"/>
</poll>
<byte-array-to-string-transformer doc:name="Byte Array to String"/>
<echo-component doc:name="Echo"/>
<twitter:show-user config-ref="Twitter" doc:name="Twitter"/>
<twitter:send-direct-message-by-screen-name config-ref="Twitter" message="#[header.INBOUND:message]" screenName="#[payload.user.screenName]" doc:name="Twitter"/>
</flow>
</mule>
And this is the stracktrace
Exception stack is:
1. null (java.lang.NullPointerException)
org.mule.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer:363 (null)
2. [Error: null pointer: payload.user.screenName]
[Near : {... payload.user.screenName ....}]
^
[Line: 1, Column: 1] (org.mule.mvel2.PropertyAccessException)
org.mule.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer:434 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/mvel2/PropertyAccessException.html)
3. Execution of the expression "payload.user.screenName" failed. (org.mule.api.expression.ExpressionRuntimeException)
org.mule.el.mvel.MVELExpressionLanguage:202 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/expression/ExpressionRuntimeException.html)
4. Failed to invoke sendDirectMessageByScreenName. Message payload is of type: UserJSONImpl (org.mule.api.MessagingException)
org.mule.devkit.processor.DevkitBasedMessageProcessor:128 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.lang.NullPointerException
at org.mule.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:363)
at org.mule.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:140)
at org.mule.mvel2.ast.ASTNode.optimize(ASTNode.java:159)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
and now I have a new error this
RROR 2015-03-31 22:36:55,067 [[prueba].HTTP_Listener_Configuration.worker.01] org.mule.retry.notifiers.ConnectNotifier: Failed to connect/reconnect: Work Descriptor. Root Exception was: 401 response received, but no WWW-Authenticate header was present. Type: class java.lang.IllegalStateException
ERROR 2015-03-31 22:36:55,075 [[prueba].HTTP_Listener_Configuration.worker.01] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Error sending HTTP request. Message payload is of type: MuleHttpClient$1
Code : MULE_ERROR-29999
--------------------------------------------------------------------------------
Exception stack is:
1. 401 response received, but no WWW-Authenticate header was present (java.lang.IllegalStateException)
com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$AsyncHttpClientEventFilter$AuthorizationHandler:1623 (null)
2. java.lang.IllegalStateException: 401 response received, but no WWW-Authenticate header was present (java.util.concurrent.ExecutionException)
org.glassfish.grizzly.impl.SafeFutureImpl$Sync:363 (null)
3. java.util.concurrent.ExecutionException: java.lang.IllegalStateException: 401 response received, but no WWW-Authenticate header was present (java.io.IOException)
org.mule.module.http.internal.request.grizzly.GrizzlyHttpClient:282 (null)
4. Error sending HTTP request. Message payload is of type: MuleHttpClient$1 (org.mule.api.MessagingException)
org.mule.module.http.internal.request.DefaultHttpRequester:190 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.lang.IllegalStateException: 401 response received, but no WWW-Authenticate header was present
at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$AsyncHttpClientEventFilter$AuthorizationHandler.handleStatus(GrizzlyAsyncHttpProvider.java:1623)
at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$AsyncHttpClientEventFilter.onHttpHeadersParsed(GrizzlyAsyncHttpProvider.java:1422)
at org.glassfish.grizzly.http.HttpCodecFilter.decodeHttpPacketFromBytes(HttpCodecFilter.java:664)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

Related

Unable to fetch access token mule <-> salesforce

I am stuck in something which i thought it is gonna be a very easy one.
I am trying to setup a Mule flow to connect with Salesforce and get OAUTH token.
<flow>
<sfdc:config-with-oauth consumerKey="thatgirliscute" consumerSecret="nosheishOT" doc:name="Salesforce (OAuth)" name="Salesforce__OAuth_" connectionTimeout="10000" readTimeout="10000">
<sfdc:oauth-callback-config domain="localhost" localPort="8081" path="callback"/>
</sfdc:config-with-oauth>
<flow name="salesforce-oauthFlow1" doc:name="salesforce-oauthFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"/>
<sfdc:authorize accessTokenUrl="https://login.salesforce.com/services/oauth2/token" authorizationUrl="https://login.salesforce.com/services/oauth2/authorize" config-ref="Salesforce__OAuth_" display="PAGE" doc:name="Authorize at Salesforce"/>
</flow>
But I get an error message saying 'Unable to fetch access token. Message payload is of type: String'
Message : Unable to fetch access token. Message payload is of type: String
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Connection timed out: connect (java.net.ConnectException)
java.net.PlainSocketImpl:-2 (null)
2. Error found while consuming http resource at https://login.salesforce.com/services/oauth2/token (java.lang.RuntimeException)
org.mule.security.oauth.util.HttpUtilImpl:93 (null)
3. Unable to fetch access token. Message payload is of type: String (org.mule.api.MessagingException)
org.mule.security.oauth.processor.OAuth2FetchAccessTokenMessageProcessor:91 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.net.ConnectException: Connection timed out: connect
Any pointers to resolve is of great help. thanks
-- EDIT : I am behind a corporate firewall - does it matters ? But i am able to successfully do the basic authentication with Salesforce connector. Only OAuTH is leading to a problem.
When i type in localhost:8081 i get redirected to
https://ap1.salesforce.com/setup/secur/RemoteAccessAuthorizationPage.apexp?source=l86Hcy6qEKtWNqzXVErZDlmcRQs0D_HBE55Mqtm_Al6fTUPSfuQ%3D%3D&display=page&sdtd=1
and then redirected automatically to below URL with error 'Unable to fetch access token. Message payload is of type: String' in the browser and the console reads as i have posted above.
http://localhost:8081/callback?display=page&code=aPrxaSyVmC8fBbfefEfQB5xrKXrrRhK3DiVFrPu5ia0Q%3D%3D&state=%3C%3CMULE_EVENT_ID%3D0-546bdbb1-0095-11e5-9fcb-2c4138b080c9%3E%3E
This was a bug in Mule and the Salesforce Connector 6.2 resolves it.

Failed to invoke updateStatus. Message payload is of type: NullPayload on Mule Studio

I'm following this tutorial https://www.mulesoft.com/exchange#!/twitter-integration-connector and when i try tu send a tweet with updateStatus I get this message Failed to invoke updateStatus. Message payload is of type: NullPayload ,the show user action works but not the updateStatus
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:twitter="http://www.mulesoft.org/schema/mule/twitter" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/twitter http://www.mulesoft.org/schema/mule/twitter/current/mule-twitter.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
<twitter:config name="Twitter" accessKey="${twitter.accessKey}" accessSecret="${twitter.accessSecret}" consumerKey="${twitter.consumerKey}" consumerSecret="${twitter.consumerSecret}" streamBaseUrl="https://stream.twitter.com/1.1/" siteStreamBaseUrl="https://sitestream.twitter.com/1.1/" doc:name="Twitter"/>
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" basePath="updateStatus" doc:name="HTTP Listener Configuration"/>
<flow name="twitterFlow1">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<twitter:update-status config-ref="Twitter" status="Mensaje" doc:name="Twitter"/>
<json:object-to-json-transformer doc:name="Object to JSON"/>
</flow>
</mule>
and this is the stacktrace
Exception stack is:
1. 401 response received, but no WWW-Authenticate header was present (java.lang.IllegalStateException)
com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$AsyncHttpClientEventFilter$AuthorizationHandler:1623 (null)
2. java.lang.IllegalStateException: 401 response received, but no WWW-Authenticate header was present (java.util.concurrent.ExecutionException)
org.glassfish.grizzly.impl.SafeFutureImpl$Sync:363 (null)
3. java.util.concurrent.ExecutionException: java.lang.IllegalStateException: 401 response received, but no WWW-Authenticate header was present (java.io.IOException)
org.mule.module.http.internal.request.grizzly.GrizzlyHttpClient:282 (null)
4. Error sending HTTP request. Message payload is of type: MuleHttpClient$1 (org.mule.api.MessagingException)
org.mule.module.http.internal.request.DefaultHttpRequester:190 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
The twitter app has read,write and direct message permission ,but i'm not sure about the app website field.
It seems that there is an issue with WWW-authenticate header header in Mule 3.6.x.
I tried a basic twitter flow and it works on Mule 3.5 but not 3.6.
The reported issues are:
https://www.mulesoft.org/jira/browse/MULE-8282
https://www.mulesoft.org/jira/browse/MULE-8127
https://www.mulesoft.org/jira/browse/MULE-8249
I am following the same tutorial and have run into the same issue. I needed to update the default twitter connector with a new version 4 connector. The code then worked, however, it will only work once. To have it work again, I seem to need to change the status message and re-run - otherwise I get the null payload message again. Just stopping and starting the app doesn't seem to be good enough - I seem to need to change the status.

Failed to invoke updateStatus. Message payload is of type: NullPayload

Twitter example muleflow with Mule 3.6 EE, Twitter 3.2.0,
Twitter Access Level : Read, write, and direct messages
Here's what's in the shown console:
ERROR 2015-01-30 12:55:02,786 [[twitterdemo].HTTP_Listener_Configuration.worker.01] org.mule.retry.notifiers.ConnectNotifier: Failed to connect/reconnect: Work Descriptor. Root Exception was: 401 response received, but no WWW-Authenticate header was present. Type: class java.lang.IllegalStateException
ERROR 2015-01-30 12:55:02,793 [[twitterdemo].HTTP_Listener_Configuration.worker.01] org.mule.exception.DefaultMessagingExceptionStrategy:
Message : Error sending HTTP request. Message payload is of type: MuleHttpClient$1
Code : MULE_ERROR--2
Exception stack is:
1. 401 response received, but no WWW-Authenticate header was present (java.lang.IllegalStateException)
com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$AsyncHttpClientEventFilter$AuthorizationHandler:1623 (null)
2. java.lang.IllegalStateException: 401 response received, but no WWW-Authenticate header was present (java.util.concurrent.ExecutionException)
org.glassfish.grizzly.impl.SafeFutureImpl$Sync:363 (null)
3. java.util.concurrent.ExecutionException: java.lang.IllegalStateException: 401 response received, but no WWW-Authenticate header was present (java.io.IOException)
org.mule.module.http.internal.request.grizzly.GrizzlyHttpClient:282 (null)
4. Error sending HTTP request. Message payload is of type: MuleHttpClient$1 (org.mule.api.MessagingException)
org.mule.module.http.internal.request.DefaultHttpRequester:190 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
Root Exception stack trace:
java.lang.IllegalStateException: 401 response received, but no WWW-Authenticate header was present
at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$AsyncHttpClientEventFilter$AuthorizationHandler.handleStatus(GrizzlyAsyncHttpProvider.java:1623)
at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$AsyncHttpClientEventFilter.onHttpHeadersParsed(GrizzlyAsyncHttpProvider.java:1422)
at org.glassfish.grizzly.http.HttpCodecFilter.decodeHttpPacketFromBytes(HttpCodecFilter.java:664)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
It seems that there is an issue with WWW-authenticate header header in Mule 3.6.x.
I tried a basic twitter flow and it works on Mule 3.5 but not 3.6.
The reported issues are:
https://www.mulesoft.org/jira/browse/MULE-8282
https://www.mulesoft.org/jira/browse/MULE-8127
https://www.mulesoft.org/jira/browse/MULE-8249

ERROR "The accessTokenId cannot be null". how to config google calendar connector? Mule ESB

Im trying to use Calendars Connector, i have this configuration.
<google-calendars:config-with-oauth
name="Google_Calendars"
consumerKey="myKey"
consumerSecret="mySecretKey"
doc:name="Google Calendars"
applicationName="Football Organizer">
<google-calendars:oauth-callback-config
domain="localhost" localPort="8081" remotePort="8081" />
</google-calendars:config-with-oauth>
Then i have this flow, just to try adding a quick event
<flow name="calendarFlow1" doc:name="calendarFlow1">
<http:inbound-endpoint exchange-pattern="request-response"
host="localhost" port="8081" doc:name="HTTP"/>
<google-calendars:quick-add-event
config-ref="Google_Calendars"
calendarId="myCalendarPublicID#group.calendar.google.com"
doc:name="Google Calendars" text="Im a quick event!"/>
</flow>
When i send a request it throuws "Failed to invoke quickAddEvent. Message payload is of type: String"
Trace:
ERROR 2014-08-07 15:57:49,730 [[calendar].connector.http.mule.default.receiver.02] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Failed to invoke quickAddEvent. Message payload is of type: String
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. The accessTokenId cannot be null (java.lang.IllegalArgumentException)
org.mule.module.google.calendar.oauth.ManagedAccessTokenProcessInterceptor:46 (null)
2. Failed to invoke quickAddEvent. Message payload is of type: String (org.mule.api.MessagingException)
org.mule.module.google.calendar.processors.QuickAddEventMessageProcessor:153 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.lang.IllegalArgumentException: The accessTokenId cannot be null
at org.mule.module.google.calendar.oauth.ManagedAccessTokenProcessInterceptor.execute(ManagedAccessTokenProcessInterceptor.java:46)
at org.mule.module.google.calendar.oauth.ManagedAccessTokenProcessInterceptor.execute(ManagedAccessTokenProcessInterceptor.java:21)
at org.mule.module.google.calendar.oauth.ManagedAccessTokenProcessTemplate.execute(ManagedAccessTokenProcessTemplate.java:32)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
Thanks

Mule Box Connector - Invalid Key Type / Message payload is of type String

I'm trying to write a Mule flow that uses the Box connector. I'm able to go to http://localhost:8081/auth and authorize successfully. But as soon as I create a file in my box account I get "Failed to Invoke getEvents. Message payload is of type: String." and in the Root Exception Trace I get: "Invalid Key Type"
Mule Flow (based on: https://github.com/mulesoft/box-connector/blob/master/demo/src/main/app/box-connector-demo.xml)
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting"
xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:objectstore="http://www.mulesoft.org/schema/mule/objectstore" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:box="http://www.mulesoft.org/schema/mule/box" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="CE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/objectstore http://www.mulesoft.org/schema/mule/objectstore/1.0/mule-objectstore.xsd
http://www.mulesoft.org/schema/mule/box http://www.mulesoft.org/schema/mule/box/2.0/mule-box.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
<box:config name="Box" clientId="removed" clientSecret="removed" doc:name="Box">
<box:oauth-callback-config domain="localhost" localPort="8081" path="callback" remotePort="8081"/>
</box:config>
<objectstore:config name="ObjectStore" objectStore-ref="_defaultInMemoryObjectStore" doc:name="ObjectStore"/>
<flow name="Authorize" doc:name="Authorize">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP" path="auth"/>
<box:authorize config-ref="Box" doc:name="Authorize" />
</flow>
<flow name="longPolling" doc:name="longPolling">
<box:listen-events config-ref="Box" doc:name="Box (Streaming)"/>
<set-variable variableName="defaultValue" value="0" doc:name="Variable"/>
<objectstore:retrieve config-ref="ObjectStore" key="streamPosition" defaultValue-ref="#[flowVars['defaultValue']]" doc:name="ObjectStore"/>
<box:get-events config-ref="Box" streamPosition="#[payload]" accessTokenId="#[message.inboundProperties['boxAccessTokenId']]" doc:name="Box" />
<objectstore:store config-ref="ObjectStore" key="streamPosition" value-ref="#[payload.nextStreamPosition]" overwrite="true" doc:name="ObjectStore"/>
<scripting:transformer doc:name="Groovy">
<scripting:script engine="Groovy"><![CDATA[return payload.entries.findAll{it.eventType =='ITEM_DOWNLOAD' || it.eventType == 'ITEM_PREVIEW'}
]]></scripting:script>
</scripting:transformer>
<scripting:transformer doc:name="Groovy">
<scripting:script engine="Groovy"><![CDATA[return payload.findAll{it.source?.type == "file" && it.source?.parent.id == "0"}
]]></scripting:script>
</scripting:transformer>
<foreach doc:name="Foreach">
<logger message="Box user #[payload.createdBy.login] has seen the file #[payload.source.name]" level="ERROR" doc:name="Logger"/>
</foreach>
</flow>
</mule>
Here's the full error:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Started app 'boxtest' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
WARN 2014-02-06 10:00:35,607 [Box Long Polling thread for endpont http://2.realtime.services.box.net/subscribe?channel=removed&stream_type=all] org.mule.DefaultMuleMessage: setProperty(key, value) called with null value; removing key: boxAccessTokenId; please report the following stack trace to dev#mule.codehaus.org
java.lang.Throwable
at org.mule.DefaultMuleMessage.setProperty(DefaultMuleMessage.java:457)
at org.mule.DefaultMuleMessage.addProperties(DefaultMuleMessage.java:1249)
at org.mule.DefaultMuleMessage.<init>(DefaultMuleMessage.java:174)
at org.mule.modules.box.processors.AbstractListeningMessageProcessor.process(AbstractListeningMessageProcessor.java:76)
at org.mule.modules.box.lp.LongPollingClient$1.run(LongPollingClient.java:63)
at java.lang.Thread.run(Unknown Source)
ERROR 2014-02-06 10:00:35,823 [[boxtest].longPolling.stage1.02] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Failed to invoke getEvents. Message payload is of type: String
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Invalid key type (java.lang.RuntimeException)
org.mule.modules.box.oauth.BoxConnectorOAuthClientFactory:28 (null)
2. Failed to invoke getEvents. Message payload is of type: String (org.mule.api.MessagingException)
org.mule.modules.box.processors.GetEventsMessageProcessor:155 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.lang.RuntimeException: Invalid key type
at org.mule.modules.box.oauth.BoxConnectorOAuthClientFactory.makeObject(BoxConnectorOAuthClientFactory.java:28)
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1179)
at org.mule.modules.box.oauth.BoxConnectorOAuthManager.acquireAccessToken(BoxConnectorOAuthManager.java:339)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
This looks like a bug to me: box:get-events is supposed to use property boxAccessTokenId as authentication token, there is a warning that the property is not set due to a null value, and when I look at the source code for the BoxConnector class where the value is coming from, there is a reference to a private variable accessTokenIdentifier which is never set. I reported this to the Mule dev address.
...I have used the Box connector recently with both the Mule 3.x and 4.x runtimes. I was pleased with the ease of setup, once I understood what's needed.
I recommend giving either a try now.

Resources