小编Chr*_*der的帖子

注入点有以下注释: - @org.springframework.beans.factory.annotation.Autowired(required=true)

我是 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)

java spring-boot

9
推荐指数
2
解决办法
6万
查看次数

切换PC时未找到Clion CMakeLists.txt

我遇到了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盘.

这是我尝试过的:

  • 文件>无效缓存/重新启动
  • 更改项目根目录(来自CMake窗口;显而易见的解决方案)
  • 文件>设置>构建,执行,部署> CMake
    • 此处没有指示上述目录的设置或变量.

我找不到任何其他内容,所以要么我遗漏了某些内容,要么在版本1.0.1中出现问题,我需要筛选项目文件以更改Clion查找CMakeLists.txt文件的路径.

cmake clion

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

clion ×1

cmake ×1

java ×1

spring-boot ×1