kiota-java icon indicating copy to clipboard operation
kiota-java copied to clipboard

Very old stax implementation causes Error in relation with quarkus and Hibernate

Open bumbel42so opened this issue 6 months ago • 6 comments

I have different Quarkus projects which use com.microsoft.graph:microsoft-graph and io-quarkus:quarkus-hibernate-orm. After upgrading microsoft-graph to >= 6.30 i always get this error:

Runtime java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors [error]: Build step io.quarkus.narayana.jta.deployment.NarayanaJtaProcessor#build threw an exception: javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParserFactory not found

After some painfull investigations i come arround that the solution was for me to exclude javax.xml.stream:stax-api which is come from this lib.

I am a little bit confused you ship a lib which is developed in 2008. I think it comes from this issue (https://github.com/microsoft/kiota-java/issues/1755), but isn´t there a better solution?

bumbel42so avatar Jun 02 '25 06:06 bumbel42so

Hi @bumbel42so Thank you for using kiota and for reaching out.

What would be a better alternative?

baywet avatar Jun 02 '25 14:06 baywet

@baywet I think if it is only needed for android it´s a better alternative to document it for android users, to manually add it, instead to deliver it for all and causes incompability problems. But I'm afraid I don't know your code well enough to come up with a helpful solution that avoids the problem altogether. For me my workaround ist working

bumbel42so avatar Jun 02 '25 14:06 bumbel42so

@andreaTP do you think using the quarkus implementation for the request adapter would help here?

baywet avatar Jun 02 '25 14:06 baywet

Probably using Vertx and Jackson is going to be easier with Quarkus/Hibernate. There is a Quarkus extension or you can mix and match those libraries: https://github.com/kiota-community/kiota-java-extra

@baywet IIRC you are doing some trick to e.g. handle chunked responses that are not part of adapter etc. I think the best answer is: it depends on what part of the Graph API the user is using.

andreaTP avatar Jun 02 '25 17:06 andreaTP

@andreaTP are you referring to the large file upload? https://learn.microsoft.com/en-us/graph/sdks/large-file-upload?tabs=java This is not using chunk encoding, but rather a custom "protocol". I'm not aware that Microsoft Graph uses chunked encoding anywhere, so that wouldn't be a concern as far as I can tell.

baywet avatar Jun 02 '25 17:06 baywet

yes, I was referring to "large file upload" 👍

andreaTP avatar Jun 02 '25 17:06 andreaTP