Daniel Lowe
2009-10-26 13:42:33 UTC
The problem I am encountering is introduced somewhere between revision
1.82 of Builder.java (this corresponds to XOM-1.1) and 1.86 (this
corresponds to XOM-1.2b1) with my hunch being that the cause of the
problem in the change to canonicalizeURL in 1.86.
The error is below:
C:\My Documents\workspace\xomTest\target>java -jar
xomTest-0.0.1-SNAPSHOT-jar-with-dependencies.jar
Exception in thread "main" java.net.MalformedURLException: invalid url:
//file:/C:/My%20Documents/workspace/xomTest/target/xomTest-0.0.1-SNAPSHOT-jar-with-dependencies.jar!/foo/foo.xml
(java.net.MalformedURLException: no protocol:
//file:/C:/My%20Documents/workspace/xomTest/target/xomTest-0.0.1-SNAPSHOT-jar-with-dependencies.jar)
encies.jar)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrent
Entity(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(
Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDocumen
tEntity(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.setInp
utSource(Unknown Source)
at
com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(Unk
nown Source)
at
com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(Unk
nown Source)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown So
urce)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Un
known Source)
at nu.xom.Builder.build(Unknown Source)
at nu.xom.Builder.build(Unknown Source)
at foo.App.openFile(App.java:27)
at foo.App.main(App.java:20)
This occurs when doing new Builder().build(u.toString()); where u is a
URL pointing to a file within the jar that the program is running from.
The exact same code works from within my IDE, when the resource has not
yet been placed in a jar.
If you would like to see my test code you can download it from:
http://senduit.com/8f7faf
To reiterate this error only occurs on Xom1.2beta and later; the code
works fine on Xom-1.1.
Thanks for your help,
Daniel
1.82 of Builder.java (this corresponds to XOM-1.1) and 1.86 (this
corresponds to XOM-1.2b1) with my hunch being that the cause of the
problem in the change to canonicalizeURL in 1.86.
The error is below:
C:\My Documents\workspace\xomTest\target>java -jar
xomTest-0.0.1-SNAPSHOT-jar-with-dependencies.jar
Exception in thread "main" java.net.MalformedURLException: invalid url:
//file:/C:/My%20Documents/workspace/xomTest/target/xomTest-0.0.1-SNAPSHOT-jar-with-dependencies.jar!/foo/foo.xml
(java.net.MalformedURLException: no protocol:
//file:/C:/My%20Documents/workspace/xomTest/target/xomTest-0.0.1-SNAPSHOT-jar-with-dependencies.jar)
encies.jar)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrent
Entity(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(
Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDocumen
tEntity(Unknown Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.setInp
utSource(Unknown Source)
at
com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(Unk
nown Source)
at
com.sun.org.apache.xerces.internal.parsers.DTDConfiguration.parse(Unk
nown Source)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown So
urce)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Un
known Source)
at nu.xom.Builder.build(Unknown Source)
at nu.xom.Builder.build(Unknown Source)
at foo.App.openFile(App.java:27)
at foo.App.main(App.java:20)
This occurs when doing new Builder().build(u.toString()); where u is a
URL pointing to a file within the jar that the program is running from.
The exact same code works from within my IDE, when the resource has not
yet been placed in a jar.
If you would like to see my test code you can download it from:
http://senduit.com/8f7faf
To reiterate this error only occurs on Xom1.2beta and later; the code
works fine on Xom-1.1.
Thanks for your help,
Daniel