小编ola*_*ell的帖子

spring-boot health不显示详细信息(withDetail info)

我编写了一个实现HealthIndicator的类,重写了health-method.我回来Health.down().withDetail("SupportServiceStatus", "UP").build();

这应该让我的health-endpoint返回:

{
    "status":"UP",
    "applicationHealth": {
        "status":"UP"
    }
}
Run Code Online (Sandbox Code Playgroud)

相反它只返回(健康,没有细节):

{
    "status":"UP",
}
Run Code Online (Sandbox Code Playgroud)

Javacode(略微简化):

@Component
public class ApplicationHealth implements HealthIndicator {

  @Override
  public Health health() {
    return check();
  }

  private Health check() {
    return Health.up().withDetail("SupportServiceStatus", supportServiceStatusCode).build();
  }

}
Run Code Online (Sandbox Code Playgroud)

java spring spring-boot

20
推荐指数
4
解决办法
1万
查看次数

Spring JPA 存储库 - jsonObject 上的运算符 SIMPLE_PROPERTY 需要标量参数

我正在使用 JPA 查询更新一些 Spring Boot 应用程序。除了一种特定类型的查询 ( findByJsonNode)之外,一切正常。这在早期版本中运行良好,但在我升级后,我的 bean 无法创建。

它在 Spring Boot2.1.4.RELEASE和 spring cloud version 上运行良好Greenwich.SR1,但是当我升级到 Spring Boot2.2.4.RELEASE和 spring cloud version 时Hoxton.RELEASE,Spring 无法创建我的存储库 bean。

Caused by: java.lang.IllegalStateException: Operator SIMPLE_PROPERTY on searchDto requires a scalar argument, found class com.fasterxml.jackson.databind.JsonNode in method public abstract se.company.search.Search se.company.search.SearchRepository.findFirstBySearchDto(com.fasterxml.jackson.databind.JsonNode).
    at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.throwExceptionOnArgumentMismatch(PartTreeJpaQuery.java:171)
    at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.validate(PartTreeJpaQuery.java:147)
    at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:90)
    ... 73 common frames omitted.
    at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.throwExceptionOnArgumentMismatch(PartTreeJpaQuery.java:171) ~[spring-data-jpa-2.2.4.RELEASE.jar:2.2.4.RELEASE]
    at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.validate(PartTreeJpaQuery.java:147) ~[spring-data-jpa-2.2.4.RELEASE.jar:2.2.4.RELEASE]
    at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:90) ~[spring-data-jpa-2.2.4.RELEASE.jar:2.2.4.RELEASE]
    ... 74 common frames omitted
Run Code Online (Sandbox Code Playgroud)

存储库类如下所示 …

java jpa spring-data-jpa spring-boot hibernate-types

18
推荐指数
3
解决办法
1万
查看次数

只有一些glyphicons在IE中显示

我和我的同事一直试图解决这个问题一段时间,我们无法让它发挥作用.希望有人比我们聪明,并对此有一些好的意见.

当使用IE8,IE9或IE10访问网站http://glyphicons.com/http://getbootstrap.com/components/时,并非所有的字形都显示(有些正在显示,但有些只显示为方框[]).

在Chrome中都显示出来.

编辑:我应该补充说,这是在我们公司网络上的计算机上.这里有一个设置阻止我们显示所有的字形吗?

编辑2:我现在怀疑我们的组策略为网络上的所有用户禁用XMLHTTP.因此,是否可以对半身字体进行编码并直接在CSS中使用?

css internet-explorer twitter-bootstrap glyphicons

7
推荐指数
1
解决办法
1万
查看次数

计划的Powershell任务,卡住​​了跑步

在计划任务中运行PowerShell脚本时遇到问题.即使Transcript已经记录了最后一行"Done!",它仍然停留在Running中.而且看起来它完全符合我的要求.我错过了什么?

RunWindows中运行它似乎也很好:powershell -file "D:\_temp\copy_bat\copy_one_reprint_folder.ps1"

任务计划程序中的Seetings是:

  • 以完全的特权运行
  • 运行这两个用户是否已登录
  • 行动,启动计划 powershell.exe
    • -file "D:\_temp\copy_bat\copy_one_reprint_folder.ps1"

坚持跑步 TS的历史

如果需要,请参阅下面的代码.

# PowerShell RePRINT copy first folder, sorted on lastModified
function timestamp
{
    $ts = Get-Date -format s
    return $ts
}

$fromDirectory = "D:\_temp\copy_bat"
$toDirectory = "D:\_temp\in_dummy"
$extractGUIDdir = ""
$docTypeDir = ""

# Logging
#########
$ErrorActionPreference="SilentlyContinue"
Stop-Transcript | out-null
$ErrorActionPreference = "Continue"
Start-Transcript -path $fromDirectory\copy_one_reprint_folder.log.txt -append
###########


Write-Host ""
Write-Host (timestamp) "Copy RePRINT extract started"
Write-Host (timestamp) "============================"

Get-ChildItem -path $fromDirectory | ?{ $_.PSIsContainer } …
Run Code Online (Sandbox Code Playgroud)

windows powershell scheduled-tasks

5
推荐指数
1
解决办法
3826
查看次数