gpt4 book ai didi

java - 在最新的 spring-security-oauth2-2.0.6.RELEASE.jar 中找不到 TokenServicesUserApprovalHandler

转载 作者:搜寻专家 更新时间:2023-10-31 19:45:30 25 4
gpt4 key购买 nike

<bean id="userApprovalHandler" class="org.springframework.security.oauth2.provider.approval.TokenServicesUserApprovalHandler">
<property name="tokenServices" ref="tokenServices" />
</bean>

我的 spring-security.xml 中的以下代码与 spring-security-oauth2-1.0.1.RELEASE.jar 一起工作,但是当我将它升级到 spring-security-oauth2-2.0.6.RELEASE.jar 时,上面的文件即“org.springframework.security.oauth2.provider.approval.TokenServicesUserApprovalHandler”未找到。

我这样做是因为之前的 jar 由于 Spring 4.1.X 而与 jackson 有一些冲突

17:14:53,679 WARN [org.springframework.web.context.support.XmlWebApplicationContext] (MSC service thread 1-1) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'userController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.security.oauth2.provider.token.DefaultTokenServices
com.aricent.ans.controller.um.UserController.tokenServices; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tokenServices' defined in ServletContext resource [/WEB-INF/spring-security.xml]: Cannot
resolve reference to bean 'clientDetails' while setting bean property 'clientDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clientDetails' defined in ServletContext resource
[/WEB-INF/spring-security.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.security.oauth2.provider.JdbcClientDetailsService]: Constructor
threw exception; nested exception is java.lang.NoClassDefFoundError: org/codehaus/jackson/map/ObjectMapper

最佳答案

这是您使用的 Spring OAuth2 版本的变化。试试这个:

<bean id="userApprovalHandler" class="org.springframework.security.oauth2.provider.approval.TokenStoreUserApprovalHandler">
<property name="tokenStore" ref="tokenStore"/>
</bean>

关于java - 在最新的 spring-security-oauth2-2.0.6.RELEASE.jar 中找不到 TokenServicesUserApprovalHandler,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28734386/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com