osgiipojo

iPOJO @Requires is null


When I use the iPOJO and the @Requires annotation it is not injected into the consumer.

Consumer:

@Component
@Provides
@Instantiate
@Content(name = "bean")
public class BeanContentHandler extends ContentHandler
{  
    @Requires
    private IContentMapper mapper;

Provider:

@Component
@Provides
public class JcromContentMapper implements IContentMapper
{
    protected static final Jcrom JCROM = new Jcrom(true, false);

Solution

  • I see two potential issues:

    Can you also tell me where is used the mapper field ?