1

We recently upgraded an old Java 7 application to Spring Boot and the latest versions of Spring boot (along with moving it to Java 8). After re-consuming web services that utilize xs:dateTime in the contract parameters, it now generates an error on the generated client interfaces.

Abstract class javax.xml.datatype.XMLGregorianCalendar cannot be used as a runtime class because it is not extended by a non abstract class which is suitable as a runtime class

This was never an issue in the previous consumption. Is there a reason that XMLGregorianCalendar can no longer be used? I'd like to avoid custom bindings if possible (thus keeping the XMLGregorianCalendar to not have to refactor all of the existing code).

WSDL method input:

<xs:complexType name="findGroupingsBySystem">
 <xs:sequence>
  <xs:element type="xs:string" name="theSystem" minOccurs="0"/>
  <xs:element type="xs:dateTime" name="theStartDate" minOccurs="0"/>
  <xs:element type="xs:dateTime" name="theEndDate" minOccurs="0"/>
 </xs:sequence>
</xs:complexType>

Java 8 Spring Boot 1.5.7 using cxf-spring-boot-starter 3.2.0

I see this existing entry from many years ago: Web service code created by CXF is not legal because of XMLGregorianCalendar?

My big question is why is this not working now (why did I never have the issue before)? Is there a dependency/etc that could be brought in to be able to keep this in the interface? If not, why does the default generate this way if it doesn't work?

LetsBeFrank
  • 774
  • 11
  • 31

0 Answers0