Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8946899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:36:41+00:00 2026-06-15T12:36:41+00:00

I am developing an Android app which needs to render components dynamically according to

  • 0

I am developing an Android app which needs to render components dynamically according to an XML string. This XML string is based on an XSD and I am directly getting the XML from a server. I have used JAXB xjc to create an object model from the XSD. But now I want to be able to unmarshall and parse the complete XML with JAXB.
I went through a few posts here and in this post, I found a solution where the last solution gives a solution to use a repackaged jaxb library. I followed the following steps:-

1.
Import the librarys:
activation.jar
additionnal.jar
ae-jaxb-2.2.5.jar
istack-commons-runtime.jar
jaxp-datatype.jar
txw2-20110809.jar

  1. Replace my jaxb imports to ae.jaxb.

  2. Added RuntimeInlineAnnotationReader.cachePackageAnnotation(RenderXml.class.getPackage(), new XmlSchemaMine(""));
    to the onCreate method in my code. Here RenderXml is the name of my Activity.

I am still getting the following runtime errors :-

12-04 13:44:39.820: E/AndroidRuntime(2219): FATAL EXCEPTION: main
12-04 13:44:39.820: E/AndroidRuntime(2219): java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlRegistry
12-04 13:44:39.820: E/AndroidRuntime(2219):     at java.lang.Class.getDeclaredAnnotation(Native Method)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at java.lang.Class.getAnnotation(Class.java:260)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at ae.com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getClassAnnotation(RuntimeInlineAnnotationReader.java:109)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at ae.com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getClassAnnotation(RuntimeInlineAnnotationReader.java:59)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at ae.com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:330)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at ae.com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:461)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at ae.com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:299)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at ae.com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:142)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at ae.com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1164)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at ae.com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:146)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at ae.com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:237)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at java.lang.reflect.Method.invokeNative(Native Method)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at java.lang.reflect.Method.invoke(Method.java:511)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at ae.javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:186)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at ae.javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:146)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at ae.javax.xml.bind.ContextFinder.find(ContextFinder.java:361)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at ae.javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:446)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at ae.javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:409)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at ae.javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:313)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at com.example.testuirenderxml.RenderXml.generateFirstMenu(RenderXml.java:79)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at com.example.testuirenderxml.RenderXml.onCreate(RenderXml.java:112)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at android.app.Activity.performCreate(Activity.java:5104)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at android.os.Handler.dispatchMessage(Handler.java:99)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at android.os.Looper.loop(Looper.java:137)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at android.app.ActivityThread.main(ActivityThread.java:5039)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at java.lang.reflect.Method.invokeNative(Native Method)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at java.lang.reflect.Method.invoke(Method.java:511)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at dalvik.system.NativeStart.main(Native Method)
12-04 13:44:39.820: E/AndroidRuntime(2219): Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.xml.bind.annotation.XmlRegistry" on path: /data/app/com.example.testuirenderxml-2.apk
12-04 13:44:39.820: E/AndroidRuntime(2219):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
12-04 13:44:39.820: E/AndroidRuntime(2219):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
12-04 13:44:39.820: E/AndroidRuntime(2219):     ... 35 more

I have the need to use jaxb because I have to generate the object model from an xsd which is updated regularly, is there any other way to create the object model and then parse the xml with the help of this object model so as to achieve what I want to?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:36:41+00:00Added an answer on June 15, 2026 at 12:36 pm

    I found the answer to my question. I need to set the following in my onCreate method:-

    RuntimeInlineAnnotationReader.cachePackageAnnotation(LayoutT.class.getPackage(), new XmlSchemaMine("myNameSpace"));
    

    where myNameSpace is the namespace I have for my XSD schema.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an android app which needs to activate the GPS. I read
I am very new to android and I am developing this app which allows
I am developing an Android app which needs to poll a specific webpage in
I'm developing a simple camera app which is based on the android developers tutorial
I'm developing an Android app which needs to download a lot of data. To
I am developing an Android app which needs to read text messages - I
I'm developing an Android app which needs to connect to a .NET SOAP web
I am developing an Android app which gets an image encoded in base 64
I'm developing an Android app which is a quiz. On the other hand, I'm
I am developing an android app in which I have included a library project,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.