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

No implementation for org.telegram.telegrambots.generics.BotSession was bound. #167

Closed adrimarti closed 7 years ago

adrimarti commented 7 years ago

I get this when trying to create a TelegramLongPollingCommandBot.

2016-11-22 09:45:04,839 SEVERE [Telegram Bots Api] (ServerService Thread Pool -- 72) MAIN: com.google.inject.ConfigurationException: Guice configuration errors:

1) No implementation for org.telegram.telegrambots.generics.BotSession was bound.
  while locating org.telegram.telegrambots.generics.BotSession

1 error
    at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1045)
    at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1004)
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1054)
    at org.telegram.telegrambots.ApiContext.getInstance(ApiContext.java:25)
    at org.telegram.telegrambots.TelegramBotsApi.registerBot(TelegramBotsApi.java:83)
    at org.telegram.Main.initBots(Main.java:42)
    at es.adrimarti.myBots.MainContextListener.contextInitialized(MainContextListener.java:23)
    at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
    at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:200)
    at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:171)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
    at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:234)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.jboss.threads.JBossThread.run(JBossThread.java:320)
adrimarti commented 7 years ago

https://github.com/rubenlagus/TelegramBots/issues/161

ghost commented 6 years ago

please Help Us To solve This Problem

msamisimsekli commented 4 years ago

Can you show your code? Where do you initialize your bot and context?