raphael 2002/12/11 06:16:01
Modified: src/java/org/apache/jetspeed/services/registry
CastorRegistryService.java RegistryWatcher.java
Log:
Tentative workaround patch for bug #14917 & #15265:
Xerces does not handle correctly file paths on some platforms (Novell),
change parameter to a suitable URL using Vadim's patch.
Revision Changes Path
1.28 +32 -3
jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/CastorRegistryService.java
Index: CastorRegistryService.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/CastorRegistryService.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- CastorRegistryService.java 17 Nov 2002 03:05:41 -0000 1.27
+++ CastorRegistryService.java 11 Dec 2002 14:16:01 -0000 1.28
@@ -133,7 +133,7 @@
public static final int DEFAULT_VERBOSE = 0;
public static final int DEFAULT_REFRESH = 300;
public static final String DEFAULT_EXTENSION = ".xreg";
- public static final String DEFAULT_MAPPING =
"${webappRoot}/WEB-INF/conf/mapping.xml";
+ public static final String DEFAULT_MAPPING =
"${webapp}/WEB-INF/conf/mapping.xml";
/** controls amount of debug output, the bigger the more output will be
generated */
private int verbose = DEFAULT_VERBOSE;
@@ -595,7 +595,36 @@
{
DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = dbfactory.newDocumentBuilder();
-
+
+ //Bug fix for #14917, workaround xerces sloppy file -> URL translation
+ // Thanks to vadim for the workaround
+ java.net.URL url = null;
+ try
+ {
+ if (file.indexOf(':') > 1)
+ {
+ url = new java.net.URL(file);
+ }
+ else
+ {
+ url = new File(file).toURL();
+ }
+ }
+ catch (java.net.MalformedURLException me)
+ {
+ // VG: Novell has absolute file names starting with the
+ // volume name which is easily more then one letter.
+ // Examples: sys:/apache/cocoon or sys:\apache\cocoon
+ try
+ {
+ url = new File(file).toURL();
+ }
+ catch (java.net.MalformedURLException ignored)
+ {
+ Log.error("RegistryService: Unable to determine URL.", me);
+ }
+ }
+
Document d = builder.parse(file);
Unmarshaller unmarshaller = new Unmarshaller(this.mapping);
1.8 +2 -2
jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/RegistryWatcher.java
Index: RegistryWatcher.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/RegistryWatcher.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- RegistryWatcher.java 6 Nov 2002 00:00:24 -0000 1.7
+++ RegistryWatcher.java 11 Dec 2002 14:16:01 -0000 1.8
@@ -73,7 +73,7 @@
{
/** Minimum scan rate for evaluating file refresh */
- public static final int SCAN_RATE = 60;
+ public static final int SCAN_RATE = 10;
/**
The files monitored by this watcher
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>