java.lang.NullPointerException: null
at org.telegram.telegrambots.bots.DefaultAbsSender.sendHttpPostRequest(DefaultAbsSender.java:765) ~[telegrambots-4.1.jar:na]
at org.telegram.telegrambots.bots.DefaultAbsSender.execute(DefaultAbsSender.java:226) ~[telegrambots-4.1.jar:na]
at org.vors.telegram.fivemin.service.MessageService.sendPhoto(MessageService.java:107) ~[classes/:na]
In Spring, when bot is an injected dependency of MyBotClass type, execute(SendPhoto) fails as well as the other PartialBotApiMethod.
Solution: Inject bot as AbsSender
Cause: DefaultAbsSender.execute(SendPhoto) - final, CGLIB proxy cannot call the real class https://stackoverflow.com/questions/34563058/spring-aop-cglib-proxys-field-is-null