我在本地主机上运行了ActiveMQ 5.15.13,没有任何问题:
# wget --user admin --password admin --header "Origin: http://localhost" --auth-no-challenge http://localhost:8161/api/jolokia/read/org.apache.activemq:type=Broker,brokerName=localhost
--2020-06-22 14:49:15-- http://localhost:8161/api/jolokia/read/org.apache.activemq:type=Broker,brokerName=localhost
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:8161... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: ‘org.apache.activemq:type=Broker,brokerName=localhost.2’
org.apache.activemq:type=Broker,brokerName=localhost.2 [ <=> ] 2,24K --.-KB/s in 0s
2020-06-22 14:49:15 (175 MB/s) - ‘org.apache.activemq:type=Broker,brokerName=localhost.2’ saved [2291]Hawtio2.10.0看起来很好,但是当我试图连接到ActiveMQ时,我会收到以下消息:
This Jolokia endpoint is unreachable. Please check the connection details and try again.我查了一下网络检查员,我想这就是问题所在:
Request URL: http://localhost:8161/hawtio/proxy/http/localhost/8161/api/jolokia/在URL中做了一些更改之后,我注意到URL中有一个硬编码部分:
http://localhost:8161/hawtio/proxy/不管我做什么和其他部分,这部分总是存在的:
http/localhost/8161/api/jolokia/我总是更改设置,但由于某种原因,它变成了查询字符串,而不是预期的URL:http://localhost:8161/api/jolokia/
这就是我使用的选项:
ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS_MEMORY -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.role=admins -Dhawtio.rolePrincipalClasses=org.apache.activemq.jaas.GroupPrincipal -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=$ACTIVEMQ_CONF/login.config"我怎样才能解决这个问题?
提前谢谢。
发布于 2020-06-23 08:00:35
在回顾了许多与ActiveMQ一起安装Hawtio的“相同”过程之后,无论在哪里我都可以找到它并查看ActiveMQ和Hawtio的文档之后,我终于找到了一些信息,从6年前开始,当使用Hawtio与解决我的问题的ActiveMQ一起使用Hawtio时,它提出了一个“额外的步骤”。
我可能错了,但从我的观点来看,Hawtio有一个highlander,它使用主机URL作为基础,而不是创建的安装连接URL来解决这个问题,只需要在<ACTIVEMQ PATH>/conf/jetty.xml中添加以下行
<bean class="org.eclipse.jetty.webapp.WebAppContext">
<property name="contextPath" value="/hawtio" />
<property name="resourceBase" value="${activemq.home}/webapps/hawtio" />
<property name="logUrlOnStart" value="true" />
</bean>应该是在:
<bean id="secHandlerCollection" class="org.eclipse.jetty.server.handler.HandlerCollection">
<property name="handlers">
<list>
<ref bean="rewriteHandler"/>https://stackoverflow.com/questions/62515049
复制相似问题