I want to use a class from a third-party library that is annotated using @XmlRootElement from javax.xml.bind.annotation . This annotation does not exist on Android and is difficult to add (as in a secure namespace).
I don't actually use the class in the context of JAXB, so I'm more than happy to ignore the annotation. The Android JVM, however, is not and throws a ClassNotFounException from the class loader:
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlAccessorType in loader dalvik.system.PathClassLoader[/data/app/csiro.truststore.client.tssandroidclient-2.apk] at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:251) at java.lang.ClassLoader.loadClass(ClassLoader.java:540) at java.lang.ClassLoader.loadClass(ClassLoad
Is there a way to get Android to ignore annotation?
source share