Whirlycott / Philip Jacob

Friday, July 28, 2006

Gotcha: JUnit tests fail on Eclipse with a mysterious Xerces error

Filed under: General — Philip Jacob @ 8:53 pm

I had a strange problem occurring with some JUnit tests

java.lang.AbstractMethodError: org.apache.xerces.dom.DeferredElementImpl.getTextContent()Ljava/lang/String;
at com.whirlycott.cache.CacheManager.configure(Unknown Source)
at com.whirlycott.cache.CacheManager.(Unknown Source)
at com.whirlycott.cache.CacheManager.(Unknown Source)

Turns out that if you have Commons Configuration specified in your Maven POM, you’ll get this error. You need to specify this in pom.xml:

… and specify xercesImpl 2.6.2 as a dependency. Things will work again.

Leave a Reply