XStream
  1. XStream
  2. XSTR-652

Android: Could not instantiate converter : com.thoughtworks.xstream.converters.extended.DurationConverter

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Upcoming
    • Fix Version/s: 1.4
    • Component/s: Converters
    • Labels:
      None
    • JDK version and platform:
      Android

      Description

      On my Android devices (v2.1 & v2.2 & v2.3.3) as well as the emulator I get this exception:

      com.thoughtworks.xstream.InitializationException: Could not instantiate converter : com.thoughtworks.xstream.converters.extended.DurationConverter : null
          at com.thoughtworks.xstream.XStream.registerConverterDynamically(XStream.java:756)
          at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:719)
          at com.thoughtworks.xstream.XStream.<init>(XStream.java:452)
          at com.thoughtworks.xstream.XStream.<init>(XStream.java:377)
          at com.thoughtworks.xstream.XStream.<init>(XStream.java:352)
          at at.digitald.core.CC.initialize(CC.java:79)
          ... 5 more
      Caused by: java.lang.reflect.InvocationTargetException
          at java.lang.reflect.Constructor.constructNative(Native Method)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
          at com.thoughtworks.xstream.XStream.registerConverterDynamically(XStream.java:749)
          ... 10 more
      Caused by: javax.xml.datatype.DatatypeConfigurationException: Provider org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl not found
          at javax.xml.datatype.DatatypeFactory.newInstance(DatatypeFactory.java:102)
          at com.thoughtworks.xstream.converters.extended.DurationConverter.<init>(DurationConverter.java:33)
          ... 13 more
      Caused by: java.lang.ClassNotFoundException: org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl in loader dalvik.system.PathClassLoader[..]
          at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
          at javax.xml.datatype.FactoryFinder.newInstance(FactoryFinder.java:154)
          at javax.xml.datatype.FactoryFinder.find(FactoryFinder.java:241)
          at javax.xml.datatype.DatatypeFactory.newInstance(DatatypeFactory.java:95)
          ... 14 more
      

      Works fine on the desktop. Android version includes only "xstream-1.4-SNAPSHOT.jar". SVN revision 1803.

      CC.java
      public void initialize() {
      
      		if (Gdx.app.getType() != ApplicationType.Android) {
      			Xpp3Driver driver = new Xpp3Driver();
      			xs = new XStream(driver);
      		} else {
      			xs = new XStream(new KXml2Driver()); //line 79
      		}
       {..}
      }
      

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Marc Menghin
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: