【发布时间】:2020-08-14 05:26:29
【问题描述】:
我开发了一个 Telegram 机器人,我希望它在 Tomcat 环境中运行。我将我的 java 程序转换为 this 的 Spring Boot 项目。
我的转换基本上是在 pom 中添加 spring boot 依赖,并将 main 类作为 spring boot runner。在 Eclipse 环境中,我的应用程序按预期运行。当我把它打包成war并部署到tomcat中时,业务逻辑并没有运行。春季启动启动,我可以看到它的日志。但是电报机器人没有初始化。
我还添加了一个返回“hello”的虚拟 RestController。当我运行 localhost:8080/endpoint 时,我可以看到“hello”。但是,Telegram 机器人未激活。
在一些资源中,他们说 telegrambots-spring-boot-starter 应该在项目中。我的电报依赖包含它。事实并非如此。我在 catalina.out 中没有收到任何错误日志。应用程序刚刚启动并保持原样。我不明白为什么。
感谢任何帮助。
【问题讨论】:
标签: spring-boot tomcat telegram-bot