I was successfully able to integrate OAuth2 to my previous application (a REST service) by replacing BASIC auth.
Then I got the following exception:
No qualifying bean of type [org.springframework.transaction.PlatformTransactionManager] is defined: expected single matching bean but found 2: transactionManagerDB2,transactionManager
When I remove the bean transactionManagerDB2
it started to working fine.
I have 2 transaction managers because I have 2 connected databases.
Since I have a InMemoryTokenStore
, I'm curious about the require of a TransactionManager
. (And why Oauth is not able pick up "transactionManager" by default name)
Somehow I have configured a CustomeUserDetailService via configureGlobal(AuthenticationManagerBuilder auth){}
, which was working fine before and now with a single TransactionManager.
I used sparklr-boot Spring Boot application to integrate OAuth with my application. (Thanks to Dave Syer to make such simple easy to understand example)
I'm using:
- Spring 4.2.5
- Spring Security 4.0.4
- Spring OAuth 2.0.9
- (No Spring Boot)