JAXB error

Discussion in 'Java' started by seppo, Jun 14, 2005.

  1. seppo

    seppo Guest

    Hi,

    I'm using the JAXB -libraries to creat XML -documents. My development
    environment is Java 1.4.2_08, Java Web Services Development Kit 1.5 and
    Eclipse 3.0. I can create an XML document without any problems if I run my
    code in Eclipse environment. But when I pack my application to JAR -package
    and try to run it by -jar option it gives an error while marshalling

    Exception in thread "main" java.lang.NoClassDefFoundError:
    com/sun/msv/datatype/xsd/DoubleType at
    com.sun.xml.bind.DatatypeConverterImpl.printDouble(DatatypeConverterImpl.jav
    a:304)
    at
    javax.xml.bind.DatatypeConverter.printDouble(DatatypeConverter.java:453)
    at
    prtpi.jaxb.impl.TRTDataImpl.serializeAttributes(TRTDataImpl.java:80)
    at prtpi.jaxb.impl.TrtDataImpl.serializeBody(TrtDataImpl.java:41)
    at
    prtpi.jaxb.impl.runtime.SAXMarshaller.childAsBody(SAXMarshaller.java:391)
    at
    prtpi.jaxb.impl.runtime.MarshallerImpl.write(MarshallerImpl.java:171)
    at
    prtpi.jaxb.impl.runtime.MarshallerImpl.marshal(MarshallerImpl.java:144)
    at
    javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl
    ..java:73)
    at jaxb_testi.SchemaTesti.createBusAtDoc(SchemaTesti.java:135)
    at jaxb_testi.SchemaTesti.main(SchemaTesti.java:37)

    jaxb_testi.SchemaTesti is my own class and prtpi.jaxb packages are created
    by jaxb -tools.

    Any idea what is wrong in my environment?
     
    seppo, Jun 14, 2005
    #1
    1. Advertising

  2. seppo

    Guest

    The JWSDP environment is screwy - I just fought a similair battle that
    was even worse. In Ant - you need something like...

    <path id="classpath-jboss">
    <fileset dir="${jboss.home}/lib">
    <include name="*.jar"/>
    </fileset>
    <fileset dir="lib">
    <include name="*.jar"/>
    </fileset>
    <fileset dir="${jwsdp.home}/jwsdp-shared/lib/">
    <include name="**/*.jar"/>
    </fileset>
    <fileset dir="${jwsdp.home}/jaxrpc/lib">
    <include name="**/*.jar"/>
    </fileset>
    <fileset dir="${jwsdp.home}/jaxp/lib/endorsed">
    <include name="**/*.jar"/>
    </fileset>
    <fileset dir="${jwsdp.home}/jaxp/lib">
    <include name="**/*.jar"/>
    </fileset>
    <fileset dir="${java.home}/lib">
    <include name="**/*.jar"/>
    </fileset>
    <fileset dir="${java.tools}">
    <include name="tools.jar"/>
    </fileset>
    </path>

    Also, something along the case that JAXB doesn't really work outside of
    Ant was proclaimed here:
    http://www.onjava.com/pub/a/onjava/2004/05/05/jaxb.html?page=1

    HTH,
    iksrazal
    http://www.braziloutsource.com/
     
    , Jun 14, 2005
    #2
    1. Advertising

  3. seppo

    Guest

    Beyond what I posted, I'm not sure if this got fixed - but about a year
    ago I had to create a custom annotation for DatatypeConverter, a
    problem that had a lot of people stumped. jaxrpc might have fixed that
    via their Impl - if not google on customizing DatatypeConverter - but
    you certainly want to avoid that if possible.

    HTH,
    iksrazal
    http://www.braziloutsource.com/
     
    , Jun 14, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sony Antony

    JAXB, XSLT comparison

    Sony Antony, Jul 17, 2003, in forum: Java
    Replies:
    1
    Views:
    925
    Arto V. Viitanen
    Jul 18, 2003
  2. Brahim Machkour

    JAXB and Arabic encoding

    Brahim Machkour, Jul 25, 2003, in forum: Java
    Replies:
    3
    Views:
    580
    Jon A. Cruz
    Jul 27, 2003
  3. Petterson Mikael

    XML to java using JAXB ?

    Petterson Mikael, Sep 2, 2003, in forum: Java
    Replies:
    0
    Views:
    403
    Petterson Mikael
    Sep 2, 2003
  4. Brett Selleck
    Replies:
    0
    Views:
    790
    Brett Selleck
    Sep 3, 2003
  5. Marcello Marangio

    JAXB generates incorrect xml content!!!

    Marcello Marangio, Oct 22, 2003, in forum: Java
    Replies:
    4
    Views:
    2,059
    Simon
    Oct 23, 2003
Loading...

Share This Page