Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cobertura : xerces error #13

Open
glung opened this issue Sep 24, 2013 · 3 comments
Open

Cobertura : xerces error #13

glung opened this issue Sep 24, 2013 · 3 comments

Comments

@glung
Copy link

glung commented Sep 24, 2013

I tried to run the "mvn clean cobertura:cobertura -P cobertura" on your test project.

It keeps failing with the following error.
I tried on both configurations :

  • Mac with Mountain Lion
    -- Java version "1.6.0_51"
    -- Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
  • CentOs
    -- java version "1.7.0_03"
    -- Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 14:51:28+0100)

Is this a known issue ?

java.lang.NoSuchFieldError: fFeatures
at org.apache.xerces.parsers.XML11Configuration.(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at org.apache.xerces.parsers.ObjectFactory.newInstance(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.findJarServiceProvider(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.DOMParser.(Unknown Source)
at org.apache.xerces.parsers.DOMParser.(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
at org.robolectric.AndroidManifest.parseAndroidManifest(AndroidManifest.java:118)
at org.robolectric.AndroidManifest.getTargetSdkVersion(AndroidManifest.java:259)
at org.robolectric.RobolectricTestRunner.pickSdkVersion(RobolectricTestRunner.java:293)
at org.robolectric.RobolectricTestRunner.getEnvironment(RobolectricTestRunner.java:267)
at org.robolectric.RobolectricTestRunner.access$100(RobolectricTestRunner.java:57)
at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:190)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:177)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

@glung
Copy link
Author

glung commented Mar 26, 2014

FYI, a colleague told me it actually works with version 2.5.2

@dnkoutso
Copy link

dnkoutso commented Jun 3, 2014

2.5.2 of what? Can you provide more info?

@WonderCsabo
Copy link

Unfortunately cobertura 2.5.2 did not help me, but i found a working solution.

The root of the error is the xerxesImpl dependency, if we use another version, cobertura can run just fine. To fix the problem you should declare that version:

<dependency>
  <groupId>xerces</groupId>
  <artifactId>xercesImpl</artifactId>
  <version>2.7.1</version>
  <scope>test</scope>
</dependency>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants