Inject not working for nested objects[Jersey 2.22.1]
<p>I have a Jersey resource with a facade object injected. This is configured in my <code>ResourceConfig</code> and the facade gets injected fine. The facade contains a DAO class which also should be injected and is configured in the same <code>ResourceConfig</code>. Now to my problem; the DAO class is null. Thus, not injected.</p>

<pre><code>@ApplicationPath("/service")
public class SystemSetup extends ResourceConfig {

public SystemSetup() {
    packages(false, "com.foo.bar");
    packages("org.glassfish.jersey.jackson");
    register(JacksonFeature.class);

    final LockManager manager = getLockManager();
    final SessionFactory sessionFactory = getSessionFactory();
    register(new AbstractBinder() {
        @Override
        protected void configure() {
            bindFactory(InjectFactory.getDaoFactory(sessionFactory)).to(Dao.class).in(Singleton.class);
            bindFactory(InjectFactory.getFacadeFactory(manager)).to(Facade.class).in(Singleton.class);
        }
    });
}
</code></pre>

<hr>

<pre><code> @Path("/")
 @Produces("text/json")
 public class ViewResource {

    @Inject
    private Facade logic;
</code></pre>

<hr>

<pre><code>public class Facade {

    @Inject
    private Dao dao; //Not injected
</code></pre>

<p>The factory instances are rather simple. They simply call the constructor and pass the argument to it.</p>

<p>The strange thing is that this worked absolut fine when I used bind(Class object) rather than bindFactory.</p>

<p><strong>EDIT</strong></p>

<p>Factories</p>

<pre><code>class InjectFactory {

    static Factory&lt;Dao&gt; getDaoFactory() {
        return new Factory&lt;Dao&gt;() {
            @Override
            public Dao provide() {
                return new Dao(new Object());
            }

            @Override
            public void dispose(Dao dao) {}
        };
    }

    static Factory&lt;Facade&gt; getFacadeFactory() {
        return new Factory&lt;Facade&gt;() {

            @Override
            public Facade provide() {
                return new Facade();
            }

            @Override
            public void dispose(Facade facade) {}
        };
    }
}
</code></pre>