"File separator problem on Windows"
-----------------------------------
Key: HBASE-1063
URL: https://issues.apache.org/jira/browse/HBASE-1063
Project: Hadoop HBase
Issue Type: Bug
Reporter: stack
Fix For: 0.19.0
>From the list:
{code}
Hi,
When I tried to run the latest version from SVN, HBase always ended up in a
busy loop, and there were log messages like "java.io.FileNotFoundException:
file:/C:/Hadoop/hbase-0.19-dev/webapps%5/static".
Finally, I found the reason in
org.apache.hadoop.hbase.util.InfoServer.getWebAppDir() where the file separator
'\' is used under Windows, which is then converted to '%5c' by
ClassLoader.getResource(). Just using the normal slash '/' works fine.
Best,
Max
This is the patch solving the problem for me:
### Eclipse Workspace Patch 1.0
#P HBase
Index: src/java/org/apache/hadoop/hbase/util/InfoServer.java
===================================================================
--- src/java/org/apache/hadoop/hbase/util/InfoServer.java (revision 725566)
+++ src/java/org/apache/hadoop/hbase/util/InfoServer.java (working copy)
@@ -17,8 +17,6 @@
*/
package org.apache.hadoop.hbase.util;
-import java.io.File;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
@@ -101,12 +99,7 @@
public static String getWebAppDir(final String webappName)
throws IOException {
String webappDir = null;
- try {
- webappDir = getWebAppsPath("webapps" + File.separator + webappName);
- } catch (FileNotFoundException e) {
- // Retry. Resource may be inside jar on a windows machine.
- webappDir = getWebAppsPath("webapps/" + webappName);
- }
+ webappDir = getWebAppsPath("webapps/" + webappName);
return webappDir;
}
}
{code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.