Are you using the same JAXB version while trying standalone and using OpenEJB+CXF? I am able to replicate the error while marshaling from a simple client using JAXB 2.0. (RI 2.0.5) But works fine with JAXB-2.1. (RI 2.1.9 to be specific). Looks like a bug in JAXB 2.0.
Thanks, Bharath On Wed, May 27, 2009 at 11:32 AM, Maaku <[email protected]> wrote: > > I was able to marshal successfully, so the problem might be in cxf? > > public class Tester { > public static void main(String[] args) throws JAXBException { > JAXBContext jaxbContext = JAXBContext.newInstance(Date2.class); > // Marshal to System.out > Marshaller marshaller = jaxbContext.createMarshaller(); > marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, > Boolean.TRUE); > Date2 date2 = new Date2(); > date2.setTest("testing..."); > marshaller.marshal( date2, System.out ); > } > } > > @XmlRootElement > public class Date2 extends Date { > public Date2() { > super(); > } > private String test; > public String getTest() { > return test; > } > public void setTest(String test) { > this.test = test; > } > } > > > David Blevins wrote: > > > > Seems like a bug in the jaxb ri. I guess from where you're at now > > what I'd recommend is to see if you can replicate the issue in a test > > case that doesn't use OpenEJB or web services (CXF). > > > > Maybe create a JAXB class, 'MyDocument' or something, that has a > > single field of type Date2 then create a test case that does a simple > > JAXBContext.newInstance(MyDocument.class) and then attempts to > > marshall and unmarshall an instance of MyDocument using the > > jaxbContext. That should allow you to get right to the issue and > > potentially rule out anything OpenEJB or CXF related. > > > > If it still fails then I'd send your test case to the JAXB RI as a bug > > report. > > > > -David > > > > -- > View this message in context: > http://www.nabble.com/Problem-with-Dates-in-web-service-tp23716455p23736462.html > Sent from the OpenEJB User mailing list archive at Nabble.com. > >
