Author: rgardler
Date: Tue Dec 13 11:30:30 2005
New Revision: 356582
URL: http://svn.apache.org/viewcvs?rev=356582&view=rev
Log:
Improve logging:
- only report failure to find a location after querying all locationmaps
- report error if locationmap not loaded corectly
Modified:
forrest/trunk/main/java/org/apache/forrest/locationmap/LocationMapModule.java
forrest/trunk/main/java/org/apache/forrest/locationmap/lm/LocationMap.java
forrest/trunk/main/java/org/apache/forrest/locationmap/lm/SelectNode.java
Modified:
forrest/trunk/main/java/org/apache/forrest/locationmap/LocationMapModule.java
URL:
http://svn.apache.org/viewcvs/forrest/trunk/main/java/org/apache/forrest/locationmap/LocationMapModule.java?rev=356582&r1=356581&r2=356582&view=diff
==============================================================================
---
forrest/trunk/main/java/org/apache/forrest/locationmap/LocationMapModule.java
(original)
+++
forrest/trunk/main/java/org/apache/forrest/locationmap/LocationMapModule.java
Tue Dec 13 11:30:30 2005
@@ -187,6 +187,13 @@
}
}
}
+
+ if (result == null) {
+ String msg = "Locationmap did not return a location for hint " +
name;
+ getLogger().error(msg);
+ throw new Exception(msg);
+ }
+
return result;
}
catch (ConfigurationException e) {
Modified:
forrest/trunk/main/java/org/apache/forrest/locationmap/lm/LocationMap.java
URL:
http://svn.apache.org/viewcvs/forrest/trunk/main/java/org/apache/forrest/locationmap/lm/LocationMap.java?rev=356582&r1=356581&r2=356582&view=diff
==============================================================================
--- forrest/trunk/main/java/org/apache/forrest/locationmap/lm/LocationMap.java
(original)
+++ forrest/trunk/main/java/org/apache/forrest/locationmap/lm/LocationMap.java
Tue Dec 13 11:30:30 2005
@@ -112,7 +112,6 @@
/** list of MountNodes */
private MountNode[] m_mountNodes;
-
public LocationMap(ServiceManager manager) {
m_manager = new LocationMapServiceManager(manager);
@@ -282,14 +281,8 @@
}
ContainerUtil.dispose(context);
-
- if (location == null) {
- String msg = "No Location returned for hint " + hint;
- getLogger().error(msg);;
- throw new Exception(msg);
- }
- if (location.startsWith("http:")) {
+ if (location != null && location.startsWith("http:")) {
location.replaceAll(" ", "%20");
}
Modified:
forrest/trunk/main/java/org/apache/forrest/locationmap/lm/SelectNode.java
URL:
http://svn.apache.org/viewcvs/forrest/trunk/main/java/org/apache/forrest/locationmap/lm/SelectNode.java?rev=356582&r1=356581&r2=356582&view=diff
==============================================================================
--- forrest/trunk/main/java/org/apache/forrest/locationmap/lm/SelectNode.java
(original)
+++ forrest/trunk/main/java/org/apache/forrest/locationmap/lm/SelectNode.java
Tue Dec 13 11:30:30 2005
@@ -115,7 +115,7 @@
debug("Not selected: " + location);
}
} catch (ConfigurationException e) {
- debug("Ignoring locationmap config exception: " +
e.getMessage());
+ getLogger().error("Ignoring locationmap config exception: " +
e.getMessage(), e);
}
}