CodecConfigurationException when registering XMLGregorianCalendar

I’m using the java driver, and running into an exception when trying to register the XMLGregorianCalendar class. Here’s the code snippet and error I ran into:

CodecRegistry pojoCodecRegistry = fromProviders(PojoCodecProvider.builder() .register(XMLGregorianCalendar.class) .build());

org.bson.codecs.configuration.CodecConfigurationException: Property ‘year’ in XMLGregorianCalendar, has differing data types: TypeData{type=BigInteger} and TypeData{type=Integer}.

Any help is appreciated! Thank you.