Search code examples
liferay-7finder

Liferay 7.2 Finder unsatisfied references


I have Liferay 7.2

I created a module service " blogentriesfinderservice".

I used service builder to create entity.

Now i want a custom query.

I created FooFinderImpl but i have this error in liferay:

Bundle {id: 4459, name: blogentriesfinderservice.service, version: 1.0.0}
    Declarative Service {id: 4932, name: blogentriesfinderservice.service.impl.FooLocalServiceImpl, unsatisfied references: 
        {name: fooFinder, target: null}
    }
    Declarative Service {id: 4933, name: blogentriesfinderservice.service.impl.FooServiceImpl, unsatisfied references: 
        {name: fooFinder, target: null}
        {name: fooLocalService, target: null}
    }

This is the code of FooFinderImpl

package blogentriesfinderservice.service.persistence.impl;

import java.util.List;

import com.liferay.portal.kernel.dao.orm.Session;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.service.persistence.impl.BasePersistenceImpl;


import blogentriesfinderservice.model.Foo;
import blogentriesfinderservice.model.impl.FooImpl;
import blogentriesfinderservice.service.persistence.FooFinder;

import com.liferay.portal.dao.orm.custom.sql.CustomSQLUtil;
import com.liferay.portal.kernel.dao.orm.QueryPos;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.SQLQuery;

public class FooFinderImpl extends FooFinderBaseImpl implements FooFinder  {

    
    public String findByDentroFinder() {

         return "test";
    }
    
    
}

Solution

  • I found the solution.

    I need to add this code before class declaration:

    @Component(
            service = FooFinder.class
    )