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

IMPORTANT: Please notify the team about your question by filling in the form on the contact page. Otherwise, we may miss your question!

0 votes

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


3 Answers

0 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 (10.6k points)
0 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 (10.6k points)
0 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:    mdm.my-host.com

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

by (10.6k points)