I am Chinese, please forgive me if my English is not good
bug demo project
https://github.com/social-uni/spring-cache-bug
run TestcacheApplication
input url in browser
https://localpc.qingchiapp.com:8097/app/hello?adCode=100000
modify pom file
get success
//pom
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.9</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<!--<dependencyManagement>
<dependencies>
<!– https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies –>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.4.9</version>
<!– 所有依赖包的版本控制统一 –>
<type>pom</type>
<!– 仅支持type=pom,仅用来pom间互相引用,减少父pom体积–>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>-->
get error
<!--<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.9</version>
<relativePath/> <!– lookup parent from repository –>
</parent>-->
<dependencyManagement>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.4.9</version>
<!-- 所有依赖包的版本控制统一 -->
<type>pom</type>
<!-- 仅支持type=pom,仅用来pom间互相引用,减少父pom体积-->
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Comment From: snicoll
@social-uni thanks for the sample but downloading the code requires to register on this site. Can you please attach a zip with the project to this issue?
Comment From: alamhubb
@social-uni感谢您提供示例,但下载代码需要在此站点上注册。您能否在此问题上附上项目的 zip 文件?
hi, this is zip
Comment From: alamhubb
submit project on github
https://github.com/social-uni/spring-cache-bug
Comment From: wilkinsona
Thanks for the sample. The exception message hints at the cause of the problem:
Null key returned for cache operation (maybe you are using named params on classes without debug info?)
When you switch to importing spring-boot-dependencies
, your code is no longer compiled with -parameters
as you no longer inherit Spring Boot's customization of the compiler plugin's configuration.
Enabling -parameters
should be listed in the documentation but it is not. We can use this issue to add it.