Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

JAXB error

Thread view: 
seppo - 14 Jun 2005 11:54 GMT
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?
iksrazal@terra.com.br - 14 Jun 2005 12:24 GMT
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/
iksrazal@terra.com.br - 14 Jun 2005 12:36 GMT
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/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.