Exception in thread "main" org.xerial.snappy.SnappyError: [FAILED_TO_LOAD_NATIVE_LIBRARY] no native library is found for os.name=AIX and os.arch=ppc64

未关闭
#603 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
java
领域
backend

调研方向

Start by reading SnappyLoader.findNativeLibrary and loadNativeLibrary, especially the platform-specific library name and extension handling mentioned in the report. Check how the AIX/ppc64 native library is packaged and compare that path with the loader’s lookup; run the relevant tests for native library loading. Done means the default lookup can load the packaged AIX library without requiring custom system properties.

由索引模型根据 Issue 内容生成。

描述

I've observed that while running the snappy in the IBM AIX 7.2 it gives the error,

Exception in thread "main" org.xerial.snappy.SnappyError: [FAILED_TO_LOAD_NATIVE_LIBRARY] no native library is found for os.name=AIX and os.arch=ppc64
        at org.xerial.snappy.SnappyLoader.findNativeLibrary(SnappyLoader.java:345)
        at org.xerial.snappy.SnappyLoader.loadNativeLibrary(SnappyLoader.java:179)
        at org.xerial.snappy.SnappyLoader.loadSnappyApi(SnappyLoader.java:157)
        at org.xerial.snappy.Snappy.init(Snappy.java:70)
        at org.xerial.snappy.Snappy.<clinit>(Snappy.java:47)

I've tried to find the RCA, to do so I've first manually put the aix related native libraries and passed them as variables

jdk/bin/./java -Dorg.xerial.snappy.lib.path=/tmp -Dorg.xerial.snappy.lib.name=libsnappyjava.a -cp Demo.jar:lib/* com.demo.Bootstrap

And it worked! So I tried to find that by default (if we're not passing any variable) why it's not able to find that file?

So I've added a print statement and tried to debug, there I've noticed that it tries to find the file at the correct destination, But what I've noticed is that the file extension is different.

has resource /org/xerial/snappy/native/AIX/ppc64/libsnappyjava.so

And the native file that is present in the jar have a different file extension,

total 264
-rw-r--r-- 1 root root 266695 Aug  7 05:49 libsnappyjava.a
root@demo:/demo/snappy/org/xerial/snappy/native/AIX/ppc64#

And in the code, the file's extension is entirely dependent on the System class, And the System class it self returns the .so extension instead of .a and this extension issue is also a very popular issue.

So what's the correct extension?? Is there no alternate way than passing the variable??

主要语言
Java
星标
1.1k
派生
261
平均合并
2 分钟
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

xerial/snappy-java 的其他 Issue

查看 xerial/snappy-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。