Привод не работает с приложением без пружины - PullRequest
0 голосов
/ 29 марта 2019

У меня есть приложение Spring, и я пытаюсь привязать к нему привод.Имея доступные примеры и документацию, я добавил зависимости в pom.xml

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-actuator</artifactId>
        <version>1.5.10.RELEASE</version>
    </dependency>

. Я добавил следующие конфигурации в свой servlet.xml

  <bean id="endpointAutoConfiguration" class="org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration"/>
  <bean id="publicMetricsAutoConfiguration" class="org.springframework.boot.actuate.autoconfigure.PublicMetricsAutoConfiguration"/>
  <bean id="healthIndicatorAutoConfiguration" class="org.springframework.boot.actuate.autoconfigure.HealthIndicatorAutoConfiguration"/>

Со следующими конфигурациями

endpoints.health.enabled=true
endpoints.health.id=health
endpoints.health.enabled=true
management.security.enabled=false
endpoints.health.sensitive=false
server.port=8080
management.endpoints.web.base-path=/
management.endpoints.web.exposure.include=*
endpoints.actuator.enabled=true
endpoints.logfile.enabled=true

Во время отладки я видел, что в классе org.springframework.boot.actuate.endpoint выбрано 3 класса для индикатора состояния DataSourceHealthIndicator, DiskSpaceHealtIndicator и JmsHealthIndicator, а выбранные данные верны для экземпляров с автопроводкой.

При включении журналов Springframework в режиме DEBUG, я видел ниже строки в журнале для многих свойств, связанных с приводом

07:04:01,302 DEBUG [localhost-startStop-1]: JndiLocatorDelegate  ReqId:() DFReqId:() - Converted JNDI name [java:comp/env/endpoints.health.enabled] not found - trying original name [endpoints.health.enabled]. javax.naming.NameNotFoundException: Name [endpoints.health.enabled] is not bound in this Context. Unable to find [endpoints.health.enabled].

Не получить указатель, чего мне не хватает.

Получение исключения 404на http://localhost:8080/health, http://localhost:8080/info

...