Apr 18th, 2011, 10:38 AM
Can't get rid of "No unique bean found" OR "StackOverflowError"
I have a standard Java EE Setup with Hibernate and Spring. I want to accomplish normal inheritance, one parent 2 children. The problem is that at lesat the parent has to be a spring bean. If all 3 are beans (@Service("csv...Service")) and I extend the parent in the children I get a "No unique bean found"-exception when Initializing the Spring root WebApplicationContext. If I only declare the parent as a bean, (@Service("csv...Service")), and create the 2 children as normal class instances, I get a StackOverflowError. It's calling the constructor hundreds of times for one of the children.
Apr 18th, 2011, 11:19 AM
Can you be more specific for the use of your beans?
You should normally declare only the 2 childreen bean @Service("xxx1") and @Service("xxx2"); then autowire the 2 beans with
Or use the @Qualifier to select the correct bean