Вызов исполнительного механизма пружинной загрузки / конечная точка исполнительного механизма / файла журнала, возвращающая 500 с java.util.HashMap, не может быть приведен к org.springframework.core.io.Resource - PullRequest
0 голосов
/ 27 июня 2019

В соответствии с ошибкой он выглядит так, как будто он нашел файл журнала, но перед возвратом происходит сбой во время какого-либо преобразования.application.yml

logging:
  path: logs
  file: ${logging.path}/api.log

management:
  endpoints:
    logfile: logs/api.log

Ответ:

{
  "error": {
  "status": 500,
  "message": "java.util.HashMap cannot be cast to 
             org.springframework.core.io.Resource",
  "description": "uri=/api/logfile"
  }
}

РЕДАКТИРОВАТЬ

Вход в консоль

2019-06-28 16:02:31,221 DEBUG[https-jsse-nio-443-exec-4] LogFormatUtils.traceDebug:91 GET "/api-my/logfile", parameters={}
2019-06-28 16:02:31,222 DEBUG[https-jsse-nio-443-exec-4] AbstractHandlerMapping.getHandler:420 Mapped to Actuator web endpoint 'logfile'
2019-06-28 16:02:31,237 DEBUG[https-jsse-nio-443-exec-4] LogFormatUtils.traceDebug:91 Read "application/json;charset=UTF-8" to []
2019-06-28 16:02:31,244 DEBUG[https-jsse-nio-443-exec-4] PropertySourcesPropertyResolver.logKeyFound:115 Found key 'logging.path' in PropertySource 'configurationProperties' with value of type String
2019-06-28 16:02:31,250 DEBUG[https-jsse-nio-443-exec-4] AbstractMessageConverterMethodProcessor.writeWithMessageConverters:268 Using 'text/plain;charset=UTF-8', given [*/*] and supported [text/plain;charset=UTF-8]
2019-06-28 16:02:31,251 DEBUG[https-jsse-nio-443-exec-4] LogFormatUtils.traceDebug:91 Writing [{data=file [/Users/ibabur/workspaces/sts_workspace/myService/logs/api-my-logger.log], mess (truncated)...]
2019-06-28 16:02:31,252 DEBUG[https-jsse-nio-443-exec-4] ExceptionHandlerExceptionResolver.doResolveHandlerMethodException:403 Using @ExceptionHandler public final com.nenuphar.apimy.exception.ErrorDetails com.nenuphar.apimy.advice.CustomizedResponseEntityExceptionHandler.handleAllExceptions(java.lang.Exception,org.springframework.web.context.request.WebRequest)
2019-06-28 16:02:31,261 DEBUG[https-jsse-nio-443-exec-4] AbstractMessageConverterMethodProcessor.writeWithMessageConverters:268 Using 'application/json', given [*/*] and supported [application/json, application/*+json, application/json, application/*+json, application/cbor]
2019-06-28 16:02:31,262 DEBUG[https-jsse-nio-443-exec-4] LogFormatUtils.traceDebug:91 Writing [{error=com.nenuphar.apimy.exception.ErrorDetails@8743f2f}]
2019-06-28 16:02:31,273 WARN[https-jsse-nio-443-exec-4] AbstractHandlerExceptionResolver.logException:198 Resolved [java.lang.ClassCastException: java.util.HashMap cannot be cast to org.springframework.core.io.Resource]
2019-06-28 16:02:31,274 DEBUG[https-jsse-nio-443-exec-4] FrameworkServlet.logResult:1130 Completed 500 INTERNAL_SERVER_ERROR
2019-06-28 16:02:31,277 DEBUG[https-jsse-nio-443-exec-4] ExceptionTranslationFilter.doFilter:121 Chain processed normally
2019-06-28 16:02:31,278 DEBUG[https-jsse-nio-443-exec-4] SecurityContextPersistenceFilter.doFilter:119 SecurityContextHolder now cleared, as request processing completed
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...