Ошибка создания бина с именем 'servletEndpointRegistrar' при весенней загрузке - PullRequest
0 голосов
/ 07 февраля 2020

Я пытаюсь загрузить весеннюю загрузку своего приложения на jenkins, попробуйте исключить @EnableAutoConfiguration (exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class})

классы продолжают, но продолжают ошибка

Я использую

gradle

buildscript {
    ext {
        DEPENDENCY_MANAGEMENT_VERSION = '1.0.6.RELEASE'
        SPRING_BOOT_VERSION = '2.2.2.RELEASE'
        SONARQUBE_VERSION = '2.6.1'
        DEPENDENCY_CHECK_VERSION = '2.0.0'

    }
    repositories {
        maven {
            url "${artifactory_contextUrl}/virtual-release-bns"
            credentials {
                username = "${artifactory_user}"
                password = "${artifactory_password}"
            }
        }
        flatDir {
            dirs "libs"
        }
    }
    dependencies {
        classpath("io.spring.gradle:dependency-management-plugin:${DEPENDENCY_MANAGEMENT_VERSION}")
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${SPRING_BOOT_VERSION}")
        classpath("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:${SONARQUBE_VERSION}")
        classpath("org.owasp:dependency-check-gradle:${DEPENDENCY_CHECK_VERSION}")

    }
}

apply plugin: 'org.sonarqube'
apply plugin: 'org.springframework.boot'
apply plugin: 'org.owasp.dependencycheck'

/* -------------------------------- */
/* - Include other gradle scripts - */
/* -------------------------------- */
def gradlePath = "${rootProject.projectDir}${project.property('gradle.path')}"
apply from: "${gradlePath}/libraries.gradle"
apply from: "${gradlePath}/build-config.gradle"
apply from: "${gradlePath}/build-java.gradle"
apply from: "${gradlePath}/build-report.gradle"
apply from: "${gradlePath}/build-sonar.gradle"
apply from: "${gradlePath}/build-dependencycheck.gradle"
apply from: "${gradlePath}/build-dependencies.gradle"
apply from: "${gradlePath}/build-spring-conf.gradle"
apply from: "${gradlePath}/build-plato.gradle"

allprojects {
    apply plugin: 'io.spring.dependency-management'
    dependencyManagement {
        imports {
            mavenBom("org.springframework.boot:spring-boot-dependencies:${SPRING_BOOT_VERSION}")
        }
    }
}

файл Application.properties

# ============================================================================
# Parameter Properties for project 'prueba pr'
# ============================================================================
# Properties
# Only allow properties that are environment independent
# The application.properties name is changed to avoid environment conflict
# ============================================================================
# Application name, different context
spring.application.name=prueba
spring.mvc.locale=es_ES
# Avoid error 405 with spring information
spring.mvc.throw-exception-if-no-handler-found=true
spring.resources.add-mappings=false
# Allow that spring interceptor does not filter option
spring.mvc.dispatch-options-request=true
# static resources location
#spring.resources.static-locations=classpath:/webapp
# Application name, different context
server.port=9980
server.contextPath=/dotrx
spring.application.name=dotrx
spring.application.profiles=dev
spring.profiles=dev
spring.profiles.active=dev
# JMX Actuator
spring.jmx.default-domain=fg
endpoints.jmx.domain=fg
endpoints.jmx.unique-name=true
# JMX Actuator deactivate endpoint
endpoints.trace.enabled=false
endpoints.shutdown.enabled=false
endpoints.info.enabled=false
endpoints.flyway.enabled=false
endpoints.mappings.enabled=false
endpoints.dump.enabled=false
endpoints.docs.enabled=false
endpoints.configprops.enabled=false
endpoints.autoconfig.enabled=false
endpoints.auditevents.enabled=false
endpoints.env.enabled=false
endpoints.heapdump.enabled=false
endpoints.loggers.enabled=false
endpoints.metrics.enabled=false
endpoints.beans.enabled=false
# Datasouces JNDI
sybase.datasource.jndi-name=jdbc/DSSYB_CLDC101
#OAuth
app.token.secret=fg
#Adm Token
app.adm.token.secret=123
f89a06
# Atr Properties
atr.socket.numsession=50
# JSON config folder in classpath
rcfg.json.folder=conf
# JSON i18n texts backoffice
backoffice.file.path=i18n/cms-backoffice.json
# fg Variables
gf.atr.service=CLDC124.uatchl.bns,6100
fg.atr.timeout=60


# fg SYBASE
fg.datasource.url=jdbc:sybase:360
fg.datasource.driverclassname=com.sybase.jdbc4.jdbc.SybDataSource
fg.datasource.username=admin
fg.datasource.pass=123
#Loggable Properties
loggable.system.log.name=SystemOut
loggable.error.log.name=ErrorOut
#Transactional Logger
logger.namespace=fg
logger.token.header=Authorization
logger.token.signature=fg
logger.token.claims.userRut=user.key
logger.token.claims.clientRut=enterprise.key
logger.writing.endpoint=http://123.com
logger.writing.alg=HS256
logger.writing.typ=Authorization
logger.writing.signature=MSLOGGER
logger.writing.expiration=900
logger.pathfile=./controller-dotrx/src/main/resources/logger.json
log.error=exceptions

ОШИБКА

c.s.d.p.mapper.config.SybaseDBConfig     : SybaseDBConfig getDataSource end
2020-02-07 10:08:37.216 ERROR 9616 --- [           main] o.s.b.web.embedded.tomcat.TomcatStarter  : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: 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 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'healthEndpoint' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthContributorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthContributorRegistry]: Factory method 'healthContributorRegistry' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbHealthContributor' defined in class path resource [org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthContributorAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthContributor]: Factory method 'dbHealthContributor' threw exception; nested exception is java.lang.IllegalArgumentException: Beans must not be empty
2020-02-07 10:08:37.247  INFO 9616 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2020-02-07 10:08:37.263  WARN 9616 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2020-02-07 10:08:37.263  INFO 9616 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-02-07 10:08:37.303 ERROR 9616 --- [           main] o.s.boot.SpringApplication               : Application run failed
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...