alibaba / alibaba/fastjson2

[BUG]class com.alibaba.fastjson2.JSONObject cannot be cast to class org.springframework.ai.chat.messages.Message (com.alibaba.fastjson2.JSONObject and org.springframework.ai.chat.messages.Message are in unnamed module of loader 'app')

Open
#3,339 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
4.4k
Forks
613
Avg merge
1d 22h
Merged PRs (30d)
6

Description

### 问题描述
*简要描述您碰到的问题。*

spring-ai vision: M5
项目中运行 String response = client.prompt(prompt).user(query).call().content();
报错,报错信息如下:
class com.alibaba.fastjson2.JSONObject cannot be cast to class org.springframework.ai.chat.messages.Message (com.alibaba.fastjson2.JSONObject and org.springframework.ai.chat.messages.Message are in unnamed module of loader 'app')

此段代码并未使用到fastJson2 为何会有次错误信息

### 环境信息
*请填写以下信息:*

- OS信息: maos
- JDK信息: 21
- 版本信息:2.0.53

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by reproducing the shown client.prompt(...).user(...).call().content() example with Spring AI vision M5, Java 21, and fastjson2 2.0.53, then inspect the complete stack trace and dependency versions; done means the cast failure is explained and a verified fix or compatibility boundary is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.