jitsi / libjitsi

Advanced Java media library for secure real-time audio/video communication.
Apache License 2.0
628 stars 281 forks source link

Apache Felix (OSGi): Allow X11 to the Java Classloader. #514

Closed traud closed 4 years ago

traud commented 4 years ago

Otherwise, sometimes (not reproducible), JAWT Rendering is not able to load the class sun.awt.x11.XErrorHandlerUtil.

traud commented 4 years ago

Although I am not able to reproduce this issue (it happens sometimes when a VP8 based video call is started; tested in Ubuntu 19.10), I verified that the proposed change fixes the issue. I simply did a class load of this class in the originating paint method. Here is the full stacktrace:

INFO: [859] org.jitsi.impl.neomedia.codec.video.vp8.DePacketizer.log() Opened VP8 depacketizer
SEVERE: [45] util.UtilActivator.uncaughtException().122 An uncaught exception occurred in thread=Thread[AWT-EventQueue-1,6,main] and message was: sun/awt/X11/XErrorHandlerUtil
java.lang.NoClassDefFoundError: sun/awt/X11/XErrorHandlerUtil
    at org.jitsi.impl.neomedia.jmfext.media.renderer.video.JAWTRenderer.paint(Native Method)
    at org.jitsi.impl.neomedia.jmfext.media.renderer.video.JAWTRendererVideoComponent.paint(JAWTRendererVideoComponent.java:193)
    at org.jitsi.impl.neomedia.jmfext.media.renderer.video.JAWTRendererVideoComponent.update(JAWTRendererVideoComponent.java:252)
    at sun.awt.RepaintArea.updateComponent(RepaintArea.java:255)
    at sun.awt.X11.XRepaintArea.updateComponent(XRepaintArea.java:51)
    at sun.awt.RepaintArea.paint(RepaintArea.java:232)
    at sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:584)
    at java.awt.Component.dispatchEventImpl(Component.java:4965)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
    at java.awt.EventQueue$4.run(EventQueue.java:733)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
    at org.GNOME.Accessibility.AtkWrapper$6.dispatchEvent(AtkWrapper.java:705)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: sun.awt.X11.XErrorHandlerUtil not found by org.jitsi.libjitsi [126]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1639)
    at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    ... 28 more