You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consuming a XML API using Spring WebClient fails if JdkClientHttpConnector is configured. This exception is thrown:
...
Caused by: java.lang.ClassNotFoundException: org.glassfish.jaxb.runtime.v2.ContextFactory
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na]
...
Attached is a simple project to demonstrate the issue. Please execute Gradle task assemble to build the JAR file. Then run the application with java -jar .... My environment is Eclipse Temurin JDK 21.0.3+9 on Windows 10 22H2 x64.
When running from IntelliJ IDEA directly instead, the issue does not occur.
Not affected are Spring RestClient and RestTemplate when also configured with JDK HttpClient (JdkClientHttpRequestFactory).
@renetrefft please don't paste things in text like that. It looks like you think a build file is enough to reproduce the issue but it isn't. Also, the fact that it works in your IDE but not on an assembled jar makes it more likely to be a problem in your setup, which we don't have.
Can you edit your description and replace that with an actual sample we can run? You can attach a zip to this issue or push the code to a GitHub repository.
@renetrefft thank you for the sample, I can reproduce the problem as you've described. We're investigating.
snicoll
changed the title
JAXB deserialization broken on Spring WebClient with JdkClientHttpConnector
JaxbContextContainer does not define the ClassLoader to use to retrieve the JAXBContext to use
Jul 9, 2024
Consuming a XML API using Spring WebClient fails if
JdkClientHttpConnector
is configured. This exception is thrown:Attached is a simple project to demonstrate the issue. Please execute Gradle task
assemble
to build the JAR file. Then run the application withjava -jar ...
. My environment is Eclipse Temurin JDK 21.0.3+9 on Windows 10 22H2 x64.When running from IntelliJ IDEA directly instead, the issue does not occur.
Not affected are Spring RestClient and RestTemplate when also configured with JDK HttpClient (
JdkClientHttpRequestFactory
).spring-xml-deserializer-bug.zip
The text was updated successfully, but these errors were encountered: