Re: malformed URL exception exception in saxbuilder.build due to unreachable URL
cliff palmer <[email protected]>
| Newsgroups | gmane.comp.java.jdom.general |
|---|---|
| Message-ID | <CABhr9StUYXgPSDGBjU40ucq7iuyVuLLXC+MFDEDhTb=wvMEsbw@mail.gmail.com> |
Thanks Oliver - I don't need access to the unreachable/malformed URL, I just need to instantiate the XML that is there so I can step through it and determine what tags are there. Is there a way to tell JDOM to ignore external references and not be concerned about URLs ? Thanks Cliff On Thu, Feb 9, 2012 at 5:08 PM, Oliver Ruebenacker <[email protected]> wrote: > Hello, > > I don't know anything about SAX, but the error says the problem is > not an unreachable URL, but a malformed one. Somehow, it seems to try > to use "<?xml version="1.0"?>" as an URL. Apparently, the content of > an XML file (or the first line of it) is used where a URL should be > used. > > Take care > Oliver > > On Thu, Feb 9, 2012 at 4:31 PM, cliff palmer <[email protected]> wrote: >> I don't believe this is a DTD problem - no DTD is referenced. >> This is the stack trace: >> at java.net.URL.<init>(URL.java:567) >> 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:772) >> 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:119) >> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) >> at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) >> at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518) >> at org.jdom.input.SAXBuilder.build(SAXBuilder.java:986) >> at com.dt.XMLUtility.ProfileXMLAttributes.process(ProfileXMLAttributes.java:162) >> at com.dt.XMLUtility.main.main(main.java:22) >> java.io.FileNotFoundException: >> /home/cpalmer/workspace/ProfileXMLAttributes/< (No such file or >> directory) >> at java.io.FileInputStream.open(Native Method) >> at java.io.FileInputStream.<init>(FileInputStream.java:120) >> at java.io.FileInputStream.<init>(FileInputStream.java:79) >> at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70) >> at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161) >> at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:653) >> 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:772) >> 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:119) >> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) >> at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) >> at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518) >> at org.jdom.input.SAXBuilder.build(SAXBuilder.java:986) >> at com.dt.XMLUtility.ProfileXMLAttributes.process(ProfileXMLAttributes.java:162) >> at com.dt.XMLUtility.main.main(main.java:22) >> java.net.MalformedURLException: no protocol: <?xml version="1.0"?> >> >> Thanks >> Cliff >> >> On 2/9/12, Paul Libbrecht <[email protected]> wrote: >>> Cliff, >>> >>> this doesn't sound reasonable to me. I have never seen code doing such and >>> would not expect it (I also run jdom offline quite often). >>> >>> Could it be the DTD is hitting you? >>> Can you copy a full stacktrace? >>> >>> thanks in advance >>> >>> Paul >>> >>> >>> Le 9 févr. 2012 à 21:54, cliff palmer a écrit : >>> >>>> I'm reading through several hundred thousand existing XML documents >>>> building counts of XML tags and have encountered a >>>> Java.net.MalformedURL Exception raised by saxBuilder.build because the >>>> xmlns points to a URL that can not be reached. >>>> I am using JDOM 1.1.2. >>>> Is there a call or parameter setting that will cause saxBuilder to >>>> ignore namespaces when parsing? >>>> Thanks! >>>> Cliff >>>> _______________________________________________ >>>> To control your jdom-interest membership: >>>> http://www.jdom.org/mailman/options/jdom-interest/[email protected] >>> >>> >> >> _______________________________________________ >> To control your jdom-interest membership: >> http://www.jdom.org/mailman/options/jdom-interest/[email protected] > > > > -- > Oliver Ruebenacker, Computational Cell Biologist > Virtual Cell (http://vcell.org) > SBPAX: Turning Bio Knowledge into Math Models (http://www.sbpax.org) > http://www.oliver.curiousworld.org _______________________________________________ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/[email protected]