#10 DocumentBuilder's parse cannot handle One-Jar-URLs

open
nobody
None
5
2012-04-12
2012-04-12
Gerke Forcare
No

This happens when the One-JAR version 0.97.

javax.xml.parsers.DocumentBuilder's parse cannot handle One-Jar-URLs. This came up in a situation when I was using Hadoop from within a One-JAR. The Hadoop Configuration system reads the default XML-configuration files from the library-jars. But the One-JAR Class-loader yields "jar:file://path/to/my/one-jar.jar!/lib/hadoop-core-version.jar!/core-default.xml". This does not seem to be a valid systemId for the used org.xml.sax.InputSource.

In the earlier version of One-JAR (0.96) this did not happen.

Discussion

  • Gerke Forcare
    Gerke Forcare
    2012-04-16

    Actually we got a different error when loading the configuration files with One-Jar 0.96. It did not load those files either but it did not report an error as with 0.97. So it is a general difference between using separate lib-jars + main jar as apposed to using One-Jar. We could live with the 0.96 behavior so for now that is our work-around. Not sure if this could be fixed at all without changing the javax.xml.parsers.DocumentBuilder's parse... (which of course is out-of-the-question) or maybe asking for a change of the way Hadoop tries to read the configuration files. (which might be possible, at least more possible than the change in DocumentBuilder ;-) )

     
  • P. Simon Tuffs
    P. Simon Tuffs
    2012-04-16

    Any chance you could create a mini example which shows this behavior (doesn't have to be Hadoop, just do what Hadoop does)? Otherwise it's difficult to diagnode.

    SImon.