I have the following code. When I run the code, I always get an NoSuchBeanDefinitionException exception on "serviceB".

Could any expert tell me what's the problem of the code or how can I make serviceB reuse code of serviceA?

Thanks in advance.

Code:
@Service("serviceA")
public class ClassA{
...
}

@Service("serviceB")
public class ClassB extends ClassA{
...
}