Hi,
I create a my own class and try to inject a service into the class. But this service can’t be initialized automatically. It shows an “NullPointerException” error when I call a method in this service. This service works well when it’s injected in editor class which is generated by CUBA-PLATFORM.
public class IPManager {
@Inject
private GetTestdefbyTestspecService testSpecService;
@Inject
private Metadata metadata;
public ArrayList<IPDETAIL> CreateIPDetailByItem(IPHEADER ipHeader, String ItemNum, Date beginDate, Date endDate)
{
ArrayList<TESTSPEC> testspecArrayList =
testSpecService.GetTestdefbyTestspec(ItemNum,beginDate,endDate); //NullPointerException here.
}