我是 Spring Boot 的新手,在编写文件上传 API 时出现以下错误:
Error:Description:
Field fileStorageService in com.primesolutions.fileupload.controller.FileController required a bean of type 'com.primesolutions.fileupload.service.FileStorageService' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.primesolutions.fileupload.service.FileStorageService' in your configuration.*
Run Code Online (Sandbox Code Playgroud)
控制器类:
public class FileController
{
private static final Logger logger = LoggerFactory.getLogger(FileController.class);
@Autowired
private FileStorageService fileStorageService;
@PostMapping("/uploadFile")
public UploadFileResponse uploadFile(@RequestParam("file") MultipartFile file) {
String fileName = fileStorageService.storeFile(file);
String fileDownloadUri = ServletUriComponentsBuilder.fromCurrentContextPath()
.path("/downloadFile/")
.path(fileName)
.toUriString();
return new UploadFileResponse(fileName, fileDownloadUri, …
Run Code Online (Sandbox Code Playgroud) 我遇到了Clion(1.0.1)和CMakeLists.txt的问题.
我使用GitHub作为我的项目,我直接在IDE中提交它们.如果我然后在另一台计算机上签出项目,IDE将在原始PC的目录中查找CMakeLists.txt.
Clion报告的具体错误消息是:
Error: CmakeLists.txt not found in C:\Users\Chris\ClionProjects\SDLTestClion
Run Code Online (Sandbox Code Playgroud)
但是,这是一台Linux机器,所以显然没有C盘.
这是我尝试过的:
我找不到任何其他内容,所以要么我遗漏了某些内容,要么在版本1.0.1中出现问题,我需要筛选项目文件以更改Clion查找CMakeLists.txt文件的路径.