-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Describe the Problem/Bug
After following the documentation and experimenting with various configuration settings, I am still receiving a 400 Bad Request when executing a chat completion request. The error logs are insufficient, as they only report a 400 response followed by a large error payload that Jackson is unable to map.
Token retrieval works correctly and as expected, which we confirmed by inspecting the request using the higher-verbosity apache.http.wire logging.
So in short: Chat completion requests still return 400 Bad Request with logs that Jackson can’t parse, despite following the docs and trying multiple configurations. Token retrieval works correctly.
Steps to Reproduce
I’m not exactly sure what the root cause is. For our purposes, the bug occurs every time I run the code shown below.
Expected Behavior
The expected behavior is that the template is returned with the variable correctly inserted, and that the request is executed successfully, returning content based on the specified model, resource group, scenario, and variable.
Screenshots
No response
Used Versions
- Java and Maven version via
mvn --version: Apache Maven 3.9.11 - SAP Cloud SDK for AI version: 1.15.0
- Spring Boot or CAP version: CAP Java SDK: 4.6.2
Dependency tree via mvn dependency:tree
[INFO] com.sap.sbnc.sco:sco-alerting:jar:0.3.0
[INFO] +- com.sap.cds:cds-starter-spring-boot:jar:4.6.2:compile
[INFO] | +- com.sap.cds:cds-services-api:jar:4.6.2:compile
[INFO] | | +- com.sap.cds:cds4j-api:jar:4.6.2:compile
[INFO] | | \- com.sap.cloud.environment.servicebinding.api:java-core-api:jar:0.21.0:compile
[INFO] | +- com.sap.cds:cds-services-impl:jar:4.6.2:compile
[INFO] | | +- com.sap.cds:cds-services-messaging:jar:4.6.2:compile
[INFO] | | | \- jakarta.jms:jakarta.jms-api:jar:3.1.0:compile
[INFO] | | +- com.sap.cloud.environment.servicebinding.api:java-access-api:jar:0.21.0:compile
[INFO] | | \- org.apache.commons:commons-csv:jar:1.14.1:compile
[INFO] | +- com.sap.cds:cds-feature-jdbc:jar:4.6.2:runtime
[INFO] | | +- com.sap.cds:cds4j-runtime:jar:4.6.2:compile
[INFO] | | | \- com.sap.cds:cds4j-jdbc-spi:jar:4.6.2:compile
[INFO] | | \- com.sap.cds:cds4j-tx:jar:4.6.2:runtime
[INFO] | +- com.sap.cds:cds-framework-spring-boot:jar:4.6.2:runtime
[INFO] | +- org.springframework.boot:spring-boot-starter-web:jar:3.5.10:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-json:jar:3.5.10:compile
[INFO] | | | \- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.19.4:compile
[INFO] | | \- org.springframework.boot:spring-boot-starter-tomcat:jar:3.5.10:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:10.1.50:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:10.1.50:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:3.5.10:compile
[INFO] | | +- com.zaxxer:HikariCP:jar:6.3.3:compile
[INFO] | | \- org.springframework:spring-jdbc:jar:6.2.15:compile
[INFO] | | \- org.springframework:spring-tx:jar:6.2.15:compile
[INFO] | \- org.yaml:snakeyaml:jar:2.4:compile
[INFO] +- org.springframework.boot:spring-boot-devtools:jar:3.5.10:compile (optional)
[INFO] | +- org.springframework.boot:spring-boot:jar:3.5.10:compile
[INFO] | | \- org.springframework:spring-context:jar:6.2.15:compile
[INFO] | \- org.springframework.boot:spring-boot-autoconfigure:jar:3.5.10:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:3.5.10:test
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:3.5.10:compile
[INFO] | +- org.springframework.boot:spring-boot-test:jar:3.5.10:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:3.5.10:test
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.9.0:compile
[INFO] | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:4.0.4:compile
[INFO] | | \- jakarta.activation:jakarta.activation-api:jar:2.1.4:compile
[INFO] | +- net.minidev:json-smart:jar:2.5.2:runtime
[INFO] | | \- net.minidev:accessors-smart:jar:2.5.2:runtime
[INFO] | +- org.assertj:assertj-core:jar:3.27.7:test
[INFO] | | \- net.bytebuddy:byte-buddy:jar:1.17.8:runtime
[INFO] | +- org.awaitility:awaitility:jar:4.2.2:test
[INFO] | +- org.hamcrest:hamcrest:jar:3.0:test
[INFO] | +- org.junit.jupiter:junit-jupiter:jar:5.12.2:test
[INFO] | | +- org.junit.jupiter:junit-jupiter-api:jar:5.12.2:test
[INFO] | | | +- org.opentest4j:opentest4j:jar:1.3.0:test
[INFO] | | | \- org.junit.platform:junit-platform-commons:jar:1.12.2:test
[INFO] | | \- org.junit.jupiter:junit-jupiter-params:jar:5.12.2:test
[INFO] | +- org.mockito:mockito-core:jar:5.17.0:runtime
[INFO] | | +- net.bytebuddy:byte-buddy-agent:jar:1.17.8:runtime
[INFO] | | \- org.objenesis:objenesis:jar:3.3:runtime
[INFO] | +- org.mockito:mockito-junit-jupiter:jar:5.17.0:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.5.3:test
[INFO] | +- org.springframework:spring-core:jar:6.2.15:compile
[INFO] | | \- org.springframework:spring-jcl:jar:6.2.15:compile
[INFO] | +- org.springframework:spring-test:jar:6.2.15:compile
[INFO] | \- org.xmlunit:xmlunit-core:jar:2.10.4:test
[INFO] +- com.sap.cds:cds-adapter-odata-v4:jar:4.6.2:runtime
[INFO] | +- com.sap.cds:cds-adapter-api:jar:4.6.2:compile
[INFO] | +- com.sap.cds:cds-services-utils:jar:4.6.2:compile
[INFO] | | +- com.sap.cloud.sdk.cloudplatform:connectivity-oauth:jar:5.24.0:compile
[INFO] | | | +- com.sap.cloud.sdk.cloudplatform:connectivity-apache-httpclient4:jar:5.24.0:compile
[INFO] | | | +- com.sap.cloud.environment.servicebinding.api:java-consumption-api:jar:0.21.0:compile
[INFO] | | | +- com.sap.cloud.sdk.cloudplatform:resilience:jar:5.24.0:compile
[INFO] | | | | \- com.sap.cloud.sdk.cloudplatform:resilience4j:jar:5.24.0:compile
[INFO] | | | | +- io.github.resilience4j:resilience4j-core:jar:2.3.0:compile
[INFO] | | | | +- io.github.resilience4j:resilience4j-circuitbreaker:jar:2.3.0:compile
[INFO] | | | | +- io.github.resilience4j:resilience4j-bulkhead:jar:2.3.0:compile
[INFO] | | | | +- io.github.resilience4j:resilience4j-timelimiter:jar:2.3.0:compile
[INFO] | | | | +- io.github.resilience4j:resilience4j-retry:jar:2.3.0:compile
[INFO] | | | | +- io.github.resilience4j:resilience4j-ratelimiter:jar:2.3.0:compile
[INFO] | | | | \- javax.cache:cache-api:jar:1.1.1:compile
[INFO] | | | \- org.apache.httpcomponents:httpcore:jar:4.4.16:compile
[INFO] | | +- commons-io:commons-io:jar:2.21.0:compile
[INFO] | | \- io.opentelemetry:opentelemetry-api:jar:1.49.0:compile
[INFO] | | \- io.opentelemetry:opentelemetry-context:jar:1.49.0:compile
[INFO] | +- com.sap.cds:cds4j-core:jar:4.6.2:compile
[INFO] | +- com.sap.cds.repackaged:odata-v4-lib:jar:4.6.2:runtime
[INFO] | | +- commons-codec:commons-codec:jar:1.18.0:compile
[INFO] | | +- org.apache.httpcomponents:httpclient:jar:4.5.14:compile
[INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.19.4:runtime
[INFO] | | | \- org.codehaus.woodstox:stax2-api:jar:4.2.2:runtime
[INFO] | | \- com.fasterxml:aalto-xml:jar:1.3.3:runtime
[INFO] | +- org.slf4j:slf4j-api:jar:2.0.17:compile
[INFO] | \- com.google.guava:guava:jar:33.5.0-jre:compile
[INFO] | +- com.google.guava:failureaccess:jar:1.0.3:compile
[INFO] | +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] | \- com.google.j2objc:j2objc-annotations:jar:3.1:compile
[INFO] +- com.sap.cds:cds-starter-cloudfoundry:jar:4.6.2:runtime
[INFO] | +- com.sap.cds:cds-feature-hana:jar:4.6.2:runtime
[INFO] | | \- com.sap.cloud.db.jdbc:ngdbc:jar:2.26.12:runtime
[INFO] | +- com.sap.cds:cds-feature-mt:jar:4.6.2:runtime
[INFO] | | +- com.sap.cds:cds-integration-cloud-sdk:jar:4.6.2:runtime
[INFO] | | \- com.google.code.gson:gson:jar:2.13.2:runtime
[INFO] | +- com.sap.cds:cds-feature-cloudfoundry:jar:4.6.2:runtime
[INFO] | | \- com.sap.cloud.environment.servicebinding:java-sap-vcap-services:jar:0.21.0:compile
[INFO] | +- com.sap.cds:cds-feature-identity:jar:4.6.2:runtime
[INFO] | | \- com.sap.cloud.security:java-security:jar:3.6.5:compile
[INFO] | | \- com.sap.cloud.security:env:jar:3.6.5:compile
[INFO] | \- org.springframework.boot:spring-boot-starter-security:jar:3.5.10:runtime
[INFO] | +- org.springframework:spring-aop:jar:6.2.15:compile
[INFO] | \- org.springframework.security:spring-security-config:jar:6.5.7:compile
[INFO] +- org.projectlombok:lombok:jar:1.18.42:compile
[INFO] +- com.sap.hcp.cf.logging:cf-java-logging-support-servlet-jakarta:jar:3.8.6:compile
[INFO] | +- com.sap.hcp.cf.logging:cf-java-logging-support-core:jar:3.8.6:compile
[INFO] | | \- com.fasterxml.jackson.jr:jackson-jr-objects:jar:2.19.4:compile
[INFO] | +- com.auth0:java-jwt:jar:4.4.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-databind:jar:2.19.4:compile
[INFO] +- com.sap.hcp.cf.logging:cf-java-logging-support-logback:jar:3.8.6:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:3.5.10:compile
[INFO] | +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:3.5.10:compile
[INFO] | | \- org.springframework.boot:spring-boot-actuator:jar:3.5.10:compile
[INFO] | +- io.micrometer:micrometer-observation:jar:1.15.8:compile
[INFO] | | \- io.micrometer:micrometer-commons:jar:1.15.8:compile
[INFO] | \- io.micrometer:micrometer-jakarta9:jar:1.15.8:compile
[INFO] | \- io.micrometer:micrometer-core:jar:1.15.8:compile
[INFO] | +- org.hdrhistogram:HdrHistogram:jar:2.2.2:runtime
[INFO] | \- org.latencyutils:LatencyUtils:jar:2.0.3:runtime
[INFO] +- com.sap.cloud.security.xsuaa:token-client:jar:3.6.6:compile
[INFO] | +- com.sap.cloud.security:java-api:jar:3.6.5:compile
[INFO] | +- org.json:json:jar:20251224:compile
[INFO] | \- com.github.ben-manes.caffeine:caffeine:jar:3.2.3:compile
[INFO] +- com.sap.ai.sdk:orchestration:jar:1.15.0:compile
[INFO] | +- com.sap.ai.sdk:core:jar:1.15.0:compile
[INFO] | | +- com.sap.cloud.sdk.datamodel:openapi-core:jar:5.25.0:compile
[INFO] | | +- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.19.4:compile
[INFO] | | \- io.github.cdimascio:dotenv-java:jar:3.2.0:compile
[INFO] | +- com.sap.cloud.sdk.cloudplatform:cloudplatform-connectivity:jar:5.25.0:compile
[INFO] | | +- com.sap.cloud.sdk.cloudplatform:cloudplatform-core:jar:5.25.0:compile
[INFO] | | +- com.sap.cloud.sdk.cloudplatform:resilience-api:jar:5.25.0:compile
[INFO] | | +- com.sap.cloud.sdk.cloudplatform:security:jar:5.25.0:compile
[INFO] | | +- org.slf4j:jcl-over-slf4j:jar:2.0.17:runtime
[INFO] | | +- com.mikesamuel:json-sanitizer:jar:1.2.3:compile
[INFO] | | +- org.bouncycastle:bcprov-jdk18on:jar:1.83:compile
[INFO] | | \- org.bouncycastle:bcpkix-jdk18on:jar:1.83:compile
[INFO] | | \- org.bouncycastle:bcutil-jdk18on:jar:1.83:compile
[INFO] | +- com.sap.cloud.sdk.cloudplatform:connectivity-apache-httpclient5:jar:5.25.0:compile
[INFO] | | +- com.sap.cloud.sdk.cloudplatform:caching:jar:5.25.0:compile
[INFO] | | \- com.sap.cloud.sdk.cloudplatform:tenant:jar:5.25.0:compile
[INFO] | +- org.apache.httpcomponents.core5:httpcore5:jar:5.3.6:compile
[INFO] | +- org.apache.httpcomponents.client5:httpclient5:jar:5.5.2:compile
[INFO] | | \- org.apache.httpcomponents.core5:httpcore5-h2:jar:5.3.6:compile
[INFO] | +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.19.4:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.19.4:compile
[INFO] | +- io.vavr:vavr:jar:0.10.7:compile
[INFO] | | \- io.vavr:vavr-match:jar:0.10.7:compile
[INFO] | +- com.github.victools:jsonschema-generator:jar:4.38.0:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.7.3:compile
[INFO] | +- com.github.victools:jsonschema-module-jackson:jar:4.38.0:compile
[INFO] | \- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.19.4:compile
[INFO] +- org.springframework.security:spring-security-test:jar:6.5.7:test
[INFO] | +- org.springframework.security:spring-security-core:jar:6.5.7:compile
[INFO] | | +- org.springframework.security:spring-security-crypto:jar:6.5.7:compile
[INFO] | | +- org.springframework:spring-beans:jar:6.2.15:compile
[INFO] | | \- org.springframework:spring-expression:jar:6.2.15:compile
[INFO] | \- org.springframework.security:spring-security-web:jar:6.5.7:compile
[INFO] +- com.h2database:h2:jar:2.3.232:runtime
[INFO] +- com.sap.sbnc.framework:security-library:jar:1.1.73:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-oauth2-resource-server:jar:3.5.10:compile
[INFO] | +- org.springframework:spring-web:jar:6.2.15:compile
[INFO] | +- com.nimbusds:nimbus-jose-jwt:jar:9.37.2:compile
[INFO] | | \- com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-webflux:jar:3.5.10:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-reactor-netty:jar:3.5.10:compile
[INFO] | | | \- io.projectreactor.netty:reactor-netty-http:jar:1.2.14:compile
[INFO] | | | +- io.netty:netty-resolver-dns:jar:4.1.130.Final:compile
[INFO] | | | | \- io.netty:netty-codec-dns:jar:4.1.130.Final:compile
[INFO] | | | +- io.netty:netty-resolver-dns-native-macos:jar:osx-x86_64:4.1.130.Final:compile
[INFO] | | | | \- io.netty:netty-resolver-dns-classes-macos:jar:4.1.130.Final:compile
[INFO] | | | +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.130.Final:compile
[INFO] | | | | \- io.netty:netty-transport-classes-epoll:jar:4.1.130.Final:compile
[INFO] | | | \- io.projectreactor.netty:reactor-netty-core:jar:1.2.14:compile
[INFO] | | \- org.springframework:spring-webflux:jar:6.2.15:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:10.1.50:compile
[INFO] | | \- org.apache.tomcat:tomcat-annotations-api:jar:10.1.50:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.18.0:compile
[INFO] | \- io.netty:netty-bom:pom:4.1.122.Final:import
[INFO] +- com.sap.sbnc.auditlog:auditlog-cap-client:jar:1.0.102:compile
[INFO] | \- com.sap.sbnc.auditlog:auditlog-client:jar:1.0.102:compile
[INFO] | \- com.sap.sbnc.auditlog:auditlog-common:jar:1.0.102:compile
[INFO] | +- org.springframework:spring-context-support:jar:6.2.15:compile
[INFO] | +- org.apache.zookeeper:zookeeper:jar:3.8.4:compile
[INFO] | | +- org.apache.zookeeper:zookeeper-jute:jar:3.8.4:compile
[INFO] | | +- org.apache.yetus:audience-annotations:jar:0.12.0:compile
[INFO] | | \- io.netty:netty-transport-native-epoll:jar:4.1.130.Final:compile
[INFO] | +- com.sap.ariba.network.cloudstack:hermes-avro-extensions:jar:6.2:compile
[INFO] | +- org.apache.commons:commons-compress:jar:1.28.0:compile
[INFO] | +- org.apache.avro:avro:jar:1.12.0:compile
[INFO] | +- org.apache.avro:avro-compiler:jar:1.11.4:compile
[INFO] | +- com.sap.cloud.environment.servicebinding:java-sap-service-operator:jar:0.10.3:compile
[INFO] | \- com.sap.sbnc.framework:observability-starter:jar:1.1.70:compile
[INFO] | +- com.dynatrace.oneagent.sdk.java:oneagent-sdk:jar:1.9.0:compile
[INFO] | +- io.micrometer:micrometer-tracing-bridge-otel:jar:1.5.8:compile
[INFO] | | +- io.micrometer:micrometer-tracing:jar:1.5.8:compile
[INFO] | | | +- io.micrometer:context-propagation:jar:1.1.3:compile
[INFO] | | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | +- io.opentelemetry.semconv:opentelemetry-semconv:jar:1.32.0:compile
[INFO] | | +- io.opentelemetry:opentelemetry-sdk-common:jar:1.49.0:compile
[INFO] | | +- io.opentelemetry:opentelemetry-sdk-trace:jar:1.49.0:compile
[INFO] | | +- io.opentelemetry:opentelemetry-sdk:jar:1.49.0:compile
[INFO] | | | +- io.opentelemetry:opentelemetry-sdk-metrics:jar:1.49.0:compile
[INFO] | | | \- io.opentelemetry:opentelemetry-sdk-logs:jar:1.49.0:compile
[INFO] | | \- io.opentelemetry:opentelemetry-extension-trace-propagators:jar:1.49.0:compile
[INFO] | +- io.micrometer:micrometer-registry-dynatrace:jar:1.15.8:compile
[INFO] | | \- com.dynatrace.metric.util:dynatrace-metric-utils-java:jar:2.2.1:runtime
[INFO] | \- com.fasterxml.jackson.dataformat:jackson-dataformat-properties:jar:2.19.4:compile
[INFO] +- com.sap.ariba.network.cloudstack:hermes-core:jar:6.11.1:compile
[INFO] | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.19.4:compile
[INFO] | +- org.apache.kafka:kafka-clients:jar:3.9.1:compile
[INFO] | | +- com.github.luben:zstd-jni:jar:1.5.6-4:runtime
[INFO] | | \- org.lz4:lz4-java:jar:1.8.0:runtime
[INFO] | +- org.xerial.snappy:snappy-java:jar:1.1.10.4:compile
[INFO] | +- com.sap.ariba.network.cloudstack:commons-distributed-utils:jar:6.11.1:compile
[INFO] | | +- org.apache.curator:curator-framework:jar:5.3.0:compile
[INFO] | | +- org.apache.curator:curator-client:jar:5.3.0:compile
[INFO] | | \- org.apache.curator:curator-recipes:jar:5.3.0:compile
[INFO] | +- jakarta.annotation:jakarta.annotation-api:jar:2.1.1:compile
[INFO] | +- org.glassfish.jaxb:jaxb-runtime:jar:4.0.6:runtime
[INFO] | | \- org.glassfish.jaxb:jaxb-core:jar:4.0.6:runtime
[INFO] | | +- org.eclipse.angus:angus-activation:jar:2.0.3:runtime
[INFO] | | +- org.glassfish.jaxb:txw2:jar:4.0.6:runtime
[INFO] | | \- com.sun.istack:istack-commons-runtime:jar:4.1.2:runtime
[INFO] | +- org.springframework:spring-webmvc:jar:6.2.15:compile
[INFO] | +- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.9.25:compile
[INFO] | | +- org.jetbrains.kotlin:kotlin-stdlib:jar:1.9.25:compile
[INFO] | | | \- org.jetbrains:annotations:jar:13.0:compile
[INFO] | | \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.9.25:compile
[INFO] | +- com.sap.ariba.network.cloudstack:commons-scripting:jar:6.11.1:compile
[INFO] | | +- org.jetbrains.kotlin:kotlin-reflect:jar:1.9.25:compile
[INFO] | | \- org.codehaus.janino:janino:jar:3.1.12:compile
[INFO] | | \- org.codehaus.janino:commons-compiler:jar:3.1.12:compile
[INFO] | +- com.fasterxml.jackson.module:jackson-module-jsonSchema:jar:2.19.4:runtime
[INFO] | +- com.yammer.metrics:metrics-core:jar:2.2.0:runtime
[INFO] | +- com.codahale.metrics:metrics-core:jar:3.0.2:runtime
[INFO] | \- io.dropwizard.metrics:metrics-core:jar:3.2.5:runtime
[INFO] +- com.sap.ariba.network.cloudstack:hermes-writer:jar:6.11.1:compile
[INFO] +- com.sap.ariba.network.cloudstack:hermes-reader:jar:6.11.1:compile
[INFO] | \- org.springframework.boot:spring-boot-starter-logging:jar:3.5.10:compile
[INFO] | +- ch.qos.logback:logback-classic:jar:1.5.26:compile
[INFO] | | \- ch.qos.logback:logback-core:jar:1.5.26:compile
[INFO] | \- org.slf4j:jul-to-slf4j:jar:2.0.17:compile
[INFO] +- com.sap.cloud.security:resourceserver-security-spring-boot-starter:jar:3.6.5:compile
[INFO] | +- com.sap.cloud.security:spring-security:jar:3.6.5:compile
[INFO] | | \- io.projectreactor:reactor-core:jar:3.7.15:compile
[INFO] | | \- org.reactivestreams:reactive-streams:jar:1.0.4:compile
[INFO] | +- org.springframework.security:spring-security-oauth2-jose:jar:6.5.7:compile
[INFO] | | \- org.springframework.security:spring-security-oauth2-core:jar:6.5.7:compile
[INFO] | \- org.springframework.security:spring-security-oauth2-resource-server:jar:6.5.7:compile
[INFO] +- org.mock-server:mockserver-client-java:jar:5.15.0:test
[INFO] | \- org.mock-server:mockserver-core:jar:5.15.0:test
[INFO] | +- com.lmax:disruptor:jar:3.4.4:test
[INFO] | +- javax.servlet:javax.servlet-api:jar:4.0.1:test
[INFO] | +- io.netty:netty-buffer:jar:4.1.130.Final:compile
[INFO] | +- io.netty:netty-codec:jar:4.1.130.Final:compile
[INFO] | +- io.netty:netty-codec-http:jar:4.1.130.Final:compile
[INFO] | +- io.netty:netty-codec-http2:jar:4.1.130.Final:compile
[INFO] | +- io.netty:netty-codec-socks:jar:4.1.130.Final:compile
[INFO] | +- io.netty:netty-handler:jar:4.1.130.Final:compile
[INFO] | | +- io.netty:netty-resolver:jar:4.1.130.Final:compile
[INFO] | | \- io.netty:netty-transport-native-unix-common:jar:4.1.130.Final:compile
[INFO] | +- io.netty:netty-handler-proxy:jar:4.1.130.Final:compile
[INFO] | +- io.netty:netty-transport:jar:4.1.130.Final:compile
[INFO] | +- io.netty:netty-tcnative-boringssl-static:jar:2.0.74.Final:test
[INFO] | | +- io.netty:netty-tcnative-classes:jar:2.0.74.Final:test
[INFO] | | +- io.netty:netty-tcnative-boringssl-static:jar:linux-x86_64:2.0.74.Final:test
[INFO] | | +- io.netty:netty-tcnative-boringssl-static:jar:linux-aarch_64:2.0.74.Final:test
[INFO] | | +- io.netty:netty-tcnative-boringssl-static:jar:osx-x86_64:2.0.74.Final:test
[INFO] | | +- io.netty:netty-tcnative-boringssl-static:jar:osx-aarch_64:2.0.74.Final:test
[INFO] | | \- io.netty:netty-tcnative-boringssl-static:jar:windows-x86_64:2.0.74.Final:test
[INFO] | +- com.jcraft:jzlib:jar:1.1.3:test
[INFO] | +- com.fasterxml.uuid:java-uuid-generator:jar:4.1.0:test
[INFO] | +- org.apache.velocity:velocity-engine-scripting:jar:2.3:test
[INFO] | +- org.apache.velocity:velocity-engine-core:jar:2.3:compile
[INFO] | +- org.apache.velocity.tools:velocity-tools-generic:jar:3.1:test
[INFO] | | +- commons-beanutils:commons-beanutils:jar:1.9.4:test
[INFO] | | | +- commons-logging:commons-logging:jar:1.2:test
[INFO] | | | \- commons-collections:commons-collections:jar:3.2.2:test
[INFO] | | +- org.apache.commons:commons-digester3:jar:3.2:test
[INFO] | | \- com.github.cliftonlabs:json-simple:jar:3.0.2:test
[INFO] | +- com.samskivert:jmustache:jar:1.16:test
[INFO] | +- net.javacrumbs.json-unit:json-unit-core:jar:2.36.0:test
[INFO] | +- com.networknt:json-schema-validator:jar:1.0.76:test
[INFO] | | \- com.ethlo.time:itu:jar:1.7.0:test
[INFO] | +- io.swagger.parser.v3:swagger-parser:jar:2.1.10:test
[INFO] | | +- io.swagger.parser.v3:swagger-parser-v2-converter:jar:2.1.10:test
[INFO] | | | +- io.swagger:swagger-core:jar:1.6.9:test
[INFO] | | | | \- io.swagger:swagger-models:jar:1.6.9:test
[INFO] | | | | \- io.swagger:swagger-annotations:jar:1.6.9:test
[INFO] | | | +- io.swagger:swagger-parser:jar:1.0.64:test
[INFO] | | | +- io.swagger:swagger-compat-spec-parser:jar:1.0.64:test
[INFO] | | | | +- com.github.java-json-tools:json-schema-validator:jar:2.2.14:test
[INFO] | | | | | +- com.github.java-json-tools:jackson-coreutils-equivalence:jar:1.0:test
[INFO] | | | | | +- com.github.java-json-tools:json-schema-core:jar:1.2.14:test
[INFO] | | | | | | +- com.github.java-json-tools:uri-template:jar:0.10:test
[INFO] | | | | | | \- org.mozilla:rhino:jar:1.8.1:test
[INFO] | | | | | +- com.sun.mail:mailapi:jar:1.6.2:test
[INFO] | | | | | +- joda-time:joda-time:jar:2.10.5:test
[INFO] | | | | | +- com.googlecode.libphonenumber:libphonenumber:jar:8.11.1:test
[INFO] | | | | | \- net.sf.jopt-simple:jopt-simple:jar:5.0.4:test
[INFO] | | | | \- com.github.java-json-tools:json-patch:jar:1.13:test
[INFO] | | | | +- com.github.java-json-tools:msg-simple:jar:1.2:test
[INFO] | | | | | \- com.github.java-json-tools:btf:jar:1.3:test
[INFO] | | | | \- com.github.java-json-tools:jackson-coreutils:jar:2.0:test
[INFO] | | | +- io.swagger.core.v3:swagger-models:jar:2.2.8:test
[INFO] | | | \- io.swagger.parser.v3:swagger-parser-core:jar:2.1.10:test
[INFO] | | \- io.swagger.parser.v3:swagger-parser-v3:jar:2.1.10:test
[INFO] | | \- io.swagger.core.v3:swagger-core:jar:2.2.8:test
[INFO] | | +- io.swagger.core.v3:swagger-annotations:jar:2.2.8:test
[INFO] | | \- jakarta.validation:jakarta.validation-api:jar:3.0.2:test
[INFO] | +- com.sun.xml.bind:jaxb-impl:jar:4.0.6:test
[INFO] | | \- com.sun.xml.bind:jaxb-core:jar:4.0.6:test
[INFO] | +- org.xmlunit:xmlunit-placeholders:jar:2.10.4:test
[INFO] | +- org.apache.commons:commons-text:jar:1.10.0:compile
[INFO] | +- io.github.classgraph:classgraph:jar:4.8.154:test
[INFO] | +- io.prometheus:simpleclient:jar:0.16.0:test
[INFO] | | +- io.prometheus:simpleclient_tracer_otel:jar:0.16.0:test
[INFO] | | | \- io.prometheus:simpleclient_tracer_common:jar:0.16.0:test
[INFO] | | \- io.prometheus:simpleclient_tracer_otel_agent:jar:0.16.0:test
[INFO] | \- io.prometheus:simpleclient_httpserver:jar:0.16.0:test
[INFO] | \- io.prometheus:simpleclient_common:jar:0.16.0:test
[INFO] +- org.mock-server:mockserver-junit-jupiter:jar:5.15.0:test
[INFO] | +- org.mock-server:mockserver-netty:jar:5.15.0:test
[INFO] | | \- io.netty:netty-common:jar:4.1.130.Final:compile
[INFO] | \- org.junit.jupiter:junit-jupiter-engine:jar:5.12.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.12.2:test
[INFO] | \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] \- com.google.truth:truth:jar:1.4.5:test
[INFO] +- org.jspecify:jspecify:jar:1.0.0:compile
[INFO] +- junit:junit:jar:4.13.2:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:3.0:test
[INFO] +- com.google.auto.value:auto-value-annotations:jar:1.11.0:test
[INFO] +- com.google.errorprone:error_prone_annotations:jar:2.41.0:compile
[INFO] \- org.ow2.asm:asm:jar:9.8:runtime
Code Examples
All given variables are working and have the correct values in it.
var config = new OrchestrationModuleConfig()
.withLlmConfig(OrchestrationAiModel.GPT_4O_MINI);
var destination = OAuth2DestinationBuilder.forTargetUrl(aiBaseUrl)
.withTokenEndpoint(authBaseUrl)
.withClient(new ClientCredentials(clientId, clientSecret),
OnBehalfOf.TECHNICAL_USER_CURRENT_TENANT)
.build();
var client = new OrchestrationClient(
new AiCoreService().withBaseDestination(destination)
.getInferenceDestination(RESOURCE_GROUP)
.forScenario(SCENARIO_ID));
var template = TemplateConfig.reference()
.byId(templateId);
var configWithTemplate = config.withTemplateConfig(template);
var inputParams = Map.of("alert_data", payload.toString());
var prompt = new OrchestrationPrompt(inputParams);
OrchestrationChatResponse result = null;
try {
result = client.chatCompletion(prompt, configWithTemplate);
logger.debug("chatCompletion returned: {}", result);
} catch (OrchestrationClientException e) {
logger.error("Error while calling AI Hub chatCompletion", e);
e.printStackTrace();
throw new RuntimeException("Error while calling AI Hub: " + e.getMessage());
}Stack Trace
com.sap.ai.sdk.orchestration.OrchestrationClientException: Request failed with status 400 (Bad Request): Failed to parse the JSON error response MismatchedInputException: Cannot construct instance of `com.sap.ai.sdk.orchestration.model.Error` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('BadRequest') at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 10] (through reference chain: com.sap.ai.sdk.orchestration.model.ErrorResponse["error"])
at com.sap.ai.sdk.orchestration.OrchestrationClientException.lambda$static$0(OrchestrationClientException.java:32)
at com.sap.ai.sdk.core.common.ClientExceptionFactory.build(ClientExceptionFactory.java:27)
at com.sap.ai.sdk.core.common.ClientExceptionFactory.build(ClientExceptionFactory.java:38)
at com.sap.ai.sdk.core.common.ClientResponseHandler.parseErrorResponseAndThrow(ClientResponseHandler.java:157)
at com.sap.ai.sdk.core.common.ClientResponseHandler.buildAndThrowException(ClientResponseHandler.java:142)
at com.sap.ai.sdk.core.common.ClientResponseHandler.handleResponse(ClientResponseHandler.java:71)
at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:247)
at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:188)
at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:162)
at com.sap.ai.sdk.orchestration.OrchestrationHttpExecutor.execute(OrchestrationHttpExecutor.java:65)
at com.sap.ai.sdk.orchestration.OrchestrationClient.executeRequest(OrchestrationClient.java:165)
at com.sap.ai.sdk.orchestration.OrchestrationClient.chatCompletion(OrchestrationClient.java:99)
at com.sap.sbnc.sco.al.service.GenAIService.getSummaryFromAIHub(GenAIService.java:92)
at com.sap.sbnc.sco.al.mapper.ScoEventDtoMapper.generateAiSummary(ScoEventDtoMapper.java:231)
at com.sap.sbnc.sco.al.mapper.ScoEventDtoMapper.mapToAlertEntity(ScoEventDtoMapper.java:83)
at com.sap.sbnc.sco.al.consumer.ScoEventConsumer.consume(ScoEventConsumer.java:61)
at com.sap.sbnc.sco.al.consumer.ScoEventConsumer.consume(ScoEventConsumer.java:1)
at com.sap.ariba.network.hermes.HermesReader.consumeWithWrapper(HermesReader.java:891)
at com.sap.ariba.network.hermes.HermesReader.lambda$processRecord$2(HermesReader.java:635)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
at com.sap.ariba.network.hermes.util.FixedTimeoutFuture.run(FixedTimeoutFuture.java:70)
at com.sap.ariba.network.hermes.util.BlockingThreadPoolExecutor.lambda$execute$0(BlockingThreadPoolExecutor.java:32)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
at java.base/java.lang.Thread.run(Thread.java:1474)
Suppressed: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `com.sap.ai.sdk.orchestration.model.Error` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('BadRequest')
at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1, column: 10] (through reference chain: com.sap.ai.sdk.orchestration.model.ErrorResponse["error"])
at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)
at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1781)
at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1406)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer._deserializeFromString(StdDeserializer.java:310)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromString(BeanDeserializerBase.java:1594)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:189)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:179)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromString(BeanDeserializerBase.java:1587)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:189)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:179)
at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:137)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:392)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:212)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:179)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1492)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:340)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177)
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:342)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4979)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3895)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3863)
at com.sap.ai.sdk.core.common.ClientResponseHandler.lambda$parseErrorResponseAndThrow$a279d846$1(ClientResponseHandler.java:154)
at io.vavr.control.Try.of(Try.java:74)
at com.sap.ai.sdk.core.common.ClientResponseHandler.parseErrorResponseAndThrow(ClientResponseHandler.java:154)
... 22 common frames omitted
com.sap.ai.sdk.orchestration.OrchestrationClientException: Request failed with status 400 (Bad Request): Failed to parse the JSON error response
at com.sap.ai.sdk.orchestration.OrchestrationClientException.lambda$static$0(OrchestrationClientException.java:32)
at com.sap.ai.sdk.core.common.ClientExceptionFactory.build(ClientExceptionFactory.java:27)
at com.sap.ai.sdk.core.common.ClientExceptionFactory.build(ClientExceptionFactory.java:38)
at com.sap.ai.sdk.core.common.ClientResponseHandler.parseErrorResponseAndThrow(ClientResponseHandler.java:157)
at com.sap.ai.sdk.core.common.ClientResponseHandler.buildAndThrowException(ClientResponseHandler.java:142)
at com.sap.ai.sdk.core.common.ClientResponseHandler.handleResponse(ClientResponseHandler.java:71)
at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:247)
at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:188)
at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:162)
at com.sap.ai.sdk.orchestration.OrchestrationHttpExecutor.execute(OrchestrationHttpExecutor.java:65)
at com.sap.ai.sdk.orchestration.OrchestrationClient.executeRequest(OrchestrationClient.java:165)
at com.sap.ai.sdk.orchestration.OrchestrationClient.chatCompletion(OrchestrationClient.java:99)
at com.sap.sbnc.sco.al.service.GenAIService.getSummaryFromAIHub(GenAIService.java:92)
at com.sap.sbnc.sco.al.mapper.ScoEventDtoMapper.generateAiSummary(ScoEventDtoMapper.java:231)
at com.sap.sbnc.sco.al.mapper.ScoEventDtoMapper.mapToAlertEntity(ScoEventDtoMapper.java:83)
at com.sap.sbnc.sco.al.consumer.ScoEventConsumer.consume(ScoEventConsumer.java:61)
at com.sap.sbnc.sco.al.consumer.ScoEventConsumer.consume(ScoEventConsumer.java:1)
at com.sap.ariba.network.hermes.HermesReader.consumeWithWrapper(HermesReader.java:891)
at com.sap.ariba.network.hermes.HermesReader.lambda$processRecord$2(HermesReader.java:635)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
at com.sap.ariba.network.hermes.util.FixedTimeoutFuture.run(FixedTimeoutFuture.java:70)
at com.sap.ariba.network.hermes.util.BlockingThreadPoolExecutor.lambda$execute$0(BlockingThreadPoolExecutor.java:32)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
at java.base/java.lang.Thread.run(Thread.java:1474)
Suppressed: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of com.sap.ai.sdk.orchestration.model.Error (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('BadRequest')
at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1, column: 10] (through reference chain: com.sap.ai.sdk.orchestration.model.ErrorResponse["error"])
at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)
at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1781)
at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1406)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer._deserializeFromString(StdDeserializer.java:310)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromString(BeanDeserializerBase.java:1594)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:189)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:179)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromString(BeanDeserializerBase.java:1587)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:189)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:179)
at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:137)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:392)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:212)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:179)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1492)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:340)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177)
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:342)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4979)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3895)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3863)
at com.sap.ai.sdk.core.common.ClientResponseHandler.lambda$parseErrorResponseAndThrow$a279d846$1(ClientResponseHandler.java:154)
at io.vavr.control.Try.of(Try.java:74)
at com.sap.ai.sdk.core.common.ClientResponseHandler.parseErrorResponseAndThrow(ClientResponseHandler.java:154)
... 22 more
Log File
Log file
...Affected Development Phase
Getting Started
Impact
Blocked
Timeline
We are currently using a REST-based approach to call the Gen AI Hub ourselves. This is not ideal and should be replaced with the SDK as soon as possible. A direct go-live is expected in approximately 12 weeks.