[jitsi-dev] [jitsi-videobridge] NPE when client tries to create a video bridge (#17)


#1

I've just set up OpenFire and Jitsi Videobridge on a headless Arch installation. It's working perfectly for one to one VoIP and video, but trying to create a video bridge on one of my test clients causes a NPE. It looks like it's caused by a `NoClassDefFoundError` for `java.awt.Toolkit`, which is being loaded by `java.awt.Dimension`. This seems to imply that a desktop environment is required for the Videobridge, is that the case?

Here's the relevant section from the logs:

RECV: <iq id="woiC1-79" to="videobridge.jitsi.fritz.box" type="get" from="ben@jitsi.fritz.box/jitsi-3vkn7nm"><conference xmlns="http://jitsi.org/protocol/colibri"><content name="audio"><channel initiator="false"><payload-type id="96" name="opus" channels="2" clockrate="48000"><parameter name="usedtx" value="1"/></payload-type><payload-type id="97" name="SILK" channels="1" clockrate="24000"/><payload-type id="98" name="SILK" channels="1" clockrate="16000"/><payload-type id="9" name="G722" channels="1" clockrate="8000"/><payload-type id="100" name="speex" channels="1" clockrate="32000"/><payload-type id="102" name="speex" channels="1" clockrate="16000"/><payload-type id="0" name="PCMU" channels="1" clockrate="8000"/><payload-type id="8" name="PCMA" channels="1" clockrate="8000"/><payload-type id="103" name="iLBC" channels="1" clockrate="8000"/><payload-type id="3" name="GSM" channels="1" clockrate="8000"/><payload-type id="104" name="speex" channels="1" clockrate="8000"/><payload-type 
 id="101" name="telephone-event" channels="1" clockrate="8000"/><transport xmlns="urn:xmpp:jingle:transports:ice-udp:1" ufrag="7c7jn" pwd="1dbedvusfsjkdeo6kjm15g6v9q"><candidate foundation="1" component="1" protocol="udp" priority="2130706431" generation="0" id="61" ip="192.168.1.125" port="5010" type="host" network="0"/><candidate foundation="2" component="1" protocol="udp" priority="2130706431" generation="0" id="62" ip="192.168.56.1" port="5010" type="host" network="0"/><candidate foundation="3" component="1" protocol="udp" priority="2113937151" generation="0" id="63" ip="fe80:0:0:0:c130:72aa:793b:bfa6" port="5010" type="host" network="0"/><candidate foundation="1" component="1" protocol="udp" priority="2113932031" generation="0" id="64" ip="192.168.1.125" port="63293" type="host" network="0"/><candidate foundation="4" component="1" protocol="udp" priority="1677724415" generation="0" id="65" ip="81.83.192.223" port="5010" type="srflx" rel-addr="192.168.1.125" rel-port="5010" netwo
 rk="0"/><candidate foundation="5" component="1" protocol="udp" priority="1677724415" generation="0" id="66" ip="192.168.0.212" port="63293" type="srflx" rel-addr="192.168.1.125" rel-port="63293" network="0"/><candidate foundation="1" component="2" protocol="udp" priority="2130706430" generation="0" id="67" ip="192.168.1.125" port="5011" type="host" network="0"/><candidate foundation="2" component="2" protocol="udp" priority="2130706430" generation="0" id="68" ip="192.168.56.1" port="5011" type="host" network="0"/><candidate foundation="3" component="2" protocol="udp" priority="2113937150" generation="0" id="69" ip="fe80:0:0:0:c130:72aa:793b:bfa6" port="5011" type="host" network="0"/><candidate foundation="1" component="2" protocol="udp" priority="2113932030" generation="0" id="70" ip="192.168.1.125" port="63294" type="host" network="0"/><candidate foundation="5" component="2" protocol="udp" priority="1677724414" generation="0" id="71" ip="192.168.0.212" port="63294" type="srflx" rel
 -addr="192.168.1.125" rel-port="63294" network="0"/><candidate foundation="4" component="2" protocol="udp" priority="1677724414" generation="0" id="72" ip="81.83.192.223" port="5011" type="srflx" rel-addr="192.168.1.125" rel-port="5011" network="0"/></transport></channel><channel initiator="true"><payload-type id="96" name="opus" channels="2" clockrate="48000"><parameter name="usedtx" value="1"/></payload-type><payload-type id="97" name="SILK" channels="1" clockrate="24000"/><payload-type id="98" name="SILK" channels="1" clockrate="16000"/><payload-type id="9" name="G722" channels="1" clockrate="8000"/><payload-type id="100" name="speex" channels="1" clockrate="32000"/><payload-type id="102" name="speex" channels="1" clockrate="16000"/><payload-type id="0" name="PCMU" channels="1" clockrate="8000"/><payload-type id="8" name="PCMA" channels="1" clockrate="8000"/><payload-type id="103" name="iLBC" channels="1" clockrate="8000"/><payload-type id="3" name="GSM" channels="1" clockrate="8
 000"/><payload-type id="104" name="speex" channels="1" clockrate="8000"/><payload-type id="101" name="telephone-event" channels="1" clockrate="8000"/><transport xmlns="urn:xmpp:jingle:transports:ice-udp:1"/></channel></content></conference></iq>
23:27:55.689 INFO: [21] org.jitsi.videobridge.Videobridge.info() Created conference 990e466165302d08. The total number of conferences is now 1, channels 0.
23:27:55.708 INFO: [21] org.jitsi.videobridge.Conference.info() Created content audio of conference 990e466165302d08. The total number of conferences is now 1, channels 0.
23:27:56.323 INFO: [21] org.jitsi.impl.libjitsi.LibJitsiImpl.info() Failed to initialize service implementation org.jitsi.impl.neomedia.MediaServiceImpl. Will continue without it.
java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
        at java.awt.Dimension.<clinit>(Dimension.java:88)
        at org.jitsi.impl.neomedia.device.DeviceConfiguration.<clinit>(DeviceConfiguration.java:186)
        at org.jitsi.impl.neomedia.MediaServiceImpl.<init>(MediaServiceImpl.java:150)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at java.lang.Class.newInstance(Class.java:374)
        at org.jitsi.impl.libjitsi.LibJitsiImpl.getService(LibJitsiImpl.java:142)
        at org.jitsi.impl.libjitsi.LibJitsiOSGiImpl.getService(LibJitsiOSGiImpl.java:86)
        at org.jitsi.service.libjitsi.LibJitsi.invokeGetServiceOnImpl(LibJitsi.java:163)
        at org.jitsi.service.libjitsi.LibJitsi.getMediaService(LibJitsi.java:115)
        at org.jitsi.videobridge.Conference.getMediaService(Conference.java:710)
        at org.jitsi.videobridge.Content.getMediaService(Content.java:584)
        at org.jitsi.videobridge.RtpChannel.getMediaService(RtpChannel.java:749)
        at org.jitsi.videobridge.RtpChannel.<init>(RtpChannel.java:216)
        at org.jitsi.videobridge.AudioChannel.<init>(AudioChannel.java:35)
        at org.jitsi.videobridge.Content.createRtpChannel(Content.java:207)
        at org.jitsi.videobridge.Videobridge.handleColibriConferenceIQ(Videobridge.java:617)
        at org.jitsi.videobridge.Videobridge.handleColibriConferenceIQ(Videobridge.java:449)
        at org.jitsi.videobridge.xmpp.ComponentImpl.handleColibriConferenceIQ(ComponentImpl.java:204)
        at org.jitsi.videobridge.xmpp.ComponentImpl.handleIQRequest(ComponentImpl.java:350)
        at org.jitsi.videobridge.xmpp.ComponentImpl.handleIQ(ComponentImpl.java:281)
        at org.jitsi.videobridge.xmpp.ComponentImpl.handleIQ(ComponentImpl.java:233)
        at org.jitsi.videobridge.xmpp.ComponentImpl.handleIQGet(ComponentImpl.java:332)
        at org.xmpp.component.AbstractComponent.processIQRequest(AbstractComponent.java:511)
        at org.xmpp.component.AbstractComponent.processIQ(AbstractComponent.java:289)
        at org.xmpp.component.AbstractComponent.processQueuedPacket(AbstractComponent.java:239)
        at org.xmpp.component.AbstractComponent.access$100(AbstractComponent.java:81)
        at org.xmpp.component.AbstractComponent$PacketProcessor.run(AbstractComponent.java:1051)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
23:27:57.853 INFO: [21] org.ice4j.ice.Agent.gatherCandidates() Gather candidates for component audio.RTP
23:27:57.905 INFO: [21] org.ice4j.ice.Agent.createComponent()   [fe80:0:0:0:a00:27ff:fe36:694a]:10000/udp (host)
23:27:57.910 INFO: [21] org.ice4j.ice.Agent.createComponent()   [fe80:0:0:0:268f:ea33:dba6:2f39]:10000/udp (host)
23:27:57.911 INFO: [21] org.ice4j.ice.Agent.createComponent()   192.168.1.145:10000/udp (host)
23:27:57.911 INFO: [21] org.ice4j.ice.Agent.gatherCandidates() Gather candidates for component audio.RTCP
23:27:57.923 INFO: [21] org.ice4j.ice.Agent.createComponent()   [fe80:0:0:0:a00:27ff:fe36:694a]:10001/udp (host)
23:27:57.926 INFO: [21] org.ice4j.ice.Agent.createComponent()   [fe80:0:0:0:268f:ea33:dba6:2f39]:10001/udp (host)
23:27:57.927 INFO: [21] org.ice4j.ice.Agent.createComponent()   192.168.1.145:10001/udp (host)
java.lang.NullPointerException
        at org.jitsi.videobridge.RtpChannel.<init>(RtpChannel.java:219)
        at org.jitsi.videobridge.AudioChannel.<init>(AudioChannel.java:35)
        at org.jitsi.videobridge.Content.createRtpChannel(Content.java:207)
        at org.jitsi.videobridge.Videobridge.handleColibriConferenceIQ(Videobridge.java:617)
        at org.jitsi.videobridge.Videobridge.handleColibriConferenceIQ(Videobridge.java:449)
        at org.jitsi.videobridge.xmpp.ComponentImpl.handleColibriConferenceIQ(ComponentImpl.java:204)
        at org.jitsi.videobridge.xmpp.ComponentImpl.handleIQRequest(ComponentImpl.java:350)
        at org.jitsi.videobridge.xmpp.ComponentImpl.handleIQ(ComponentImpl.java:281)
        at org.jitsi.videobridge.xmpp.ComponentImpl.handleIQ(ComponentImpl.java:233)
        at org.jitsi.videobridge.xmpp.ComponentImpl.handleIQGet(ComponentImpl.java:332)
        at org.xmpp.component.AbstractComponent.processIQRequest(AbstractComponent.java:511)
        at org.xmpp.component.AbstractComponent.processIQ(AbstractComponent.java:289)
        at org.xmpp.component.AbstractComponent.processQueuedPacket(AbstractComponent.java:239)
        at org.xmpp.component.AbstractComponent.access$100(AbstractComponent.java:81)
        at org.xmpp.component.AbstractComponent$PacketProcessor.run(AbstractComponent.java:1051)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

···

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


#2

Closed #17.

···

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


#3

Jitsi Videobridge employs the class java.awt.Dimension which in turn utilizes the class java.awt.Toolkit. Both classes are part of the Java Runtime Environment and their operation (to the extent required by Jitsi Videobridge) under headless conditions are guaranteed. Consequently, this issue is of no concern to Jitsi Videobridge and is likely a setup glitch on your side or a distribution-specific packaging problem.

···

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


#4

Looks like you're right. I tried with a test script just to initialize a java.awt.Toolkit object, and it also fails, but provided more information. Apparently my setup was missing the libcups package which is a dependency of libmawt. Installing that fixed the problem.

···

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