Category Archives: apache-shindig

Apache Shindig: Services methods from the http://…../rpc endpoint could not be fetched. error occurred: org.apache.http.conn.ConnectTimeoutException

I have developed a web application which use Apache Shindig to handle gadgets.

If I run it in localhost this application works perfectly, but in a remote tomcat container (where the application starts with no errors), i'm getting the following error during the registration user:

SEVERE [http-nio-8080-exec-6] org.apache.shindig.gadgets.render.DefaultServiceFetcher.retrieveServices Services methods from the http://178.33.188.172:8080/rpc endpoint could not be fetched. The following error occurred: org.apache.http.conn.ConnectTimeoutException: Connect to 178.33.188.172:8080 timed out.

here the stack trace error:

INFO [http-nio-8080-exec-6] org.apache.shindig.gadgets.http.BasicHttpFetcher.fetch The following exception occurred when fetching http://178.33.188.172:8080/rpc?method=system.listMethods&st=default:5bkOnqt-jmOsiNw_gEQzU6iqzakw5TEXi3fzl8FWdxC5whiun4kp4LgFrWB7kUGj8F1C5jZoWuAV57spm6UGpgYtMec: 5,005 ms elapsed. 21-Oct-2015 09:50:42.594 INFO [http-nio-8080-exec-6] org.apache.shindig.gadgets.http.BasicHttpFetcher.fetch org.apache.http.conn.ConnectTimeoutException: Connect to 178.33.188.172:8080 timed out at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:129) at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180) at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:151) at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:125) at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:643) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:827) at org.apache.shindig.gadgets.http.BasicHttpFetcher.fetch(BasicHttpFetcher.java:359) at org.apache.shindig.gadgets.render.DefaultServiceFetcher.retrieveServices(DefaultServiceFetcher.java:164) at org.apache.shindig.gadgets.render.DefaultServiceFetcher.getServicesForContainer(DefaultServiceFetcher.java:135) at org.apache.shindig.gadgets.render.DefaultRpcServiceLookup$1.call(DefaultRpcServiceLookup.java:80) at org.apache.shindig.gadgets.render.DefaultRpcServiceLookup$1.call(DefaultRpcServiceLookup.java:78) at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4792) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3599) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2379) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2342) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2257) at com.google.common.cache.LocalCache.get(LocalCache.java:4000) at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4789) at org.apache.shindig.gadgets.render.DefaultRpcServiceLookup.getServicesFor(DefaultRpcServiceLookup.java:77) at org.apache.shindig.gadgets.config.OsapiServicesConfigContributor.addServicesConfig(OsapiServicesConfigContributor.java:69) at org.apache.shindig.gadgets.config.OsapiServicesConfigContributor.contribute(OsapiServicesConfigContributor.java:58) at org.apache.shindig.gadgets.config.DefaultConfigProcessor.contribute(DefaultConfigProcessor.java:84) at org.apache.shindig.gadgets.config.DefaultConfigProcessor.getConfig(DefaultConfigProcessor.java:74) at org.apache.shindig.gadgets.js.ConfigInjectionProcessor.process(ConfigInjectionProcessor.java:82) at org.apache.shindig.gadgets.js.DefaultJsProcessorRegistry.process(DefaultJsProcessorRegistry.java:56) at org.apache.shindig.gadgets.js.DefaultJsServingPipeline.execute(DefaultJsServingPipeline.java:41) at org.apache.shindig.gadgets.servlet.JsServlet.doGet(JsServlet.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.shindig.gadgets.servlet.ETagFilter.doFilter(ETagFilter.java:56) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.shindig.common.servlet.HostFilter.doFilter(HostFilter.java:38) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

I don't understand why my application cannot fetch that url...through browser i get a JSON data (until token is not expired) like this:

{"result":["samplecontainer.update","activities.supportedFields","gadgets.metadata","albums.supportedFields","gadgets.proxySupportedFields","albums.get","mediaItems.create","http.put","system.listMethods","gadgets.proxy","gadgets.cajole","http.head","messages.create","albums.delete","mediaItems.update","messages.delete","gadgets.js","appdata.update","http.post","gadgets.tokenSupportedFields","samplecontainer.create","http.get","appdata.delete","appdata.create","gadgets.supportedFields","mediaItems.get","activities.update","activities.delete","albums.update","activities.get","messages.modify","activitystreams.create","appdata.get","messages.get","samplecontainer.get","cache.invalidate","people.supportedFields","groups.get","http.delete","gadgets.jsSupportedFields","people.get","activitystreams.get","mediaItems.supportedFields","mediaItems.delete","activitystreams.update","gadgets.cajaSupportedFields","activities.create","albums.create","people.update","gadgets.token","activitystreams.delete","activitystreams.supportedFields"]}

For sake of completeness, here you can find the shindig.properties file i'm using.

Any ideas?

Apache Tomcat with Mod_JK URL decoding issue

I am using apache tomcat with mod_jk and running shindig on it. i am trying to pass the below url to it

http://download.finance.yahoo.com/d/quotes.csv?s=^GSPTSE+^SPCDNX+MIC.TO+ABX.TO+AEM.TO&f=snl1d1t1c1&e=.csv&random=5683

and it fails giving error 400 (Invalid url parameter)

if i pass the url without any parameter it works perfectly fine.

you can have look at consol log for below url

http://portaltab.com/shindig/gadgets/ifr?url=http://igstock.googlecode.com/svn/trunk/modules/canada_stock_market_on_ig.xml

i tried so many things, but no luck. i am not sure whether it is tomcat issue or something else.

if any expert experience the same issue could you please share some info.

Thank you.

Regards, Raj