1

I am trying to a load spring context file in an android application and I have added the spring framework libraries that I need.

ApplicationContext context = new ClassPathXmlApplicationContext("context.xml");

When it gets to the line, it crashes with the error message:

 Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Parser configuration exception parsing XML from class path resource [context.xml]; nested exception is javax.xml.parsers.ParserConfigurationException: Unable to validate using XSD: Your JAXP provider [org.apache.harmony.xml.parsers.DocumentBuilderFactoryImpl@1d8d5d13] does not support XML Schema. Are you running on Java 1.4 with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD support.

When I tried adding Xerces2 jar files, the application failed to compile, with the error message:

Error:Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_76\bin\java.exe'' finished with non-zero exit value 1

I tried looking for solutions but I haven't found any success and I am unable to load my context file. I am using the latest version of android studio with build tools version 22.0.1.

Is there any solution to this or will I be unable to use spring with my andriod app?

Gary In
  • 667
  • 3
  • 9
  • 19
  • Try the solution in this topic: http://stackoverflow.com/questions/28640314/android-studio-fails-to-debug-with-error-org-gradle-process-internal-execexcepti –  May 17 '15 at 13:07

0 Answers0