-
Notifications
You must be signed in to change notification settings - Fork 23
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
Java 17 Rodbus Setup Question: Unable to load any of the included native libraries #129
Comments
What's your OS and CPU architecture?
…On Thu, Dec 14, 2023, 1:40 PM ejrfisher ***@***.***> wrote:
I have a project that I am trying to setup. Its a spring boot app using
Java 17
When I attempt to create the Runtime object similarly to the example files
I run into an issue regarding some native libraries.
I have hopefully formatted the structure below into somewhat orderly
manner so that it can be easy to follow my setup and identify any glaring
issues.
Thanks!
Exception Stack Trace
2023-12-14 13:47:14.877 [http-nio-591-exec-1] ERROR o.a.c.c.C.[.[localhost].[/].[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.ExceptionInInitializerError] with root cause
java.lang.Exception: Unable to load any of the included native libraries
at io.stepfunc.rodbus.NativeFunctions.<clinit>(NativeFunctions.java:53)
at io.stepfunc.rodbus.NativeFunctions$Wrapped.runtime_create(NativeFunctions.java:193)
at io.stepfunc.rodbus.Runtime.<init>(Runtime.java:37)
Method Throwing Error (specifically the second line here is the culprit)
RuntimeConfig runtimeConfig = new RuntimeConfig().withNumCoreThreads(ushort(4));
Runtime runtime = new Runtime(runtimeConfig);
Java Version
java 17.0.6 2023-01-17 LTS
Java(TM) SE Runtime Environment (build 17.0.6+9-LTS-190)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.6+9-LTS-190, mixed mode, sharing)
pom.xml snippet
<dependency>
<groupId>io.stepfunc</groupId>
<artifactId>rodbus</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>joou</artifactId>
<version>0.9.4</version>
</dependency>
class imports
import static org.joou.Unsigned.ubyte;
import static org.joou.Unsigned.ushort;
import io.stepfunc.rodbus.*;
import io.stepfunc.rodbus.Runtime;
Let me know if I am overlooking something in my setup here or if there is
any additional information that you need to help me with this issue!
Thanks
—
Reply to this email directly, view it on GitHub
<#129>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACKVFL6XGLLCMNV2DB26F3YJNW3FAVCNFSM6AAAAABAVQISZ6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGA2DENJUG4YDANA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
MacOs - 14.2 If it at all matters: I have also tried running the application in a docker container, and although the error output is different the culprit seems to be the same Runtime object |
There is no MacOS ARM binary in the JAR, so that's the error I'd expect
there.
Until recently GitHub didn't have a ARM runner for MAC. I think it would be
possible to add this to the CI now.
How does docker work on Mac? There is a linux aarch64 native library in the
JAR.
…On Thu, Dec 14, 2023, 1:52 PM ejrfisher ***@***.***> wrote:
MacOs
ARM - Apple M1 Max
If it at all matters: I have also tried running the application in a
docker container, and although the error output is different the culprit
seems to be the same Runtime object
—
Reply to this email directly, view it on GitHub
<#129 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACKVFIQ7YDG5MFP73DCEILYJNYLPAVCNFSM6AAAAABAVQISZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJWG4YTEOJUHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
From my understanding the docker daemon manages the "architecture" of the built image. I can try to set a target platform/architecture otherwise its just based off the base image which for this specific example was eclipse-temurin:17-alpine which was AMD64 not ARM64/aarch64... Ill try and find an image to build off of that is actually aarch64 and go from there |
I now have a linux based image running with aarch64 architecture for the same app in docker container but I am still running into an error when creating the Runtime Object . Error Message
os info
Architecture info
Let me know if theres any more info I can provide |
Moved my project up to java 21 to see if that changed anything locally or in docker. No change |
No new release for the Rodbus library yet. I plan to do a maintenance release soon that will incorporate some more debug info into the Java library loading process. Maybe that will shed some light on what's going on in your app. |
Sounds great! Thanks for the update edit: seems like the Runtime Object is no longer the culprit for this error but instead its moved down to either |
@ejrfisher 1.4.0 release now includes a bundled native library for |
@jadamcrain Were you able to resolve this issue? Would like to close this ticket if so. |
Yes sorry! This is resolved |
I have a project that I am trying to setup. Its a spring boot app using Java 17
When I attempt to create the Runtime object similarly to the example files I run into an issue regarding some native libraries.
I have hopefully formatted the structure below into somewhat orderly manner so that it can be easy to follow my setup and identify any glaring issues.
Thanks!
Exception Stack Trace
Method Throwing Error (specifically the second line here is the culprit)
Java Version
pom.xml snippet
class imports
Let me know if I am overlooking something in my setup here or if there is any additional information that you need to help me with this issue!
Thanks
The text was updated successfully, but these errors were encountered: