JAXB error

S

seppo

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?
 
I

iksrazal

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/
 
I

iksrazal

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/
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top