小编Lah*_*age的帖子

此环境中不提供编译器。也许您在 IntelliJ 中运行于 JRE 而不是 JDK

我尝试在 Intellij 中进行 mvn clean install 。但它引发了这个错误。 在此输入图像描述

mvn -version 命令在 intellij 终端中工作正常。

在此输入图像描述

intellij-idea maven maven-compiler-plugin

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

如何在Spring Boot中以Spring Security级别启用CORS

我正在使用使用Spring Security的Spring Boot应用程序。我尝试了@CrossOrigin来启用cors,但是没有用。

如果要查找我的错误,请参考

Spring Blogs说,当我们使用Spring Security时,必须在spring安全级别启用cors

我的项目在下面。

谁能解释我应该将那些配置放在哪里以及如何找到spring安全级别。

java spring spring-security cors spring-boot

4
推荐指数
2
解决办法
8372
查看次数

无法自动装配.找不到'NoteRepository'类型的bean

我的Controller类如下.

@Controller
public class app {

    @GetMapping(path = "/")
    public @ResponseBody
    String hello() {
        return "Hello app";
    }
}
Run Code Online (Sandbox Code Playgroud)

当我浏览网址时,它工作正常.但是,当添加以下代码时,它说"Could not autowire. No beans of 'NoteRepository' type found".

@Autowired
    NoteRepository noteRepository;

    // Create a new Note
    @PostMapping("/notes")
    public Note createNote(@Valid @RequestBody Note note) {
        return noteRepository.save(note);
    }
Run Code Online (Sandbox Code Playgroud)

App控制器类主类(运行应用程序)所在的包相同.但是当我们将上面的代码添加到不同包中的控制器时,它不会显示错误.但是当我们通过url导航甚至是一个简单的get方法时它不起作用.

我的主要课程如下.

@SpringBootApplication
@EnableJpaAuditing
public class CrudApplication {

    public static void main(String[] args) {
        SpringApplication.run(CrudApplication.class, args);
    }
}
Run Code Online (Sandbox Code Playgroud)

我的Repository类是

@Repository
public interface NoteRepository …
Run Code Online (Sandbox Code Playgroud)

java spring spring-boot

2
推荐指数
1
解决办法
5670
查看次数

Spring Boot / Http call angular 2没有角度的``Access-Control-Allow-Origin''

我正在尝试 通过angular http callspring boot服务器获取数据到angular应用程序。另外,我还为Spring Boot应用程序添加了安全性依赖性。

当我尝试使用浏览器时,它会来。

在此处输入图片说明

在Intellij控制台中输入密码后,它将显示响应。

在此处输入图片说明

当我尝试使用有角度的http调用时,它失败并显示关于主题的错误。

我的角度组件具有以下代码。

constructor(private http: HttpClient) { 
    http.get('http://localhost:8080/resource').subscribe(data => this.greeting = data);
}
Run Code Online (Sandbox Code Playgroud)

我的Spring Boot应用程序具有以下代码

@RequestMapping("/resource")
public Map<String,Object> home() {
      Map<String,Object> model = new HashMap<String,Object>();
      model.put("id", UUID.randomUUID().toString());
      model.put("content", "Hello World");
      return model;
}
Run Code Online (Sandbox Code Playgroud)

我也阅读了有关跨域资源共享(CORS)的信息,但目前尚不清楚如何将其应用于角度。

我的错误是:

在此处输入图片说明

cors spring-boot angular

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

什么是开发.Net Core应用程序的IDE?

我想学习.net核心应用程序开发。我目前正在使用Visual Studio 2012

是否可以使用Visual Studio 2012开发.net核心应用程序,还是必须使用Visual Studio 2017.net核心开发?

.net visual-studio visual-studio-2012 .net-core

0
推荐指数
1
解决办法
4259
查看次数