Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2185500 | 7 | Joe Wang | P3 | Closed | Fixed | m05 |
JDK-2176330 | 6u14 | Vladislav Karnaukhov | P3 | Resolved | Fixed | b05 |
JDK-2174009 | 6u13-rev | Vladislav Karnaukhov | P3 | Resolved | Fixed | b06 |
JDK-2174010 | 5.0-pool | Vladislav Karnaukhov | P3 | Closed | Not an Issue |
FULL PRODUCT VERSION :
c:\>java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Windows XP SP2
A DESCRIPTION OF THE PROBLEM :
When trying to parse an XML file, a java.net.MalformedURLException is thrown if there is a space anywhere within the full path file name.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a folder on the hard drive named "space error" ( note the space in the name ) and put a valid xml file in the folder. run the program.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Exception
ACTUAL -
Exception
ERROR MESSAGES/STACK TRACES THAT OCCUR :
unknown protocol: c
java.net.MalformedURLException: unknown protocol: c
at java.net.URL.<init>(URL.java:574)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:650)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1132)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:533)
at test.main(test.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import org.xml.sax.XMLReader;
import javax.xml.parsers.*;
public class test
{
public static void main(String[] arfgs)
{
try
{
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
SAXParser jaxpParser = factory.newSAXParser();
XMLReader reader = jaxpParser.getXMLReader();
reader.parse("C:/space error/x.xml");
System.exit(0);
}
catch(Exception e)
{
System.out.println(e.getMessage());
e.printStackTrace();
System.exit(16);
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
use prior version or include a J2EE jar file in your class path.
c:\>java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Windows XP SP2
A DESCRIPTION OF THE PROBLEM :
When trying to parse an XML file, a java.net.MalformedURLException is thrown if there is a space anywhere within the full path file name.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a folder on the hard drive named "space error" ( note the space in the name ) and put a valid xml file in the folder. run the program.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Exception
ACTUAL -
Exception
ERROR MESSAGES/STACK TRACES THAT OCCUR :
unknown protocol: c
java.net.MalformedURLException: unknown protocol: c
at java.net.URL.<init>(URL.java:574)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:650)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1132)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:533)
at test.main(test.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import org.xml.sax.XMLReader;
import javax.xml.parsers.*;
public class test
{
public static void main(String[] arfgs)
{
try
{
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(true);
SAXParser jaxpParser = factory.newSAXParser();
XMLReader reader = jaxpParser.getXMLReader();
reader.parse("C:/space error/x.xml");
System.exit(0);
}
catch(Exception e)
{
System.out.println(e.getMessage());
e.printStackTrace();
System.exit(16);
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
use prior version or include a J2EE jar file in your class path.
- backported by
-
JDK-2174009 java.net.MalformedURLException: unknown protocol: c
- Resolved
-
JDK-2176330 java.net.MalformedURLException: unknown protocol: c
- Resolved
-
JDK-2174010 java.net.MalformedURLException: unknown protocol: c
- Closed
-
JDK-2185500 java.net.MalformedURLException: unknown protocol: c
- Closed