本文介绍了Spring Eureka仪表板在Wildfly上返回XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在wildfly上部署我的eureka服务,但是当我尝试访问仪表板时,得到以下xml作为响应:

I am trying to deploy my eureka-service at wildfly, but when i try to access the dashboard i get the following xml as response:

<com.netflix.eureka.util.StatusInfo>
<generalStats>
<environment>test</environment>
<num-of-cpus>4</num-of-cpus>
<total-avail-memory>3525mb</total-avail-memory>
<current-memory-usage>736mb (20%)</current-memory-usage>
<server-uptime>00:01</server-uptime>
</generalStats>
<applicationStats>
<registered-replicas>http://localhost:8761/eureka/</registered-replicas>
<available-replicas/>
<unavailable-replicas>http://localhost:8761/eureka/,</unavailable-replicas>
</applicationStats>
<instanceInfo>
<instanceId>note:eureka-service:8761</instanceId>
<hostName>note</hostName>
<app>EUREKA-SERVICE</app>
<ipAddr>192.168.1.36</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8761</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>30</renewalIntervalInSecs>
<durationInSecs>90</durationInSecs>
<registrationTimestamp>0</registrationTimestamp>
<lastRenewalTimestamp>0</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>0</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://note:8761/</homePageUrl>
<statusPageUrl>http://note:8761/info</statusPageUrl>
<healthCheckUrl>http://note:8761/health</healthCheckUrl>
<vipAddress>eureka-service</vipAddress>
<secureVipAddress>eureka-service</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1491796603178</lastUpdatedTimestamp>
<lastDirtyTimestamp>1491796615476</lastDirtyTimestamp>
</instanceInfo>
</com.netflix.eureka.util.StatusInfo>

有人知道如何在Wildfly上部署仪表板吗?

Does anyone know how to get dashboard deploying at wildfly?

推荐答案

就我而言,其他两种解决方案均无济于事.

In my case the other two solutions didn't help.

我搜索了几个小时,并在调试spring代码时找到了解决方案.freemarker的viewResolver在 spring-cloud-netflix-eureka-server-1.3.1.RELEASE.jar 中找不到模板.

I searched for hours and found the solution while debugging the spring code.The viewResolver for freemarker did not found the templates in spring-cloud-netflix-eureka-server-1.3.1.RELEASE.jar.

实际上,我只需要设置一个简单的属性即可完成工作:

In fact i only had to set one simple property to get the things done:

spring.freemarker.prefer-file-system-access = false

这篇关于Spring Eureka仪表板在Wildfly上返回XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-26 11:39