How can I make a parameter type for which I cannot annotate nillable in my JAX-WS endpoint?

Solution Unverified - Updated -

Issue

  • How can I make a parameter type for which I cannot annotate nillable in my JAX-WS endpoint?
  • I want to use java.util.Calendar as a parameter in one of my methods in my JAX-WS interface, and I want it to be nillable. When I use xsi:nil="true" in the SOAP request, I get an IllegalArgumentException from JAXB during unmarshalling of the SOAP request.
Caused by: java.lang.IllegalArgumentException:
        at org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl$Parser.parseYear(Unknown Source)
        at org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl$Parser.parse(Unknown Source)
        at org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl.<init>(Unknown Source)
        at org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl.newXMLGregorianCalendar(Unknown Source)
        at __redirected.__DatatypeFactory.newXMLGregorianCalendar(__DatatypeFactory.java:181) [jboss-modules.jar:1.1.2.GA-redhat-1]
        at com.sun.xml.bind.DatatypeConverterImpl._parseDateTime(DatatypeConverterImpl.java:369)
        at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$2.parse(RuntimeBuiltinLeafInfoImpl.java:270)
        at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$2.parse(RuntimeBuiltinLeafInfoImpl.java:268)
        at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.parse(TransducedAccessor.java:247)
        at com.sun.xml.bind.v2.runtime.unmarshaller.LeafPropertyLoader.text(LeafPropertyLoader.java:65)
        ... 35 more

How can I fix this?

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 6.x
  • JBossWS/CXF/JAXB

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content