1

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.

Charlie Harper
  • 379
  • 4
  • 7
  • 21
  • That error message looks truncated, so can you show the message in its entirety including any error numbers or stack traces? That is the full error message, then it looks like a product usability issue that should be reported to IBM. – Brett Kail May 01 '16 at 17:27

1 Answers1

0

I strongly suggest viewing the data in the post below first. As indicated in the post below (should be the same for Tomcat or Glassfish) , you may want to first push your app to the Java buildpack before pushing to Liberty.

Can I run my Tomcat app on Bluemix?

Community
  • 1
  • 1
RandalAnders
  • 1,431
  • 9
  • 16