jaxb problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anandk12
    New Member
    • Oct 2007
    • 1

    #1

    jaxb problem

    iam using jwsdp2.0 and jdk1.6
    my dtd is library.dtd
    *************** *************** *************** *************** ********
    <?xml version="1.0" encoding="US-ASCII" ?>
    <!ELEMENT library (fiction , biography ,science)>
    <!ELEMENT fiction (book)+>
    <!ELEMENT biography (book)+>
    <!ELEMENT science (book)+>
    <!ELEMENT book (#PCDATA)>
    *************** *************** *************** *************** ********
    after i set the classpath and execute using command

    xjc -dtd library.dtd

    Iam getting this
    D:\Jaxbdemo>xjc -dtd library.dtd
    *************** *************** *************** *************** ********
    parsing a schema...
    compiling a schema...
    generated\Biogr aphy.java
    generated\Book. java
    generated\Ficti on.java
    generated\Libra ry.java
    generated\Objec tFactory.java
    generated\Scien ce.java
    *************** *************** *************** *************** ********

    Iam not getting interfaces or runtimes inside it.is that an error.Iam completely new to Jax-b .can anyone guide me in this regard.
    I followed the material in roseindia.net .
    mail me at asade@miracleso ft.com.
    Thanks and regards........ ..
  • Raghunandan24
    New Member
    • Dec 2007
    • 31

    #2
    Hi,

    Those are the correct classes that get generated using xjc.
    You need to compile lesson.java found on the same site.
    Further you may face a few problems while compiling this file. to overcome this you need to add generated.<clas s name> in lesson.java.

    Hope this helps solve your problem. I have implimented Jaxb using the same set of examples and it has worked.

    Raghu

    Comment

    • Raghunandan24
      New Member
      • Dec 2007
      • 31

      #3
      Hi,
      The problem is u must be setting the path to jdk6. jdk6 has xjb in the bin folder. To generate all the interfaces you need to set java_home and then set the path to jwsdp/jaxb/bin.
      xjc is present in this bin folder of jwsdp. This will generate all the java classes. This should work

      Raghu

      Comment

      Working...