My Jersey Java classes looks like this:
@Component
...class...MyComponent...extends myParent
And in the parent class:
...abstract class myParent...
@Autowired
SomeBean myAutowiredBean
I get some strange warnings when my server starts about:
Nov 14, 2014 10:41:23 AM org.glassfish.jersey.server.spring.SpringComponentProvider bind SEVERE: None or multiple beans found in Spring context for type class ...myPackageAndClassHere..., skipping the type.
Despite the warning message everything works as intended. Every class extending the parent has this warning. Has this to do with the abstract nature of the parent class ?
I found this page where someone else has a similar issue, is this a jersey/spring problem ? I use Jersey 2.11 and Spring 3.2.3.
I faced the same problem. My REST resources responded correctly, but I got the same SEVERE Message. Actually, if trying to inject some of my beans into some of the REST service, I got NullPointerException on any bean injected call.
What happened is that jersey initialized the rest services but did not initialize my spring beans (Let me say...correctly, I had to!!)
I solved just making spring aware of my bean :)
Just add context:component-scan base-package="myPackage"
The warning (and NullPointers) disappeared!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With