小编Pas*_*kam的帖子

Google云从实例创建图像

我有一个启动并运行的虚拟机,我在虚拟机中只有很少的应用程序.所以我希望拥有这个VM的映像,以便我可以使用所有已安装的包创建新实例.我有一个名为clone的选项,但是克隆一个VM我想把它当作一个Image并随时创建VM.

google-compute-engine

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

禁用POST方法的spring安全性

我有一个如下的弹簧安全配置.

http.authorizeRequests().antMatchers("/css/**").permitAll().and().authorizeRequests().antMatchers("/imgs/**").permitAll().anyRequest()
    .fullyAuthenticated().and()
    //.csrf().disable().authorizeRequests().antMatchers(HttpMethod.POST, "/updatepass/**").permitAll().anyRequest().fullyAuthenticated().and()
    .formLogin().loginPage("/login")
    .failureUrl("/login?error=401").permitAll().and()
    //.csrf().ignoringAntMatchers("/updatepass").and()
    .logout().permitAll().and().csrf().disable()
    .authorizeRequests().antMatchers("/register").hasRole("ADMIN").and()
    .authorizeRequests().antMatchers("/registeruser").hasRole("ADMIN");     
Run Code Online (Sandbox Code Playgroud)

我想允许/updatepassPOST方法允许任何请求,即使它不是一个autherized请求.我尝试了以下注释配置,但它仍然是我的登录页面.

我要打开的目标POST URL是一个可以接收JSON请求的API.并且/updatepass我尝试添加完整的URL /**无效.请不要建议XML配置.请只提供Java配置.

java spring spring-security

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

抛出操作数的子句中的 Spring JPA 应包含 1 列

我正在使用 spring JPA 在 MySql 数据库上进行选择操作

桌子

select id, grp, name from student;

存储库方法

List<Student> findByGrpAndName(String grp, Set<String> name);

它在扔

java.sql.SQLException: Operand should contain 1 column(s) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:127) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95)

我尝试调试 hibernet 代码以查看创建的查询。并且查询有语法错误。

select student0_.name as name1_1_, student0_.grp as grp2_1_ from student student0_ where student0_.grp=? and student0_.name=(? , ?);

它应该是 student0_.name in (? , ?);

我是否错过了告诉 JPA 它应该是一个 in clause

java mysql hibernate spring-data-jpa spring-boot

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

java.lang.OutOfMemoryError:embeded jetty中的PermGen空间

我正在尝试在jetty服务器中部署多个应用程序.目前我有50个应用程序,我正在关注这个jetty服务器的答案 9.1多个嵌入端口和应用程序在同一个服务器实例中.

java.lang.OutOfMemoryError: PermGen space正在进行第38次部署.我该如何解决这个问题?

java eclipse jetty

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