0

I have used to @Named and @Inject several time at office project which works good. I have a personal project where I am implementing in the same way that I had implemented at office work, I am getting below error while deploying the code in tomcat. Did I miss something here? I have used the inject dependency in POM

"org.springframework.beans.factory.NoSuchBeanDefinitionException". No qualifying bean of type [com.howtodoinjava.service.TicketService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.inject.Inject()}

following is the code:

@Named
public class TicketServiceImpl implements TicketService{
//do some work here
}

@RestController  
public class TicketController {      
    @Inject     
    private TicketService ticketService; 
    //call service method and dosomething 
}
SKK
  • 1,705
  • 3
  • 28
  • 50
Jacob
  • 420
  • 5
  • 15

0 Answers0