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

No such file or directory (Possible cause: architecture word width mismatch) #102

Open
sgjava opened this issue Jan 30, 2018 · 2 comments
Open

Comments

@sgjava
Copy link

sgjava commented Jan 30, 2018

Trying to run jnaerator on ARMv8 (64 bit) and it sharts with the stack trace below. Is there a 64 bit ARM version libbridj.so I can hack into jnaerator jar? Or will this be fixed in jnaerator at some point?

java -jar jnaerator.jar -I /usr/include/arm-linux-gnueabihf -library libgpiod -mode Directory -runtime JNA -preferJavac -beanStructs -noLibBundle /usr/local/lib/libgpiod.so /usr/include/linux/time.h ../../libgpiod/include/gpiod.h ../../libgpiod/src/lib/core.c
java.lang.RuntimeException: Failed to initialize BridJ (java.lang.UnsatisfiedLinkError: /tmp/BridJExtractedLibraries3289240404502411730/libbridj.so: /tmp/BridJExtractedLibraries3289240404502411730/libbridj.so: cannot open shared object file: No such file or directory (Possible cause: architecture word width mismatch))
	at org.bridj.Platform.initLibrary(Platform.java:444)
	at org.bridj.Platform.<clinit>(Platform.java:228)
	at com.ochafik.lang.jnaerator.NativePlatform.getCurrentPlatform(NativePlatform.java:49)
	at com.ochafik.lang.jnaerator.JNAerator$1.<init>(JNAerator.java:232)
	at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:230)
	at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:203)
Caused by: java.lang.UnsatisfiedLinkError: /tmp/BridJExtractedLibraries3289240404502411730/libbridj.so: /tmp/BridJExtractedLibraries3289240404502411730/libbridj.so: cannot open shared object file: No such file or directory (Possible cause: architecture word width mismatch)
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
	at java.lang.Runtime.load0(Runtime.java:809)
	at java.lang.System.load(System.java:1086)
	at org.bridj.Platform.initLibrary(Platform.java:420)
	... 5 more
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.bridj.Platform.sizeOf_ptrdiff_t()I
	at org.bridj.Platform.sizeOf_ptrdiff_t(Native Method)
	at org.bridj.Platform.<clinit>(Platform.java:232)
	at com.ochafik.lang.jnaerator.NativePlatform.getCurrentPlatform(NativePlatform.java:49)
	at com.ochafik.lang.jnaerator.JNAerator$1.<init>(JNAerator.java:232)
	at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:230)
	at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:203)
@gabrielandrade2
Copy link

gabrielandrade2 commented Oct 26, 2020

I have a similar issue when running sarxos webcam-capture library on a aarch64 platform (Snapdragon 410c).

java -jar csitest.jar                                                            
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.lang.RuntimeException: Failed to initialize BridJ (java.lang.UnsatisfiedLinkError: /tmp/BridJExtractedLibraries2)
        at org.bridj.Platform.initLibrary(Platform.java:447)
        at org.bridj.Platform.<clinit>(Platform.java:231)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<clinit>(OpenIMAJGrabber.java:59)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.ja)
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:81)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.UnsatisfiedLinkError: /tmp/BridJExtractedLibraries2571491173185175723/libbridj.so: /tmp/BridJExt)
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
        at java.lang.Runtime.load0(Runtime.java:809)
        at java.lang.System.load(System.java:1086)
        at org.bridj.Platform.initLibrary(Platform.java:423)
        ... 7 more
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61)
Caused by: com.github.sarxos.webcam.WebcamException: java.util.concurrent.ExecutionException: com.github.sarxos.webcak
        at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:124)
        at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:893)
        at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:866)
        at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:845)
        at Main.main(Main.java:36)
        ... 5 more
Caused by: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:192)
        at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:116)
        ... 9 more
Caused by: com.github.sarxos.webcam.WebcamException: Cannot execute task
        at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.process(WebcamProcessor.java:72)
        at com.github.sarxos.webcam.WebcamProcessor.process(WebcamProcessor.java:140)
        at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:46)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.newGrabber(WebcamDefaultDrive)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver.getDevices(WebcamDefaultDriver.java:117)
        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:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.UnsatisfiedLinkError: org.bridj.Platform.sizeOf_ptrdiff_t()I
        at org.bridj.Platform.sizeOf_ptrdiff_t(Native Method)
        at org.bridj.Platform.<clinit>(Platform.java:235)
        at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<clinit>(OpenIMAJGrabber.java:59)
        at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.ja)

@sgjava
Copy link
Author

sgjava commented Oct 26, 2020

Just switch to HawtJNI and generate from C. JNI way faster than JNA any ways. I don't think they are going to ever fix jnarator https://github.com/sgjava/java-periphery uses HawtJNI.

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