0

So far no body has answered for this simple question in spring boot. Here are my code snippet : Interface:

public  interface myInterface{
public void getMyMethod();
}

Implementation :

@Service
public  class myInterfaceImpl implements myInterface{

@Override
public void getMyMethod();{
System.out.println("Success");
}
}

Third class :

public class myCallerClass(){

@Autowired public myInterface myInterface;
public void start(String arg_template) throws Exception {
myInterface.getMyMethod(); //myInterface is Null
}
}

I did try to do autowiring but unable to solve the null pointer exception on the interface called from third class

0 Answers0