title: java.net.MalformedURLException: no protocol with javax.xml.stream.XMLStreamException while using JAXB
body: <p>I am using JAXB to unmarshal an XML document. While parsing the XML it is throwing a MalformedURLException wrapped with XMLStreamException. What I understand is while creating the XMLStreamReader object itself it is throwing the exception. Any suggestions please?</p>
  
  <p>The code snippet I am using:</p>
  
  <pre><code>    XMLInputFactory xif = XMLInputFactory.newFactory();      
      XMLResolver resolver = new XMLResolver(); //to capture systemID, base URI etc.
      xif.setXMLResolver(resolver);
  
      //Throws MalformedURLException  while processing the below line
      XMLStreamReader xsr = xif.createXMLStreamReader(new StreamSource(fileToProcess));
  
      JAXBContext jaxbContext = JAXBContext.newInstance(MyPackage.MyClassName.class);
  </code></pre>
  
  <p>Here is the exception trace:</p>
  
  <pre><code>     class javax.xml.stream.XMLStreamException
       javax.xml.stream.XMLStreamException: java.net.MalformedURLException: no protocol:       [XML_FILEPATH/XML_FILE_NAME]
  </code></pre>
  
  <p><strong>fileToProcess</strong> is a string that contains absolute path, like /home/project/input/myproject.xml</p>
  
  <p>Run time JDK is 1.7. Any signature/protocol I am missing?</p>
  
  <p>Thanks,
  Bhaskar</p>