我目前正在使用 Spring Security 进行 Oauth2 实现,并且我发现了许多ResourceServerConfigurerAdapter与WebSecurityConfigurerAdapter.
我希望有人能告诉我这两种配置之间的区别,因为我真的很困惑使用哪种configure(HttpSecurity http)方法,因为这两个类都提供了一个。
我在 stackoverflow 中发现了一些类似的问题,但没有明确回答。
当使用spring cloud netflix的假客户端从一个微服务发送到另一个微服务的帖子请求时,我在Postman中收到以下错误:
{
"timestamp": 1506933777413,
"status": 500,
"error": "Internal Server Error",
"exception": "feign.codec.EncodeException",
"message": "Could not write JSON: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS); nested exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.springframework.web.multipart.support.StandardMultipartHttpServletRequest$StandardMultipartFile[\"inputStream\"]->java.io.FileInputStream[\"fd\"])",
"path": "/attachments"
}
Run Code Online (Sandbox Code Playgroud)
我的eclipse控制台显示以下异常:
com.fasterxml.jackson.databind.JsonMappingException:没有为类java.io.FileDescriptor找到序列化程序,也没有发现创建BeanSerializer的属性(为了避免异常,请禁用SerializationFeature.FAIL_ON_EMPTY_BEANS)(通过引用链:org.springframework.web.multipart. support.StandardMultipartHttpServletRequest $ StandardMultipartFile ["inputStream"] - > java.io.FileInputStream ["fd"])at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:284)〜[jackson-databind-2.8. 9.jar:2.8.9]在com.fasterxml.jackson的com.fasterxml.jackson.databind.SerializerProvider.mappingException(SerializerProvider.java:1110)〜[jackson-databind-2.8.9.jar:2.8.9]. databind.SerializerProvider.reportMappingProblem(SerializerProvider.java:1135)〜[jackson-databind-2.8.9.jar:2.8.9] at …