circular dependency in spring using @Autowired -


i've been facing problem of circular dependency in spring.

public class userserviceimpl implements userservice{    @autowired    private roleservice roleservice; }  public class roleserviceimpl implements roleservice{    @autowired    private userservice userservice; } 

is there solution deal problem, still want use @autowired. other solutions might wire them manually. or using bean awares or using bean post processor.

the working solution add default-lazy-init="true" application config xml file

details here.