Гитхаб проекта:https://github.com/DeadSidert/telegramBotMoney Первый раз деплою приложения.
Stackrace:
07:34:41.413 [main] INFO com.nikita.App - Starting App on dsde1081-22288.fornex.org with PID 68272 (/root/telegramBotMoney.jar started by root in /root)
07:34:41.416 [main] DEBUG com.nikita.App - Running with Spring Boot, Spring
07:34:41.417 [main] INFO com.nikita.App - No active profile set, falling back to default profiles: default
07:34:41.418 [main] DEBUG org.springframework.boot.SpringApplication - Loading source class com.nikita.App
07:34:41.573 [main] DEBUG org.springframework.context.annotation.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@4461c7e3
07:34:41.589 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnn otationProcessor'
07:34:41.703 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/bot/Bot.class]
07:34:41.732 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Ignored because not a concrete top-level class: URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/repos itory/JpaChannelCheckRepository.class]
07:34:41.734 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Ignored because not a concrete top-level class: URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/repos itory/JpaChannelRepository.class]
07:34:41.735 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Ignored because not a concrete top-level class: URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/repos itory/JpaPaymentRepository.class]
07:34:41.736 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Ignored because not a concrete top-level class: URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/repos itory/JpaUserRepository.class]
07:34:41.742 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/service/Channel CheckService.class]
07:34:41.743 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/service/Channel Service.class]
07:34:41.747 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/service/Payment Service.class]
07:34:41.748 [main] DEBUG org.springframework.context.annotation.ClassPathBeanDefinitionScanner - Identified candidate component class: URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/service/UserSer vice.class]
07:34:41.928 [main] INFO org.springframework.data.repository.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode.
07:34:41.952 [main] DEBUG org.springframework.data.repository.config.RepositoryConfigurationDelegate - Scanning for JPA repositories in packages com.nikita*.
07:34:42.005 [main] DEBUG org.springframework.data.repository.config.RepositoryComponentProvider - Identified candidate component class: URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/repository/Jpa ChannelCheckRepository.class]
07:34:42.005 [main] DEBUG org.springframework.data.repository.config.RepositoryComponentProvider - Identified candidate component class: URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/repository/Jpa ChannelRepository.class]
07:34:42.006 [main] DEBUG org.springframework.data.repository.config.RepositoryComponentProvider - Identified candidate component class: URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/repository/Jpa PaymentRepository.class]
07:34:42.006 [main] DEBUG org.springframework.data.repository.config.RepositoryComponentProvider - Identified candidate component class: URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/repository/Jpa UserRepository.class]
07:34:42.125 [main] INFO org.springframework.data.repository.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 169ms. Found 4 JPA repository interfaces.
07:34:42.276 [main] DEBUG org.telegram.telegrambots.meta.ApiContext - Class org.telegram.telegrambots.meta.generics.BotSession already registered
07:34:42.276 [main] DEBUG org.telegram.telegrambots.meta.ApiContext - Class org.telegram.telegrambots.meta.generics.Webhook already registered
07:34:42.279 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'emBeanDefinitionRegistrarPostProcessor'
07:34:42.293 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerProcesso r'
07:34:42.294 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerFactory'
07:34:42.296 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotat ionProcessor'
07:34:42.299 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotation Processor'
07:34:42.308 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalPersistenceAnnot ationProcessor'
07:34:42.311 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalScheduledAnnotat ionProcessor'
07:34:42.315 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.scheduling.annotation.SchedulingConfigurati on'
07:34:42.351 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'app'
07:34:42.356 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'bot'
07:34:42.422 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'channelService'
07:34:42.426 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'jpaChannelRepository'
07:34:42.540 [main] WARN org.springframework.context.annotation.AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.b eans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bot' defined in URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/bot/Bot.class]: Unsatisfied dependency expressed through co nstructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'channelService' defined in URL [jar:file:/root/telegramBotMoney. jar!/com/nikita/service/ChannelService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaChannelRepository' defined in com.nikita.repository.JpaChannelRepository defined in @EnableJpaRepositories declared on App: Cannot create inner bean '(inner bean)#207b8649' of type [or g.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with nam e '(inner bean)#207b8649': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'entityManagerFactory' available
07:34:42.549 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bot' defined in URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/bot/Bot.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'channelService' defined in URL [jar:file:/r oot/telegramBotMoney.jar!/com/nikita/service/ChannelService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jpaChannelRepository' defined in com.nikita.repository.JpaChannelRepository defined in @EnableJpaRepositories declared on App: Cannot create inner bean '(inner bean)# 207b8649' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error c reating bean with name '(inner bean)#207b8649': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBean DefinitionException: No bean named 'entityManagerFactory' available
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:797)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:227)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1203)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at com.nikita.App.main(App.java:17)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'channelService' defined in URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/service/ChannelS ervice.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaChannelRepos itory' defined in com.nikita.repository.JpaChannelRepository defined in @EnableJpaRepositories declared on App: Cannot create inner bean '(inner bean)#207b8649' of type [org.springframework.orm.jpa.Shared EntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#207b8649': Canno t resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'entityManagerFact ory' available
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:797)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:227)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1203)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:884)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
... 18 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaChannelRepository' defined in com.nikita.repository.JpaChannelRepository defined in @EnableJpaReposito ries declared on App: Cannot create inner bean '(inner bean)#207b8649' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org .springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#207b8649': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nes ted exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'entityManagerFactory' available
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:389)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:134)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1697)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1442)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:884)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
... 32 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#207b8649': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'entityManagerFactory' available
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:342)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:113)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:690)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:507)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:374)
... 46 common frames omitted
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'entityManagerFactory' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:816)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1288)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:330)
... 54 common frames omitted
root@dsde1081-22288:~# ERROR org.springframework.boot.SpringApplication - Application run failed
ERROR: command not found
root@dsde1081-22288:~# org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bot' defined in URL [jar:file:/root/telegramBotMoney.jar!/com/nikita/bot/Bot.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'channelService' defined in URL [jar:file:/r oot/telegramBotMoney.jar!/com/nikita/service/ChannelService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jpaChannelRepository' defined in com.nikita.repository.JpaChannelRepository defined in @EnableJpaRepositories declared on App: Cannot create inner bean '(inner bean)# 207b8649' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error c reating bean with name '(inner bean)#207b8649': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBean DefinitionException: No bean named 'entityManagerFactory' available
-bash: !/com/nikita/bot/Bot.class]: event not found
ChannelService, в котором возникает ошибка:
import com.nikita.model.Channel;
import com.nikita.repository.JpaChannelRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ChannelService {
private final JpaChannelRepository channelRepository;
@Autowired
public ChannelService(JpaChannelRepository channelRepository) {
this.channelRepository = channelRepository;
}
public List<Channel> findByStart(boolean start){
return channelRepository.findAllByStart(start);
}
public Channel update(Channel channel){
return channelRepository.save(channel);
}
public void delete(String id){
channelRepository.deleteById(id);
}
public List<Channel> findAll(){
return channelRepository.findAll();
}
public Channel findById(String id){
return channelRepository.findById(id).get();
}
}
Репозиторий:
import com.nikita.model.Channel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import javax.transaction.Transactional;
import java.util.List;
import java.util.Optional;
@Repository
@Transactional
public interface JpaChannelRepository extends JpaRepository<Channel, String> {
@Override
Optional<Channel> findById(String id);
@Query("SELECT c FROM Channel c WHERE c.start=:start")
List<Channel> findAllByStart(@Param("start") boolean start);
@Override
<S extends Channel> S save(S s);
@Override
void deleteById(String id);
}
Когда на локальной машине запускаю это приложение, оно отрабатывает без ошибок, но при попытке запустить на vps сразу вылетают эти ошибки
Айфон мало держит заряд, разбираемся с проблемой вместе с AppLab
Перевод документов на английский язык: Важность и ключевые аспекты
У меня возникла задача сделать программу, которая одновременно записывает звук через микрофон и выводит его через динамик
Есть сервер на netty, при попытке отправить какое-то сообщение с сервера оно доставляется только одному пользователю(который отправил запрос)Что...
Есть таблица с данными и кнопкой для удаления этих данных(если приложен файл)Кнопка удаления срабатывает только на первой строке
Есть две функции, выполняющие одну и ту же задачуОдна использует матрицу, другая рекурсия