connecting to remote ActiveMQ using local hawtio

300 views
Skip to first unread message

nb

unread,
Oct 4, 2018, 8:11:23 AM10/4/18
to hawtio
Hi

Am running hawtio locally using 

java -jar hawtio-app-2.1.0.jar

I Have set up a successfully tested connection to a remote default install ActiveMQ.

When I actually press the "connect" button, it prompts me for username and password, and I use "admin" for both, and I get the error "Incorrect username or password"


I can call the remote ActiveMq Jolokia agent using wget on my local machine:

url -u admin:admin -d "{\"type\":\"read\",\"mbean\":\"java.lang:type=Memory\",\"attribute\":\"HeapMemoryUsage\",\"path\":\"used\"}" http://thing-dev-place.co.uk:8161/api/jolokia/ && echo ""

and get an expected response.


What credentials is hawtio expecting me to enter?

Cheers for any advice

nb

unread,
Oct 5, 2018, 4:33:25 AM10/5/18
to hawtio
opps sorry - meant curl not wget :)
and the url is

curl -u admin:admin -d "{\"type\":\"read\",\"mbean\":\"java.lang:type=Memory\",\"attribute\":\"HeapMemoryUsage\",\"path\":\"used\"}" http://thing-dev-place.co.uk:8161/api/jolokia/ && echo ""

Hoping someone can help please?

Alexandre Briani Kieling

unread,
Oct 5, 2018, 10:53:50 AM10/5/18
to h.ba...@sheffield.ac.uk, hawtio
Does anyone have experience setting up new users on ActiveMQ 5.15.0?

--
You received this message because you are subscribed to the Google Groups "hawtio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hawtio+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Alexandre Kieling
Sr. Software Engineer
Red Hat Fuse

nomit babraa

unread,
Oct 8, 2018, 9:04:51 AM10/8/18
to abri...@redhat.com, haw...@googlegroups.com
Hi
I put hawtio on debug and can see the request below when I click on "connect"

The Authorization header is the same value generated by the curl command, but the "host" and "POST" headers look odd. Is their value correct?
Should they be going through localhost:8080?

[qtp1128032093-9] DEBUG org.eclipse.jetty.server.HttpChannel - REQUEST for //localhost:8080/hawtio/proxy/http/[server]-exec.shef.ac.uk/8161/api/jolokia/ on HttpChannelOverHttp@10bba45{r=20,c=false,a=IDLE,uri=//localhost:8080/hawtio/proxy/http/[server]-exec.shef.ac.uk/8161/api/jolokia/}
POST //localhost:8080/hawtio/proxy/http/[server]-exec.shef.ac.uk/8161/api/jolokia/ HTTP/1.1
Host: localhost:8080
Accept: application/json, text/javascript, */*; q=0.01
Authorization: Basic YWRtaW46YWRtaW4=
X-Requested-With: XMLHttpRequest
Accept-Language: en-gb
Accept-Encoding: gzip, deflate
Content-Type: text/json
Content-Length: 18
Connection: keep-alive
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.1 Safari/603.1.30

The response is a 403.

Also The "Test Connection" button on the Edit Connection window returns a positive result even with random incorrect values...

Cheers


On Fri, 5 Oct 2018 at 17:35, Alexandre Briani Kieling <abri...@redhat.com> wrote:
The issue seems configuration in ActiveMQ or a bug in Hawtio.
I was hoping someone else could provide directions on how to set up a new user and confirm connecting from Hawtio worked correctly.

On Fri, Oct 5, 2018 at 1:29 PM nomit babraa <h.ba...@sheffield.ac.uk> wrote:
hi
Sorry - you were able to connect to the ActiveMQ instance using hawtio with the admin:admin credentials?
If so, I was expecting to be able to do that too, but can't for some reason....Cheers for your help.
Maybe I can turn up hawtio logging somehow to see what is happening 

On Fri, 5 Oct 2018 at 17:25, Alexandre Briani Kieling <abri...@redhat.com> wrote:
I was able to connect using admin:admin and user:user but not a new user. I'm not sure what's missing in my configuration.

On Fri, Oct 5, 2018 at 12:44 PM nomit babraa <h.ba...@sheffield.ac.uk> wrote:
FYI
our jolokia-access.xml file on the active-mq install just says

<restrict>
  <!-- deny calling operations or getting attributes from these mbeans -->
  <deny>
    <mbean>
      <name>com.sun.management:type=DiagnosticCommand</name>
      <attribute>*</attribute>
      <operation>*</operation>
    </mbean>
    <mbean>
      <name>com.sun.management:type=HotSpotDiagnostic</name>
      <attribute>*</attribute>
      <operation>*</operation>
    </mbean>
  </deny>

</restrict>

But as the curl command is working I guess the access.xml file isn't
an issue here?

Is hawtio supposed to accept the admin:admin credentials?

Cheers

Nomit
--
Nomit Babraa

Student Lifecycle Project: Monday - Thursday
CiCS: Friday only

Tel: 0114 222 1162


--
Alexandre Kieling
Sr. Software Engineer
Red Hat Fuse


--
Nomit Babraa

Student Lifecycle Project: Monday - Thursday
CiCS: Friday only

Tel: 0114 222 1162


--
Alexandre Kieling
Sr. Software Engineer
Red Hat Fuse


--
Nomit Babraa

Student Lifecycle Project: Monday - Thursday
CiCS: Friday only

Tel: 0114 222 1162

Tadayoshi Sato

unread,
Oct 8, 2018, 9:50:20 PM10/8/18
to h.ba...@sheffield.ac.uk, hawtio
Can you make sure -Dhawtio.proxyWhitelist=thing-dev-place.co.uk is set for hawtio-app.jar?

nomit babraa

unread,
Oct 9, 2018, 4:21:27 AM10/9/18
to sato.ta...@gmail.com, haw...@googlegroups.com
Hi
That was the issue in the end.
Thanks.
Admittedly I did not read the config guide, but it might be helpful if the error (currently says "incorrect username or password" ) message could be more useful stating that the server is not whitelisted....?
Cheers
Nomit
Reply all
Reply to author
Forward
0 new messages