Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException on OpenIMAJGrabber.startSession() on Raspbian #184

Open
tbbach opened this issue Feb 27, 2014 · 4 comments
Open

NullPointerException on OpenIMAJGrabber.startSession() on Raspbian #184

tbbach opened this issue Feb 27, 2014 · 4 comments

Comments

@tbbach
Copy link
Contributor

tbbach commented Feb 27, 2014

Hi, I'm trying to use webcam-capture on a rapsberrypi with Raspbian but I'm facing the following error.

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Java HotSpot(TM) Client VM warning: You have loaded library /tmp/BridJExtractedLibraries6248188658427517212/libbridj.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
[Webcam HD Pro Webcam C920 /dev/video0]
Exception in thread "AWT-EventQueue-0" com.github.sarxos.webcam.WebcamException: Cannot execute task
    at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.process(WebcamProcessor.java:57)
    at com.github.sarxos.webcam.WebcamProcessor.process(WebcamProcessor.java:122)
    at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:38)
    at com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.open(WebcamOpenTask.java:20)
    at com.github.sarxos.webcam.Webcam.open(Webcam.java:189)
    at br.com.bachdev.totem.WebcamFX.showCam(WebcamFX.java:228)
    at br.com.bachdev.totem.WebcamFX.<init>(WebcamFX.java:40)
    at br.com.bachdev.totem.TotemWindow.initComponents(TotemWindow.java:35)
    at br.com.bachdev.totem.TotemWindow.<init>(TotemWindow.java:31)
    at br.com.bachdev.totem.TotemWindow$1.run(TotemWindow.java:146)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.lang.NullPointerException
    at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.startSession(Native Method)
    at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDevice.open(WebcamDefaultDevice.java:253)
    at com.github.sarxos.webcam.ds.cgt.WebcamOpenTask.handle(WebcamOpenTask.java:38)
    at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:66)
    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:724)

The same code that I'm testing with Raspbian works fine on Windows and MacOS.

Hope you have any clue on what might be wrong.
Thanks

@tbbach
Copy link
Contributor Author

tbbach commented Feb 27, 2014

Just saw that #176 is almost similar with mine. Sorry about that.
I will try your recommendation to use gstreamer drive and let you know the results.

@tbbach
Copy link
Contributor Author

tbbach commented Feb 27, 2014

Have the following issue now using your example GStreamerDriverExample.java

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" com.github.sarxos.webcam.WebcamException: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: No such Gstreamer factory: v4l2src
    at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:123)
    at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:706)
    at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:679)
    at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:659)
    at GStreamerDriverExample.main(GStreamerDriverExample.java:16)
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: No such Gstreamer factory: v4l2src
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:188)
    at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:115)
    ... 4 more
Caused by: java.lang.IllegalArgumentException: No such Gstreamer factory: v4l2src
    at org.gstreamer.ElementFactory.makeRawElement(ElementFactory.java:219)
    at org.gstreamer.ElementFactory.make(ElementFactory.java:211)
    at com.github.sarxos.webcam.ds.gstreamer.GStreamerDriver.getDevices(GStreamerDriver.java:107)
    at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:36)
    at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:26)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    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:724)

@sarxos
Copy link
Owner

sarxos commented Feb 27, 2014

Yes, there is such issue on Pi, but I'm not currently able to dig into it.

In regards to GStreamer issue, it seems like you do not have some GStreamer plugin installed. Have you tried:

$ sudo apt-get install gstreamer0.10-plugins-good

???

Generally if you make your GStreamer installation work fine from command line so it's able to capture image from webcam device, it should also work well from within the Java code.

@tbbach
Copy link
Contributor Author

tbbach commented Feb 28, 2014

I installed the plugins but now I am facing the following issue.

$ java -cp .:webcam-capture-0.3.10-RC6.jar:webcam-capture-driver-gstreamer-0.3.10-RC6.jar:slf4j-api-1.7.2.jar:gstreamer-java-1.5.jar:bridj-0.7-20131007.003529-54.jar:jna-3.4.0.jar:platform-3.4.0.jar GStreamerDriverExample 

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 
SLF4J: Defaulting to no-operation (NOP) logger implementation 
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/jna/jna8919857279213349675.tmp: /tmp/jna/jna8919857279213349675.tmp: cannot open shared object file: No such file or directory
                 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
                 at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1957)
                 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1882)         
                 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1843)         
                 at java.lang.Runtime.load0(Runtime.java:795)         
                 at java.lang.System.load(System.java:1061)         
                 at com.sun.jna.Native.loadNativeLibraryFromJar(Native.java:771)         
                 at com.sun.jna.Native.loadNativeLibrary(Native.java:697)         
                 at com.sun.jna.Native.<clinit>(Native.java:127)         
                 at org.gstreamer.lowlevel.GNative.loadNativeLibrary(GNative.java:48)         
                 at org.gstreamer.lowlevel.GNative.loadLibrary(GNative.java:45)         
                 at org.gstreamer.lowlevel.GstNative.load(GstNative.java:42)         
                 at org.gstreamer.lowlevel.GstNative.load(GstNative.java:39)         
                 at org.gstreamer.Gst.<clinit>(Gst.java:59)         
                 at com.github.sarxos.webcam.ds.gstreamer.GStreamerDriver.init(GStreamerDriver.java:90)         
                 at com.github.sarxos.webcam.ds.gstreamer.GStreamerDriver.<init>(GStreamerDriver.java:49)         
                 at GStreamerDriverExample.<clinit>(GStreamerDriverExample.java:11)

Tried a different jna jar from /usr/share/java but without success. Each run using jna from /usr/share/java output different results, such as the following ones.

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 
SLF4J: Defaulting to no-operation (NOP) logger implementation 
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Java HotSpot(TM) Client VM warning: You have loaded library 
/tmp/BridJExtractedLibraries7477248717284108993/libbridj.so which might have disabled stack guard. The VM will try to fix the stack guard now. 
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'. 
*** glibc detected *** java: corrupted double-linked list: 0x0126dd98 *** .
/cmd: line 1:  4231 Aborted                 (core dumped) java -cp .:webcam-capture-0.3.10-RC6.jar:webcam-capture-driver-gstreamer-0.3.10-RC6.jar:slf4j-api-1.7.2.jar:gstreamer-java-1.5.jar:/usr/share/java/jna-platform-3.2.7.jar:/usr/share/java/jna-3.2.7.jar:bridj-0.7-20131007.003529-54.jar GStreamerDriverExample
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 
SLF4J: Defaulting to no-operation (NOP) logger implementation 
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 
Java HotSpot(TM) Client VM warning: You have loaded library /tmp/BridJExtractedLibraries6758400848559422027/libbridj.so which might have disabled stack guard. The VM will try to fix the stack guard now. It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'. 
# 
# A fatal error has been detected by the Java Runtime Environment: 
# 
#  SIGSEGV (0xb) at pc=0xb6e5a8b8, pid=4336, tid=2834134128 
# 
# JRE version: Java(TM) SE Runtime Environment (7.0_40-b43) (build 1.7.0_40-b43)
# Java VM: Java HotSpot(TM) Client VM (24.0-b56 mixed mode linux-arm ) 
# Problematic frame: 
# C  [libc.so.6+0x6f8b8]  _IO_str_pbackfail+0x17ac 
# 
# Core dump written. Default location: core.4336 
# 
# An error report file with more information is saved as:  hs_err_pid4336.log

sarxos added a commit that referenced this issue Feb 26, 2015
refs #286
refs #315
refs #244
refs #219
refs #194
refs #192
refs #189
refs #184
refs #176
refs #153
refs #152
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants