You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error could be reproduced in uc-iot/motor but probably exists also in other modules.
Similar errors with localhost instead of broker can be solved with Solution 1 below (replace broker with localhost).
cd uc-iot/motor
mvn clean spring-boot:run
Actual
The following errors occurs after the startup process
java.net.UnknownHostException: broker
at java.base/java.net.InetAddress$CachedLookup.get(InetAddress.java:909) ~[na:na]
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1702) ~[na:na]
at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1582) ~[na:na]
at org.apache.kafka.clients.DefaultHostResolver.resolve(DefaultHostResolver.java:27) ~[kafka-clients-4.1.1.jar:na]
at org.apache.kafka.clients.ClientUtils.resolve(ClientUtils.java:125) ~[kafka-clients-4.1.1.jar:na]
at org.apache.kafka.clients.ClusterConnectionStates$NodeConnectionState.resolveAddresses(ClusterConnectionStates.java:536) ~[kafka-clients-4.1.1.jar:na]
at org.apache.kafka.clients.ClusterConnectionStates$NodeConnectionState.currentAddress(ClusterConnectionStates.java:511) ~[kafka-clients-4.1.1.jar:na]
at org.apache.kafka.clients.ClusterConnectionStates.currentAddress(ClusterConnectionStates.java:173) ~[kafka-clients-4.1.1.jar:na]
Should
Messages like these should be logged:
2026-04-01T12:54:34.175+02:00 INFO 46485 --- [ scheduling-1] c.z.t.kafka.iot.motor.MotorProducer : Sending measurement of {"sensor_id": "motor01", "datetime": 1775040874175, "value": "on"} for motor motor01 to topic plant01
2026-04-01T12:54:37.448+02:00 INFO 46485 --- [ scheduling-1] c.z.t.kafka.iot.motor.MotorProducer : Sending measurement of {"sensor_id": "motor01", "datetime": 1775040877448, "value": "off"} for motor motor01 to topic plant01
2026-04-01T12:54:40.722+02:00 INFO 46485 --- [ scheduling-1] c.z.t.kafka.iot.motor.MotorProducer : Sending measurement of {"sensor_id": "motor01", "datetime": 1775040880722, "value": "on"} for motor motor01 to topic plant01
2026-04-01T12:54:43.999+02:00 INFO 46485 --- [ scheduling-1] c.z.t.kafka.iot.motor.MotorProducer : Sending measurement of {"sensor_id": "motor01", "datetime": 1775040883999, "value": "on"} for motor motor01 to topic plant01
Solutions
Solution 1
Both solutions worked on Maven 3.9.11 / Java 24.0.2, MacOS 26.4, Apple M4 Pro, Podman 5.8.1
Add the following line in /etc/hosts or C:\Windows\System32\drivers\etc\hosts, save and try again.
127.0.0.1 broker
Solution 2
Change the port of the bootstrap-server in the file uc-iot/motor/src/main/resources/application.yaml to:
Reproduce
Note
The error could be reproduced in
uc-iot/motorbut probably exists also in other modules.Similar errors with
localhostinstead ofbrokercan be solved with Solution 1 below (replacebrokerwithlocalhost).cd uc-iot/motormvn clean spring-boot:runActual
The following errors occurs after the startup process
Should
Messages like these should be logged:
Solutions
Solution 1
Both solutions worked on Maven 3.9.11 / Java 24.0.2, MacOS 26.4, Apple M4 Pro, Podman 5.8.1
Add the following line in
/etc/hostsorC:\Windows\System32\drivers\etc\hosts, save and try again.Solution 2
Change the port of the bootstrap-server in the file
uc-iot/motor/src/main/resources/application.yamlto:and try again.