A developer, who recently started integrating IBM Connections with his business process was stuck with a strange issue. His project enabled a user, using the IBM Social Business Toolkit SDK, to post an update to the Activity Stream. The post failed while testing – a clear issue.
com.ibm.sbt.services.client.ClientServicesException: Request to url https://demo.sdkdemo.com/connections/opensocial/oauth/rest/activitystreams/@me/@friends/@all?rollup=true&lang=en returned an error response 404:Not Found HTTP/1.1 404 Not Found [Date: Sat, 19 Apr 2014 09:09:03 GMT, Content-Length: 265, Content-Type: text/html; charset=iso-8859-1, Cache-Control: proxy-revalidate, Connection: Keep-Alive]
There is a subtle problem – HTTP Code 404. The 404 means that the service is not found, not available or not located at that first component of the URL.
In this particular case, the IBM Connections server had custom ServiceMappings as defined in his LotusConnections-config.xml. You should find these files in the Application Server and Deployment Manager profiles, such as /local/conx/opt/IBM/WebSphere/AppServer/profiles/CONX/config/cells/quickstartmasterProxyCell/LotusConnections-config/LotusConnections-config.xml … You should keep in mind that the Deployment Manager overrides the Application Server profile.
Note, scan down to serviceReferece with with serviceName opensocial the hrefPathPrefix is /connections/opensocial . In the case of this developer, his hrefPathPrefix was /commons/opensocial. You can look through and check for any of the services which are changed. You can also check for these changes by navigating through your Applications menu when you login into IBM Connections. (For ActivityStreams, you can look for Feeds).
Note, the Homepage serviceName is mapped to Homepage
Or look for the feed icon, and you can parse the link – https://demo.sdkdemo.com/common/opensocial/basic/rest/activitystreams/@me/@all/@all
You see that the first component in the URL is common, not the standard connections.
Now you know why the request failed, the developed application was calling the wrong URL – connections versus commons. Now you are going to learn more about the managed-beans.xml file, and how the IBM Social Business Toolkit SDK can call the new hrefPathPrefix – /commons/opensocial
For simplicity, I am going to show you how to modify the sbt.sample.web in your Apache Tomcat instance.
Navigate to webapps/sbt.sample.web/WEB-INF
Open the file managed-beans.xml (you should have previously configured the sbt.properties file)
Scroll Down to the Connections Basic Endpoint, and add
connections is now mapped to common
you can repeat this for any service, just match it to your hrefPathPrefix.
* You may have to restart your Tomcat instance to get the mapping updated.
You now see your code working without issue.
Best wishes with further development.