I just pushed new version of my Java EE 7 application into IBM bluemix cloud. With this commit I added @Inject annotation to inject a bean, this are my codes: Model class:
@Model
public class MyModel {
// methods
}
And this is class where I want to inject MyModel:
@Stateless
public class MyExample {
@Inject
private MyModel myModel;
// methods
}
What am I doing wrong? It works locally on glassfish server. IBM is using Websphere liberty. I guess my annotations are wrong since I'm pretty new to JavaEE.
The error message says: com.ibm.wsspi.injectionengine.InjectionException: The @Inject java.lang.reflect.Field.myModel reference of type com.example.MyModel for the null component in the myapp.war module of the myapp.