Springfox 3.0.0 无法与 Spring Boot 2.6.0 一起使用,升级后出现以下错误
org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()" because "this.condition" is null
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181)
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155)
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290)
at com.enkindle.AntivirusApplication.main(AntivirusApplication.java:16)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.getPatterns()" because "this.condition" is null
at springfox.documentation.spring.web.WebMvcPatternsRequestConditionWrapper.getPatterns(WebMvcPatternsRequestConditionWrapper.java:56)
at springfox.documentation.RequestHandler.sortedPaths(RequestHandler.java:113)
at …
Run Code Online (Sandbox Code Playgroud) Spring boot升级报错
Spring Boot应用程序升级到2.6.0后由于循环依赖而无法启动
Error creating bean with name 'securityConfig':
Requested bean is currently in creation: Is there an
unresolvable circular reference?
Run Code Online (Sandbox Code Playgroud) Lombok
添加lib后出现如下错误
An error has occurred. See error log for more details.
Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @1d1c37d5
Run Code Online (Sandbox Code Playgroud) 每当行更新时,是否可以使用“生成的列”在 PostgreSQL 中使用“current_timestamp”(自动)更新列?
目前我正在使用触发器来更新审计字段last_update_date
。但我打算切换到生成的列
ALTER TABLE test ADD COLUMN last_update_date timestamp without time zone
GENERATED ALWAYS AS (current_timestamp) STORED;
Run Code Online (Sandbox Code Playgroud)
更改列时出现错误
ERROR: generation expression is not immutable
Run Code Online (Sandbox Code Playgroud) Julia Computing 提供的 Julia 和 Julia Pro 有什么区别?
Julia Pro 是否有任何在 Julia 中不可用的企业库?
升级到spring-cloud版本后,spring-cloud-config-client无法从spring-cloud-config-server读取配置文件2.4.0
2020.0.0-M6
查询对象,
Student student = return jdbcTemplate.queryForObject("select * from student_id = ?", new Object[] { studentId }, studentRowMapper);
Run Code Online (Sandbox Code Playgroud)
对于查询,
List<Student> students = return jdbcTemplate.query("select * from class_room_id = ?", new Object[] { classRoomId }, studentRowMapper);
Run Code Online (Sandbox Code Playgroud)
双方jdbcTemplate.queryForObject
并jdbcTemplate.query
在上面春季启动2.4.X已被弃用
从 Spring boot 1.5.x 开始,我收到以下警告消息:
:: Spring Boot :: (v2.0.0.RELEASE)
2018-03-17 18:58:18.546 WARN 27877 --- [ restartedMain] o.s.a.f.CglibAopProxy : Unable to proxy interface-implementing method [public final void org.springframework.web.context.support.WebApplicationObjectSupport.setServletContext(javax.servlet.ServletContext)] because it is marked as final: Consider using interface-based JDK proxies instead!
2018-03-17 18:58:18.551 WARN 27877 --- [ restartedMain] o.s.a.f.CglibAopProxy : Unable to proxy interface-implementing method [public final void org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(org.springframework.context.ApplicationContext) throws org.springframework.beans.BeansException] because it is marked as final: Consider using interface-based JDK proxies instead!
2018-03-17 18:58:18.937 WARN 27877 --- [ restartedMain] o.s.a.f.CglibAopProxy …
Run Code Online (Sandbox Code Playgroud) Let's Encrypt Certbot 默认密钥类型已更改为最新版本 2.0.0 的 ECDSA。如何指定生成RSA或ECDSA的密钥类型?
createExpressionHandler
目前,我已经通过覆盖GlobalMethodSecurityConfiguration
. 代码是
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class MethodSecurityConfig extends GlobalMethodSecurityConfiguration {
Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private ApplicationContext applicationContext;
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
CustomMethodSecurityExpressionHandler expressionHandler = new CustomMethodSecurityExpressionHandler();
expressionHandler.setPermissionEvaluator(new CustomPermissionEvaluator());
expressionHandler.setApplicationContext(applicationContext);
return expressionHandler;
}
}
Run Code Online (Sandbox Code Playgroud)
-- CustomMethodSecurityExpressionHandler 类
public class CustomMethodSecurityExpressionHandler extends DefaultMethodSecurityExpressionHandler {
private ApplicationContext applicationContext;
private AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl();
@Override
protected MethodSecurityExpressionOperations createSecurityExpressionRoot(Authentication authentication,
MethodInvocation invocation) {
CustomMethodSecurityExpressionRoot root = new CustomMethodSecurityExpressionRoot(authentication);
root.setPermissionEvaluator(getPermissionEvaluator());
root.setTrustResolver(this.trustResolver);
root.setRoleHierarchy(getRoleHierarchy());
root.setG(this.applicationContext.getBean(CustomTraversalSource.class));
return root;
}
//This setter …
Run Code Online (Sandbox Code Playgroud) spring-boot ×6
java ×5
spring ×3
java-17 ×2
certbot ×1
cglib ×1
ecdsa ×1
eclipse ×1
jdbctemplate ×1
julia ×1
julia-pkg ×1
lets-encrypt ×1
openjdk-17 ×1
postgresql ×1
properties ×1
rsa ×1
springfox ×1
sql ×1
swagger ×1
updates ×1