I'm guessing the issue is due to the fact that the SocialContext is annotated with @Profile("application")
. If you run the application using the maven jetty plugin is setup to specify the system property spring.profiles.active=application
which activates the profile and thus ensures that the UsersConnectionRepository is exposed as a bean.
Ensure you are using the same system property on Tomcat and it should work just fine. If you have trouble specifying the system property, you can remove the @Profile("application")
from the SocialContext class.