Author: bdaw
Date: 2007-09-05 09:39:15 -0400 (Wed, 05 Sep 2007)
New Revision: 8176
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java
Log:
JBPORTAL-1572 - gadgets directory read failed due to timeout - unable to read category
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java 2007-09-05
12:54:43 UTC (rev 8175)
+++
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGProvider.java 2007-09-05
13:39:15 UTC (rev 8176)
@@ -150,11 +150,16 @@
//
GGQueryEntry tmp = new GGQueryEntry(query);
GGQueryEntry entry = (GGQueryEntry)searches.putIfAbsent(query, tmp);
- if (entry == null)
+
+
+ // Check if query wasn't performed yet or if it is empty (probably failed)
+
+ if (entry == null || !entry.getResult().entries().hasNext())
{
entry = tmp;
entry.retrieve();
}
+
GGQueryResult result = entry.getResult();
//
Modified:
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java 2007-09-05
12:54:43 UTC (rev 8175)
+++
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java 2007-09-05
13:39:15 UTC (rev 8176)
@@ -40,6 +40,7 @@
import javax.xml.parsers.DocumentBuilder;
import java.net.URL;
import java.net.MalformedURLException;
+import java.net.SocketTimeoutException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Collections;
@@ -140,9 +141,13 @@
//
return new GGQueryResult(entries);
}
+ catch (SocketTimeoutException e)
+ {
+ log.error("Query for google gadgets in directory failed due to timeout. Try
to increase connectionTimeout initial parameter; ", e);
+ }
catch (Exception e)
{
- e.printStackTrace();
+ log.error("Gadgets query failed: ", e);
}
//
Show replies by date