[jitsi-dev] [libjitsi] UnknownHostException in FMJ (#17)

The machine has two ethernet interfaces (not sure does this matter) and after adding [a] line [for meet] in /etc/hosts the problem was fixed:
[...]
Before that the [Jitsi Meet] conferences does not succeed, no media is transmitted. And meet is the hostname of the machine.

07:57:37.373 SEVERE: [22] util.UtilActivator.uncaughtException().108
An uncaught exception occurred in
thread=Thread[Channel-pool-4-thread-1,5,main] and message was:
java.net.UnknownHostException: meet: meet
java.lang.RuntimeException: java.net.UnknownHostException: meet: meet
at javax.media.rtp.rtcp.SourceDescription.generateCNAME(Unknown Source)
at net.sf.fmj.media.rtp.RTPSessionMgr.initialize(Unknown Source)
at org.jitsi.impl.neomedia.rtp.translator.RTPTranslatorImpl.initialize(RTPTranslatorImpl.java:742)
at org.jitsi.impl.neomedia.rtp.StreamRTPManager.initialize(StreamRTPManager.java:216)
at org.jitsi.impl.neomedia.MediaStreamImpl.getRTPManager(MediaStreamImpl.java:1363)
at org.jitsi.impl.neomedia.MediaStreamImpl.createSendStreams(MediaStreamImpl.java:687)
at org.jitsi.impl.neomedia.MediaStreamImpl.startSendStreams(MediaStreamImpl.java:2108)
at org.jitsi.impl.neomedia.MediaStreamImpl.start(MediaStreamImpl.java:1997)
at org.jitsi.impl.neomedia.MediaStreamImpl.start(MediaStreamImpl.java:1960)
at org.jitsi.videobridge.RtpChannel.maybeStartStream(RtpChannel.java:988)
at org.jitsi.videobridge.Channel.runInWrapupConnectivityEstablishmentCommand(Channel.java:642)
at org.jitsi.videobridge.Channel.access$000(Channel.java:30)
at org.jitsi.videobridge.Channel$WrapupConnectivityEstablishmentCommand.run(Channel.java:960)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:701)
Caused by: java.net.UnknownHostException: meet: meet
at java.net.InetAddress.getLocalHost(InetAddress.java:1461)
... 16 more

07:57:38.182 INFO: [33] org.jitsi.impl.neomedia.MediaStreamImpl.info()
audio codec/freq: null/null Hz
07:57:38.182 INFO: [33] org.jitsi.impl.neomedia.MediaStreamImpl.info()
audio remote IP/port: 109.120.223.236/58995
07:57:38.183 SEVERE: [33] util.UtilActivator.uncaughtException().108
An uncaught exception occurred in
thread=Thread[Channel-pool-4-thread-5,5,main] and message was: null
java.lang.NullPointerException
at net.sf.fmj.media.rtp.RTPSessionMgr.getAllParticipants(Unknown Source)
at net.sf.fmj.media.rtp.RTPSessionMgr.getReceiveStreams(Unknown Source)
at org.jitsi.impl.neomedia.rtp.translator.RTPTranslatorImpl.getReceiveStreams(RTPTranslatorImpl.java:601)
at org.jitsi.impl.neomedia.rtp.StreamRTPManager.getReceiveStreams(StreamRTPManager.java:199)
at org.jitsi.impl.neomedia.MediaStreamImpl.getReceiveStreams(MediaStreamImpl.java:2667)
at org.jitsi.impl.neomedia.MediaStreamImpl.startReceiveStreams(MediaStreamImpl.java:2071)
at org.jitsi.impl.neomedia.MediaStreamImpl.start(MediaStreamImpl.java:2033)
at org.jitsi.impl.neomedia.MediaStreamImpl.start(MediaStreamImpl.java:1960)
at org.jitsi.videobridge.RtpChannel.maybeStartStream(RtpChannel.java:988)
at org.jitsi.videobridge.Channel.runInWrapupConnectivityEstablishmentCommand(Channel.java:642)
at org.jitsi.videobridge.Channel.access$000(Channel.java:30)
at org.jitsi.videobridge.Channel$WrapupConnectivityEstablishmentCommand.run(Channel.java:960)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:701)

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/issues/17

This happens when the hostname(1) of the machine is not DNS resolvable. It is caused by SourceDescription#generateCNAME() using InetAddress#getLocalHost() in order to find the local hostname, which tries to resolve the result of gethostname(2).

We should probably follow RFC6222 and generate the CNAME(s) without using the hostname.

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/issues/17#issuecomment-125656882