无法自动装配未找到类型的 beans,用于 hybris 中的服务

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

<!-- 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>

这是xml。

这是门面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;
    }

这里是

   private TotalCustomerService totalCustomerService ;

当我输入自动接线时,它说

could not autowire no beans of type found

当我写 resource or resource(name=totalCustomerService)

它给出空指针。

这是 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;

    }

那些是接口

public interface TotalCustomerService {

        List<CustomerModel> getAllCustomersNames (String name);


    }

public interface TotalCustomerFacade {



    List<String> findCustomerContainingName(String firstName);


}

我该如何解决这个问题?

路径都在

de.hybris.training.core

分赞

我能做什么?我需要去做那项服务。我试了很多次。添加了自动装配。删除,让它没有任何注释但仍然相同。

这也不起作用

@Autowired
@Qualifier("totalCustomerService")
    private TotalCustomerService totalCustomerService ;

是因为空格

class=" de.

这里

删除空格! class=" de.hybris.training

改变

<bean id="totalCustomerService" class=" de.hybris.training.core.impl.TotalCustomerServiceImpl">

<bean id="totalCustomerService" class="de.hybris.training.core.impl.TotalCustomerServiceImpl">