Welcome to Headwind MDM Q&A, where you can ask questions and receive answers from other members of the community.

Please do not post bug reports, missing feature requests, or demo inquiries. If you have such an inquiry, submit a contact form.

+1 vote

2020-03-29 06:51:59 [ERROR] com.hmdm.notification.guice.module.NotificationMqttTaskModule : Failed to create MQTT broker service

java.io.IOException: Failed to bind to server socket: mqtt://hmdm.com:31000 due to: java.net.BindException: Cannot assign requested address (Bind failed)

        at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:34)

        at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:146)

        at org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:62)

        at org.apache.activemq.transport.TransportFactorySupport.bind(TransportFactorySupport.java:40)

        at org.apache.activemq.broker.BrokerService.createTransportConnector(BrokerService.java:2520)

        at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:339)

        at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:329)

        at com.hmdm.notification.guice.module.NotificationMqttTaskModule.initBrokerService(NotificationMqttTaskModule.java:43)

Type  :qa!  and press <Enter> to abandon all changes and exit Vim

by

3 Answers

+3 votes

This error means that Headwind MDM cannot bind a TCP socket to the specified address. It uses port 31000 for Push notifications (based on MQTT protocol).

Looks like you have specified hmdm.com as the host where your instance of Headwind MDM will be installed. Does this domain belong to you?!

To fix the issue, check which IP addresses are available on your server by running the command

# ifconfig

IP address to which the mobile devices are connected must be available from Internet.

Then adjust the parameter mqtt.server.uri in the XML config file (usually located in /var/lib/tomcat8/conf/Catalina/localhost), specifying the IP address and port.

If you know a domain name assigned to the external IP address, you can specify a domain name instead of IP address, for example, our MQTT is configured as

<Parameter name="mqtt.server.uri" value="app.h-mdm.com:31000"/>

by (37.6k points)
+3 votes

If you're setting up Headwind MDM behind the firewall, you need to bind MQTT socket to the address in LAN. 

Therefore, the standard installation will cause MQTT fault. 

You need to edit the file /var/lib/tomcat8/conf/Catalina/localhost/hmdm.xml (or ROOT.xml) and update the mqtt.server.uri parameter manually (add existing IP address as described in the next answer).

After that, restart Tomcat service.

by (37.6k points)
+3 votes

You can use the following trick if you're behind NAT.

1. Run ifconfig to determine the local address as described here.

2. Open /etc/hosts (for example, by using the vim editor) and add the following record:

(local IP address)     (your MDM domain name)

For example:

192.168.1.35    mdm.my-host.com

This will resolve the MDM domain name to the correct address.

by (37.6k points)
...