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 8398131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:57:53+00:00 2026-06-09T20:57:53+00:00

I try to do example code public class xml_class { /** * Unmarshal the

  • 0

I try to do example code

public class xml_class {
    /**
     * Unmarshal the sample document from a file, compute and set order total, then
     * marshal it back out to another file.
     *
     * @param args
     */
    public static void main(String[] args) {
        try {

            // unmarshal customer information from file
            IBindingFactory bfact = BindingDirectory.getFactory(test.Order.class);
            IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
            FileInputStream in = new FileInputStream("D:/liferay-develop/data1.xml");
            Order order = (Order)uctx.unmarshalDocument(in, null);

            // compute the total amount of the order
            float total = 0.0f;
            for (Iterator<Item> iter = order.getItems().iterator(); iter.hasNext();) {
                Item item = iter.next();
                total += item.getPrice() * item.getQuantity();
            }
            order.setTotal(new Float(total));

            // marshal object back out to file (with nice indentation, as UTF-8)
            IMarshallingContext mctx = bfact.createMarshallingContext();
            mctx.setIndent(2);
            FileOutputStream out = new FileOutputStream("D:/liferay-develop/out.xml");
            mctx.setOutput(out, null);
            mctx.marshalDocument(order);
            System.out.println("Processed order with " + order.getItems().size() +
                " items and total value " + total);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            System.exit(1);
        } catch (JiBXException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
}

And get an error:

Unable to access binding information for class test.Order
Make sure the binding has been compiled
java.lang.NoSuchFieldException: JiBX_bindingList
at java.lang.Class.getDeclaredField(Unknown Source)
at org.jibx.runtime.BindingDirectory.getBindingList(BindingDirectory.java:68)
at org.jibx.runtime.BindingDirectory.getFactory(BindingDirectory.java:211)
at test.xml_class.main(xml_class.java:31)

What is binding? And how to use it?

  • 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-09T20:57:54+00:00Added an answer on June 9, 2026 at 8:57 pm

    Eli,
    Why don’t you start with a simple example.
    Here is a nice one to start with:
    https://github.com/jibx/maven-plugin/tree/master/test-suite/base-binding-test
    Check this out, build it, and run the simple marshalling/unmarshalling example in the org.jibx.schema.test.person project.
    I hope this helps.
    Don

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

Sidebar

Related Questions

Im new in hebirnate. Try execute example code. public class HibernateUtil { private static
How can I know during runtime that my code threw a Warning? example try
Having trouble with each function... Will try to explain by example... In my code,
example i try to change cell.accessoryView from picture1 to picture2 by fadein but my
I try to understand this example from jquery api in this snippet var tags
I try to use doctest from example from http://docs.python.org/library/doctest.html But when I run python
UPDATE 1: Here is the full code behind from the downloaded example, unedited: using
I have problem with deserialize document to object using XmlSerializer class. Code my function
Please show me an example code on how to set image as wallpaper using
Consider following example : public class SomeBusinessLayerService : DataService<MyEntityContainer> { [WebInvoke] void DoSomething(string someParam)

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.