Попросил оценить покупку Mulesoft - и создать демоверсию, которая подключается к facebook. Am после двух образцов здесь:
https://github.com/mulesoft/facebook-connector/blob/master/doc/sample.md и http://blogs.mulesoft.com/mule-school-integration-with-social-media-part-ii-%E2%80%93-facebook/Mule Facebook Null Полезная нагрузка
Столкнулись с проблемой с первым образцом - это не будет компилироваться, так как конечная точка для соединителя HTTP была таким же, как разъем facebook. Я сделал некоторые исследования и внес некоторые изменения, но теперь я получил ошибку ниже и не могу найти кого-либо еще, кто испытал то же самое:
Не удалось получить токен доступа. Message payload is of type: NullPayload
- это на странице обратного вызова. Кто-нибудь испытал это?
Вот мой код:
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8099" doc:name="HTTP Listener Configuration"/>
<facebook:config-with-oauth name="Facebook-config" consumerKey="..." consumerSecret="..." scope="user_photos" doc:name="Facebook">
<facebook:oauth-callback-config domain="localhost" localPort="8099" remotePort="8099" path="callback"/>
</facebook:config-with-oauth>
<http:listener-config name="HTTP_Listener_Configuration1" host="localhost" port="8094" doc:name="HTTP Listener Configuration"/>
<flow name="Authorize">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<facebook:authorize config-ref="Facebook-config" doc:name="Facebook"/>
<set-session-variable variableName="accessTokenID" value="#[flowVars['OAuthAccessTokenId']]" doc:name="Save Access Token"/>
<flow-ref name="PhotoDownload" doc:name="Call Photo Download"/>
</flow>
<flow name="PhotoDownload">
<http:listener config-ref="HTTP_Listener_Configuration1" path="/" doc:name="HTTP"/>
<not-filter doc:name="Not">
<wildcard-filter pattern="/favicon.ico" caseSensitive="false"/>
</not-filter>
<facebook:get-user-picture config-ref="Facebook-config" user="me" accessTokenId="#[sessionVars['accessTokenId']]" doc:name="Get Profile Picture"/>
<file:outbound-endpoint path="c:\temp" outputPattern="profilepic.jpg" responseTimeout="10000" doc:name="Save The Picture "/>
<json:object-to-json-transformer doc:name="Object to JSON"/>
</flow>
Вот трассировки стека:
ERROR 2015-06-10 13:47:07,731 [[internalfacebook].HTTP_Listener_Configuration.worker.01] org mule exception DefaultMessagingExceptionStrategy: ******************************************************************************** Message : Unable to fetch access token. Message payload is of type: NullPayload Code : MULE_ERROR--2 -------------------------------------------------------------------------------- Exception stack is: 1. unable to find valid certification path to requested target (sun.security.provider.certpath.SunCertPathBuilderException) sun.security.provider.certpath SunCertPathBuilder:-1 (null) 2. PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (sun.security.validator ValidatorException) sun.security.validator PKIXValidator:-1 (null) 3. sun.security.validator ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (javax net ssl SSLHandshakeException) sun security ssl Alerts:-1 (java.sun com/j2ee/sdk_1.3/techdocs/api/javax/net/ssl/SSLHandshakeException html) 4. Error found while consuming http resource at https(colonslashslash) graph facebook com/oauth/access_token (java.lang.RuntimeException) org.mule security oauth util HttpUtilImpl:93 (null) 5. Unable to fetch access token. Message payload is of type: NullPayload (org mule api MessagingException) org.mule.security.oauth.processor.OAuth2FetchAccessTokenMessageProcessor:95 (wwwmulesoftrog docs site current3 apidocs org mule api MessagingException html) -------------------------------------------------------------------------------- Root Exception stack trace: sun.security.provider certpath SunCertPathBuilderException: unable to find valid certification path to requested target at sun security provider certpath SunCertPathBuilder engineBuild(Unknown Source) at java.security cert CertPathBuilder build(Unknown Source) at sun.security validator PKIXValidator doBuild(Unknown Source) + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything) ******************************************************************************** INFO 2015-06-10 13:47:08,183 [[internalfacebook].HTTP_Listener_Configuration.worker.01] org mule module http internal listener HttpListenerRegistry: No listener found for request: (GET)/favicon ico INFO 2015-06-10 13:47:08,184 [[internalfacebook].HTTP_Listener_Configuration.worker.01] org mule module http internal listener HttpListenerRegistry: Available listeners are: [(*)/callback/, (*)/]
Можете ли вы показать полную трассировку стека? –
@DavidDossot - Спасибо - добавлена трассировка стека - пришлось немного поработать - не могли включить больше URL-адресов – Connie
@DavidDossot - еще раз спасибо! – Connie