Clojure

SAXParserFactoryImpl is missing at unit testing time

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: Backlog
  • Component/s: None
  • Labels:
    None

Description

SAXParserFactoryImpl seems to be AWOL while clojure unit tests are running, but is present when clojure is started from the command line. WTF?

(ns clojure.test-clojure.clojure-xml
  (:use clojure.test)
  (:import [javax.xml.parsers SAXParserFactory])
  (:require [clojure.xml :as xml]))

(deftest sax-parser-factory-is-not-awol
  (is (SAXParserFactory/newInstance)))
</code></pre>
<pre><code>Tell ant to run the unit tests:

$ ant test

And get the following exception:

ERROR in (sax-parser-factory-is-not-awol) (SAXParserFactory.java:134)
expected: (SAXParserFactory/newInstance)
actual: javax.xml.parsers.FactoryConfigurationError: Provider
        org.apache.xerces.jaxp.SAXParserFactoryImpl not found
at javax.xml.parsers.SAXParserFactory.newInstance (SAXParserFactory.java:134)
   clojure.test_clojure.clojure_xml/fn (clojure_xml.clj:17)

Yet, when I run clojure from the command line and do the same thing,
all is well.

$ java -jar clojure.jar
Clojure 1.2.0-beta1
user=> (import 'javax.xml.parsers.SAXParserFactory)
javax.xml.parsers.SAXParserFactory
user=> (SAXParserFactory/newInstance)
#<SAXParserFactoryImpl org.apache.xerces.jaxp.SAXParserFactoryImpl@19381960>
user=>

See also:
http://github.com/bpsm/clojure/commits/409show

Activity

Hide
Assembla Importer added a comment -

bpsm said: Provide link to my '409show' branch, which does what it says on the tin.

Show
Assembla Importer added a comment - bpsm said: Provide link to my '409show' branch, which does what it says on the tin.
Hide
Assembla Importer added a comment -

stu said: This code works fine for me locally (Mac OS X). I would investigate a busted Ant setup, or getting a different version of Java, on your end.

I'll be looking through the rest of the XML tickets your filed this morning – thanks for taking the time!

Show
Assembla Importer added a comment - stu said: This code works fine for me locally (Mac OS X). I would investigate a busted Ant setup, or getting a different version of Java, on your end. I'll be looking through the rest of the XML tickets your filed this morning – thanks for taking the time!
Hide
Assembla Importer added a comment -

bpsm said: Thanks. I've seen this both on my Mac and Linux netbook (JDK 1.6.0_20), but I'm sitting in front of a machine I haven't tried to reproduce this on yet, so I'll give it a whirl here and report what I find.

Show
Assembla Importer added a comment - bpsm said: Thanks. I've seen this both on my Mac and Linux netbook (JDK 1.6.0_20), but I'm sitting in front of a machine I haven't tried to reproduce this on yet, so I'll give it a whirl here and report what I find.
Hide
Assembla Importer added a comment -

bpsm said: [file:aSijYaMmCr35jQeJe5cbLr]: demonstrates #409 on x64, Java1.6.0_20, ant 1.7.1

Show
Assembla Importer added a comment - bpsm said: [file:aSijYaMmCr35jQeJe5cbLr]: demonstrates #409 on x64, Java1.6.0_20, ant 1.7.1
Hide
Assembla Importer added a comment -

bpsm said: I see the failure on my workstation as well, alas. I've attached a transcript including ant -diagnostics output. If it is my local setup at fault, I'm not sure what it could be. Perhaps something there will catch your eye.

Show
Assembla Importer added a comment - bpsm said: I see the failure on my workstation as well, alas. I've attached a transcript including ant -diagnostics output. If it is my local setup at fault, I'm not sure what it could be. Perhaps something there will catch your eye.

People

  • Assignee:
    Unassigned
    Reporter:
    Anonymous
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: