Just in case some other poor sod ends up here because they are having the same issue I was: if you have multiple data sources and this is happening with the non-primary data source, then the problem might be with that config. The data source, entity manager factory, and transaction factory all need to be correctly configured, but also -- and this is what tripped me up -- MAKE SURE TO TIE THEM ALL TOGETHER! @EnableJpaRepositories
(configuration class annotation) must include entityManagerFactoryRef
and transactionManagerRef
to pick up all the configuration!
The example in this blog finally helped me see what I was missing, which (for quick reference) were the refs here:
@EnableJpaRepositories(
entityManagerFactoryRef = "barEntityManagerFactory",
transactionManagerRef = "barTransactionManager",
basePackages = "com.foobar.bar")
Hope this helps save someone else from the struggle I've endured!