如何解决Springboot应用程序中的Nullpointer异常用作从属jar
我正在使用springboot应用程序作为独立Java应用程序中的依赖项。
在实用程序方法中使用的自动连接(bService)类出现空指针异常。
父应用程序中的主要方法---
{
BatchProcessor obj = new BatchProcessor;
obj.getBatchStatus(123);
}
------------------- Spring Boot Ccode ----
public class BatchProcessor {
@Autowire
IBatchService bSerice;
public int getBatchStatus(int batch_id){ return bSerice.getStauts(batch_id);}
}
interface IBatchService {}
@Service
public class CBABatchService implements IbatchService{ public int getStatus(int id){}}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。