This discussion is archived
1 Reply Latest reply: Jul 20, 2011 7:37 AM by gimbal2 RSS

JAXB tutorial issue ( with simple JAXB unmarshelling example) .

716599 Newbie
Currently Being Moderated
hi,

I have been seen many tutorials about same example but im not able to figure out one thing
eg. [Basic steps  for unmarhselling using JAXB | http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/1.6/tutorial/doc/JAXBUsing3.html]

[Related Schema and sample xml is at URL| http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/1.6/tutorial/doc/JAXBWorks3.html]
In above basic example, step 4 is

PurchaseOrder po =
(PurchaseOrder)u.unmarshal(
new FileInputStream( "po.xml" ) );

I don't see any PurchaseOrder class generated using xjc utility for given XSD, along side i didnt understand step 8,9,10. does it mean update the classes generated by xjc utility ...

I have been trying JAXB unmarhselling seens last 10hours without success .. :( . sorry to disturb if i went wrong somewhere, but i tried A LOT !

THANKS a lot ..hope i will learn it soon :(

Edited by: user8713254 on Jul 18, 2011 9:00 AM

Edited by: user8713254 on Jul 18, 2011 9:02 AM
  • 1. Re: JAXB tutorial issue ( with simple JAXB unmarshelling example) .
    gimbal2 Guru
    Currently Being Moderated
    I don't see any PurchaseOrder class generated using xjc utility for given XSD
    Then you did something wrong.

    At this point stop following the tutorial and start reading up about that tool. Understand the trick, don't only learn the trick. WHY don't you get generated classes? You'll have to answer that before you can continue. To start with: are you getting an error message?


    The JEE 5 tutorial has a nice section on JAXB:

    http://download.oracle.com/javaee/5/tutorial/doc/bnazf.html


    The JAXB user guide might also help (also check the other documentation on that site)

    http://jaxb.java.net/guide/




    And as a final note: nobody is forcing you to generate code. JAXB is an API after all, it might even benefit you to create the classes by hand until you know what you are doing.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points