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

On May 25, 2009, at 8:51 PM, Maaku wrote:


This is getting frustrating, I'm trying to create a web service which returns
a custom date.

I've extended java.util.Date and I'm getting

com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$5 cannot be cast
to com.sun.xml.bind.v2.model.impl.ClassInfoImpl

At first, I thought it was because of the fields/methods that I have but then I tried removing all fields and methods and it still gives the same
exception

*my class
@WebService (
       portName = "TestWebServicePort",
       serviceName = "TestWebService",
       targetNamespace = "http://xxx.com/wsdl";,
       endpointInterface = "com.xxx.TestWebService")
@Stateless
public class TestServiceBean implements TestWebService {
 public Date2 getDate() {
        return null;
 }
}
@WebService (targetNamespace = "http://xxx.com/wsdl";)
public interface TestWebService {
        
   public Date2 getDate();

}

public class Date2 extends Date implements Serializable {
}

Without this Date2 my web service is working ok.


Found a similar problem but i can't just use java.util.Date
http://www.ibm.com/developerworks/forums/thread.jspa?threadID=248225&tstart=0

Any help will be much appreciated

--
View this message in context: 
http://www.nabble.com/Problem-with-Dates-in-web-service-tp23716455p23716455.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Reply via email to