You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.ExceptionInInitializerError
at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:69)
at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:100)
at org.apache.tika.mime.MimeTypesFactory.create(MimeTypesFactory.java:189)
at org.apache.tika.mime.MimeTypes.getDefaultMimeTypes(MimeTypes.java:604)
at org.apache.tika.config.TikaConfig.getDefaultMimeTypes(TikaConfig.java:80)
at org.apache.tika.config.TikaConfig.<init>(TikaConfig.java:246)
at au.com.dius.pact.core.model.OptionalBody.<clinit>(OptionalBody.kt:188)
at au.com.dius.pact.core.model.OptionalBody.missing(Unknown Source:0)
at au.com.dius.pact.consumer.dsl.PactDslRequestBase.<init>(PactDslRequestBase.java:30)
at au.com.dius.pact.consumer.dsl.PactDslRequestWithoutPath.<init>(PactDslRequestWithoutPath.java:40)
at au.com.dius.pact.consumer.dsl.PactDslWithState.uponReceiving(PactDslWithState.java:41)
at au.com.dius.pact.consumer.dsl.PactDslWithProvider.uponReceiving(PactDslWithProvider.java:74)
at de.swmh.oneapp.news.feed.PactTest.pact(PactTest.kt:15)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2205)
Caused by: java.lang.RuntimeException: problem initializing SAXParser pool
at org.apache.tika.mime.MimeTypesReader.<clinit>(MimeTypesReader.java:119)
... 40 more
Caused by: org.apache.tika.exception.TikaException: prooblem creating SAX parser factory
at org.apache.tika.mime.MimeTypesReader.newSAXParser(MimeTypesReader.java:396)
at org.apache.tika.mime.MimeTypesReader.setPoolSize(MimeTypesReader.java:380)
at org.apache.tika.mime.MimeTypesReader.<clinit>(MimeTypesReader.java:117)
... 40 more
Caused by: org.xml.sax.SAXNotRecognizedException: http://javax.xml.XMLConstants/feature/secure-processing
at org.apache.harmony.xml.parsers.SAXParserFactoryImpl.setFeature(SAXParserFactoryImpl.java:93)
at org.apache.tika.mime.MimeTypesReader.newSAXParser(MimeTypesReader.java:392)
... 42 more
Pact version: au.com.dius.pact:consumer:4.1.10
Emulator API levels: 28, 29, 30
The SaxParserfactoryImpl used by the android runtime does not recognize the feature http://javax.xml.XMLConstants/feature/secure-processing and fails with the above exception. The call originates from the instantiation of TikaConfig
The text was updated successfully, but these errors were encountered:
There is not much I can do about this as it is in Apache Tika code and outside my control. I also don't have an Android project to verify. The only thing I can do is catch the exception and then disable content type detection. You'll have to make sure you set the correct content type headers.
The other thing to do is not run it as an instrumented test, but just a normal unit test. I have done this on Android projects in the past.
This simple example run as instrumented test in an Android project
causes the following stacktrace
Pact version: au.com.dius.pact:consumer:4.1.10
Emulator API levels: 28, 29, 30
The
SaxParserfactoryImpl
used by the android runtime does not recognize the featurehttp://javax.xml.XMLConstants/feature/secure-processing
and fails with the above exception. The call originates from the instantiation ofTikaConfig
The text was updated successfully, but these errors were encountered: