Java - @Inject - Nullpointer "this.xxx is null"

1.2k views Asked by At

Im using Quarkus for my java project. I want to Inject a external Bean but I alway get an NullPointerException with this error message:

java.lang.NullPointerException: Cannot invoke "xxx(yyy)" because "this.xy" is null

My code snippet:

@Service
@ApplicationScoped

public class xxx{
    @Inject
    @CXFClient
    MyClass myClass;

public void doSomething() {
myClass.methodOflcass(xxx)
}

I can't access to "myClass".

0

There are 0 answers