rubenlagus / TelegramBots

Java library to create bots using Telegram Bots API
https://telegram.me/JavaBotsApi
MIT License
4.77k stars 1.22k forks source link

Warnings in telegrambots-spring-boot-starter, Spring integration #667

Open EXL opened 5 years ago

EXL commented 5 years ago

These warnings appear when the Spring application starts:

03:01:22.550 [restartedMain] DEBUG org.telegram.telegrambots.meta.ApiContext - Class org.telegram.telegrambots.meta.generics.BotSession already registered
03:01:22.557 [restartedMain] DEBUG org.telegram.telegrambots.meta.ApiContext - Class org.telegram.telegrambots.meta.generics.Webhook already registered

Is this ok?

Spring Boot v2.1.5.RELEASE telegrambots v4.4.0.1 telegrambots-spring-boot-starter v4.4.0.1

rubenlagus commented 5 years ago

That error means that you are calling the initialization more than one: https://github.com/rubenlagus/TelegramBots/blob/master/telegrambots/src/main/java/org/telegram/telegrambots/ApiContextInitializer.java#L18

There should be no problems tho

EXL commented 4 years ago

It looks like this warning occurs when the bot is launched from IntelliJ IDEA. If I run a bot outside of IDEA, a warning does not appear.