cancel
Showing results for 
Search instead for 
Did you mean: 

could not autowire no beans of type found, for service in hybris

Former Member
0 Kudos
 <!-- Total Customer service dao facade-->
 <bean id="totalCustomersDao"
       class="de.hybris.training.core.dao.impl.TotalCustomersDaoImpl">
     <property name="flexibleSearchService" ref="flexibleSearchService"/>
 </bean>
 
 <bean id="totalCustomerService" class=" de.hybris.training.core.impl.TotalCustomerServiceImpl">
     <property name="totalCustomersDao" ref="totalCustomersDao"/>
 </bean>
 
 <bean id="totalCustomerFacade" class="de.hybris.training.core.facade.impl.TotalCustomerFacadeImpl">
     <property name="totalCustomerService" ref="totalCustomerService"/>
 </bean>
 
 <bean id="usersFindJob" class=" de.hybris.training.core.job.UsersFindJob"
       parent="abstractJobPerformable" >
 
 </bean>

this is xml.

This is facade class

 public class TotalCustomerFacadeImpl implements TotalCustomerFacade {
 
 //TODO autowired or resoucre not work
 
     private TotalCustomerService totalCustomerService ;
 
     private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(UsersFindJob.class);
 
     public TotalCustomerService getTotalCustomerService() {
         return totalCustomerService;
     }
 
     public void setTotalCustomerService(TotalCustomerService totalCustomerService) {
         this.totalCustomerService = totalCustomerService;
     }


here for

    private TotalCustomerService totalCustomerService ;

when i put autorwired, it says

 could not autowire no beans of type found

WHen i write resource or resource(name=totalCustomerService)

it gives null pointer.

this is serviceimpl

 public class TotalCustomerServiceImpl implements TotalCustomerService {
     private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(UsersFindJob.class);
 
     @Autowired
     private TotalCustomersDao totalCustomersDao;
 
     public TotalCustomersDao getTotalCustomersDao() {
         return totalCustomersDao;
     }
     
 
     public void setTotalCustomersDao(TotalCustomersDao totalCustomersDao) {
         this.totalCustomersDao = totalCustomersDao;
     }  public List<CustomerModel> getAllCustomersNames (String name) {     LOG.info("***********************************");
         LOG.info("***********************************");
         LOG.info("*************************getAllCustomersNames::");
         LOG.info("***********************************");
         LOG.info("***********************************");
 
 
         List<CustomerModel> customerModels = totalCustomersDao.findAllCustomersFromDao( name);
 
         return customerModels;
 
     }

those are interfaces

 public interface TotalCustomerService {
 
         List<CustomerModel> getAllCustomersNames (String name);
 
 
     }
 
 public interface TotalCustomerFacade {
 
 
 
     List<String> findCustomerContainingName(String firstName);
 
 
 }

how can i solve this?

the paths are they are all in

de.hybris.training.core

divided like

  • dao

  • facade

  • service

what can i do? I need to go for that service. I tried lots of times. added autowired. removed , let it without any annotations but still same.

Also this did not work

 @Autowired
 @Qualifier("totalCustomerService")
     private TotalCustomerService totalCustomerService ;
former_member384558
Participant
0 Kudos

In what xml file did you put the bean definition? most likely one would put the application context beans into the [your-extension-name]-spring.xml.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

ANswer is empty space