unable to deploy to heroku since jhipster update

让人想犯罪 __ 提交于 2020-01-25 07:37:10

问题


I upgrade my project from jhipster 5.8.2 to 6.5.1.

All works fine in develop mode, on my Windows computer

Now, I try to deploy on my Test heroku platform, but I have an exception :

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: 
Unable to start web server; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'servletEndpointRegistrar' 
defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: 

Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: 
Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: 
Factory method 'servletEndpointRegistrar' threw exception; 
nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'auditEventsEndpoint' 
defined in class path resource [org/springframework/boot/actuate/autoconfigure/audit/AuditEventsEndpointAutoConfiguration.class]: 
Unsatisfied dependency expressed through method 'auditEventsEndpoint' parameter 0; 

nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:

 Error creating bean with name 'customAuditEventRepository' 
 defined in URL [jar:file:/app/build/libs/yvidya-0.0.1-SNAPSHOT.war!/WEB-INF/classes!/fr/yoni/yvidya/repository/CustomAuditEventRepository.class]: 
Unsatisfied dependency expressed through constructor parameter 0; 
 nested exception is org.springframework.beans.factory.BeanCreationException: 
 Error creating bean with name 'persistenceAuditEventRepository': 
 Cannot create inner bean '(inner bean)#75cf0de5' 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)#75cf0de5': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; 

 nested exception is org.springframework.beans.factory.BeanCreationException: 
 Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: 
Invocation of init method failed; 

This is my CustomAuditEventRepository

@Repository
public class CustomAuditEventRepository implements AuditEventRepository {

private static final String AUTHORIZATION_FAILURE = "AUTHORIZATION_FAILURE";

/**
 * Should be the same as in Liquibase migration.
 */
protected static final int EVENT_DATA_COLUMN_MAX_LENGTH = 255;

private final PersistenceAuditEventRepository persistenceAuditEventRepository;

private final AuditEventConverter auditEventConverter;

private final Logger log = LoggerFactory.getLogger(getClass());

public CustomAuditEventRepository(PersistenceAuditEventRepository persistenceAuditEventRepository,
                                  AuditEventConverter auditEventConverter) {

    this.persistenceAuditEventRepository = persistenceAuditEventRepository;
    this.auditEventConverter = auditEventConverter;
}

For deploy, I use gitlab-ci, scripts launch are :

./gradlew compileJava -x check -PnodeInstall --no-daemon
./gradlew -Pint -Pwar clean bootWar
rm -rf build/libs/yvidya-*original.war
heroku plugins:install java
heroku deploy:jar build/libs/*.war --app yvidya-int

And my config Database :

@Configuration
@EnableJpaRepositories("fr.yoni.yvidya.repository")
@EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware")
@EnableTransactionManagement
public class DatabaseConfiguration {

    private final Logger log =   LoggerFactory.getLogger(DatabaseConfiguration.class);
}

My config JDBC

spring:
  profiles:
    include:
      - swagger
  devtools:
    restart:
      enabled: false
    livereload:
      enabled: false
  datasource:
    type: com.zaxxer.hikari.HikariDataSource
    url: jdbc:postgres://XXXX.compute.amazonaws.com:5432/YYYYYY
    username: YYIYYI
    password: TTTTTTTTTTTTTTTTTTTTTTTTTTTTT
    hikari:
      poolName: Hikari
      auto-commit: false
  jpa:
    database-platform:     io.github.jhipster.domain.util.FixedPostgreSQL95Dialect
    database: POSTGRESQL

have you an idea why I can not deploy on heroku since upgrade ?

来源:https://stackoverflow.com/questions/59411150/unable-to-deploy-to-heroku-since-jhipster-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!