Skip to content

OkHttp signature updated: RequestBody.create(@Nullable MediaType contentType, String content) #103

@g-cesar

Description

@g-cesar

Describe the bug
Starting from version 4.9.0 OkHttp got updated and the method RequestBody.create(String, MediaType) is now deprecated in favour of the new signature RequestBody.create(MediaType, String). Because of this mostly all the api requests fail.

Env info
Please, provide us with the following details:

  • JDK version:
    openjdk 21.0.3 2024-04-16 LTS
    OpenJDK Runtime Environment Corretto-21.0.3.9.1 (build 21.0.3+9-LTS)
    OpenJDK 64-Bit Server VM Corretto-21.0.3.9.1 (build 21.0.3+9-LTS, mixed mode, sharing)
  • Java SDK version:
<dependency>
<groupId>it.fattureincloud</groupId>
<artifactId>fattureincloud-java-sdk</artifactId>
<version>2.1.1</version>
</dependency>

To Reproduce
Stacktrace:

2025-04-01T14:16:44.504386+00:00 app[web.1]: 2025-04-01 14:16:44.503 ERROR 2 --- [o-57761-exec-19] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: 'okhttp3.RequestBody okhttp3.RequestBody.create(java.lang.String, okhttp3.MediaType)'] with root cause
2025-04-01T14:16:44.504398+00:00 app[web.1]: 
2025-04-01T14:16:44.504400+00:00 app[web.1]: java.lang.NoSuchMethodError: 'okhttp3.RequestBody okhttp3.RequestBody.create(java.lang.String, okhttp3.MediaType)'
2025-04-01T14:16:44.504401+00:00 app[web.1]: 	at it.fattureincloud.sdk.ApiClient.serialize(ApiClient.java:882) ~[fattureincloud-java-sdk-2.1.1.jar!/:na]
2025-04-01T14:16:44.504401+00:00 app[web.1]: 	at it.fattureincloud.sdk.ApiClient.buildRequest(ApiClient.java:1174) ~[fattureincloud-java-sdk-2.1.1.jar!/:na]
2025-04-01T14:16:44.504401+00:00 app[web.1]: 	at it.fattureincloud.sdk.ApiClient.buildCall(ApiClient.java:1103) ~[fattureincloud-java-sdk-2.1.1.jar!/:na]
2025-04-01T14:16:44.504402+00:00 app[web.1]: 	at it.fattureincloud.sdk.api.ClientsApi.createClientCall(ClientsApi.java:130) ~[fattureincloud-java-sdk-2.1.1.jar!/:na]
2025-04-01T14:16:44.504403+00:00 app[web.1]: 	at it.fattureincloud.sdk.api.ClientsApi.createClientValidateBeforeCall(ClientsApi.java:154) ~[fattureincloud-java-sdk-2.1.1.jar!/:na]
2025-04-01T14:16:44.504403+00:00 app[web.1]: 	at it.fattureincloud.sdk.api.ClientsApi.createClientWithHttpInfo(ClientsApi.java:197) ~[fattureincloud-java-sdk-2.1.1.jar!/:na]
2025-04-01T14:16:44.504403+00:00 app[web.1]: 	at it.fattureincloud.sdk.api.ClientsApi.createClient(ClientsApi.java:175) ~[fattureincloud-java-sdk-2.1.1.jar!/:na]
2025-04-01T14:16:44.504404+00:00 app[web.1]: 	at com.clubinglese.Club_Inglese.controller.FattureInCloudController.creaClienteFIC(FattureInCloudController.java:126) ~[classes!/:3.0.0]
2025-04-01T14:16:44.504405+00:00 app[web.1]: 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
2025-04-01T14:16:44.504406+00:00 app[web.1]: 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
2025-04-01T14:16:44.504406+00:00 app[web.1]: 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
2025-04-01T14:16:44.504407+00:00 app[web.1]: 	at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
2025-04-01T14:16:44.504408+00:00 app[web.1]: 	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504409+00:00 app[web.1]: 	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504410+00:00 app[web.1]: 	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) ~[spring-webmvc-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504410+00:00 app[web.1]: 	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879) ~[spring-webmvc-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504411+00:00 app[web.1]: 	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) ~[spring-webmvc-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504412+00:00 app[web.1]: 	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504412+00:00 app[web.1]: 	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504412+00:00 app[web.1]: 	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504412+00:00 app[web.1]: 	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504413+00:00 app[web.1]: 	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504413+00:00 app[web.1]: 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504413+00:00 app[web.1]: 	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504413+00:00 app[web.1]: 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504413+00:00 app[web.1]: 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504416+00:00 app[web.1]: 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504416+00:00 app[web.1]: 	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504416+00:00 app[web.1]: 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504416+00:00 app[web.1]: 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504416+00:00 app[web.1]: 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:113) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504416+00:00 app[web.1]: 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504417+00:00 app[web.1]: 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504417+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504417+00:00 app[web.1]: 	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504417+00:00 app[web.1]: 	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504417+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504417+00:00 app[web.1]: 	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504418+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504418+00:00 app[web.1]: 	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504418+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504418+00:00 app[web.1]: 	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504418+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504418+00:00 app[web.1]: 	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:158) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504418+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504419+00:00 app[web.1]: 	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504419+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504419+00:00 app[web.1]: 	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504419+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504419+00:00 app[web.1]: 	at com.clubinglese.Club_Inglese.authentication.CustomAdminFilter.doFilterInternal(CustomAdminFilter.java:29) ~[classes!/:3.0.0]
2025-04-01T14:16:44.504419+00:00 app[web.1]: 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504422+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504422+00:00 app[web.1]: 	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504422+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504422+00:00 app[web.1]: 	at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:141) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504422+00:00 app[web.1]: 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504422+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504423+00:00 app[web.1]: 	at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:92) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504423+00:00 app[web.1]: 	at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:77) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504423+00:00 app[web.1]: 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504423+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504423+00:00 app[web.1]: 	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504423+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504424+00:00 app[web.1]: 	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504424+00:00 app[web.1]: 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504424+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504424+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504424+00:00 app[web.1]: 	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) ~[spring-security-web-5.3.3.RELEASE.jar!/:5.3.3.RELEASE]
2025-04-01T14:16:44.504424+00:00 app[web.1]: 	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504424+00:00 app[web.1]: 	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504424+00:00 app[web.1]: 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504425+00:00 app[web.1]: 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504425+00:00 app[web.1]: 	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504425+00:00 app[web.1]: 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504425+00:00 app[web.1]: 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504425+00:00 app[web.1]: 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504425+00:00 app[web.1]: 	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504427+00:00 app[web.1]: 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504427+00:00 app[web.1]: 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504427+00:00 app[web.1]: 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504427+00:00 app[web.1]: 	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504428+00:00 app[web.1]: 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.7.RELEASE.jar!/:5.2.7.RELEASE]
2025-04-01T14:16:44.504428+00:00 app[web.1]: 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504428+00:00 app[web.1]: 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504428+00:00 app[web.1]: 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504428+00:00 app[web.1]: 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504428+00:00 app[web.1]: 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504429+00:00 app[web.1]: 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504429+00:00 app[web.1]: 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504429+00:00 app[web.1]: 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504429+00:00 app[web.1]: 	at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:747) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504429+00:00 app[web.1]: 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504430+00:00 app[web.1]: 	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504430+00:00 app[web.1]: 	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504430+00:00 app[web.1]: 	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504430+00:00 app[web.1]: 	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504430+00:00 app[web.1]: 	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504430+00:00 app[web.1]: 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
2025-04-01T14:16:44.504430+00:00 app[web.1]: 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
2025-04-01T14:16:44.504430+00:00 app[web.1]: 	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36]
2025-04-01T14:16:44.504431+00:00 app[web.1]: 	at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]

Expected behavior
Whenever I try to execute the following code, for instance while creating a new customer using the API, I will run into the issue described above:

@RequestMapping(value = "/creaClienteFIC", method = RequestMethod.POST)
    @ResponseBody
    public String creaClienteFIC(@RequestParam("nominativoCliente") String nominativoCliente,
            @RequestParam("codiceFiscaleCliente") String codiceFiscaleCliente,
            @RequestParam("indirizzoCliente") String indirizzoCliente,
            @RequestParam("capCliente") String capCliente, @RequestParam("cittaCliente") String cittaCliente,
            @RequestParam("provinciaCliente") String provinciaCliente,
            @RequestParam("nazioneCliente") String nazioneCliente, @RequestParam("emailCliente") String emailCliente,
            @RequestParam("tipoCliente") String tipoCliente, @RequestParam("codiceSdiCliente") String codiceSdiCliente,
            @RequestParam("pecEmailCliente") String pecEmailCliente, @RequestParam("vatCliente") String vatCliente,
            @RequestParam("nomeReferenteCliente") String nomeReferenteCliente, @RequestParam("cognomeReferenteCliente") String cognomeReferenteCliente, @RequestParam("noteCliente") String noteCliente,
            Model model) throws ApiException {

        ApiClient apiFIC = Configuration.getDefaultApiClient();
        apiFIC.addDefaultHeader("authorization", "Bearer " + token);

        ClientsApi clientsApi = new ClientsApi(apiFIC);

        Client clientData = new Client();
        clientData.setName(nominativoCliente);
        clientData.taxCode(codiceFiscaleCliente);
        clientData.addressStreet(indirizzoCliente);
        clientData.addressPostalCode(capCliente);
        clientData.addressCity(cittaCliente);
        clientData.addressProvince(provinciaCliente);
        clientData.country(nazioneCliente);
        clientData.setEmail(emailCliente);
        clientData.setType(ClientType.fromValue(tipoCliente));
        if (clientData.getType().equals(ClientType.PERSON)) {
            clientData.setEiCode("0000000");
            clientData.setFirstName(nomeReferenteCliente);
            clientData.setLastName(cognomeReferenteCliente);
        } else {
            clientData.setEiCode(codiceSdiCliente);
            clientData.setContactPerson(cognomeReferenteCliente + " " + nomeReferenteCliente);
        }
        clientData.seteInvoice(true);
        clientData.setCertifiedEmail(pecEmailCliente);
        clientData.setVatNumber(vatCliente);
        clientData.setNotes(noteCliente);
        CreateClientRequest createClientRequest = new CreateClientRequest();
        createClientRequest.setData(clientData);
        CreateClientResponse result = clientsApi.createClient(idCompany, createClientRequest);

        return result.getData().getId().toString();
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions