I would like use CDI with POJO.
Now have a Jaxrs Resteasy webapp running in Wildfly 10.1.0.Final.
There is a singleton which returns a ServiceImpl class:
public class ServiceFactory {
private static Service service = new ServiceImpl();
public static Service getEnvsApi()
{
return service;
}
}
And I would like use CDI inside ServiceImpl class
public class ServiceImpl extends Service {
@Inject
private MyData myData;
@Override
public MyData getData()
{
return myData;
}
}
but myData
is always null.
Have I to start Weld manually?