在 OSGi 中运行 JAI
我正在尝试在 OSGi 容器(spring-dm)中运行 Java 高级成像(JAI)。我能够访问 JAI 库,但在第一次调用 JAI 时收到以下错误:
Error: Could not load mediaLib accelerator wrapper classes. Continuing in pure Java mode. Occurs in: com.sun.media.jai.mlib.MediaLibAccessor com.sun.media.jai.mlib.MediaLibLoadException
DLL 位于类路径上,并在清单中作为 Bundle-NativeCode 库引用。是否可以在 OSGi 中运行本机 JAI DLL?如果是这样,我需要做什么?
(编辑:澄清)
我下载了 Windows JAI 库并从下载包中提取了 JAR 和 DLL。
主要节日:
Manifest-Version: 1.0 Bundle-Name: Java Advanced Imaging Bundle-SymbolicName: javax.media.jai Bundle-Version: 1.1.3 Bundle-ClassPath: libs/, jai_codec.jar, jai_core.jar, mlibwrapper_jai.jar Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-NativeCode: libs/mlib_jai_mmx.dll; osname=WindowsXP; processor=x86, libs/mlib_jai_util.dll; osname=WindowsXP; processor=x86, libs/mlib_jai.dll; osname=WindowsXP; processor=x86 Export-Package:
I'm trying to run Java Advanced Imaging (JAI) within an OSGi container (spring-dm). I'm able to access the JAI libraries, but receive the following error when I call JAI for the first time:
Error: Could not load mediaLib accelerator wrapper classes. Continuing in pure Java mode. Occurs in: com.sun.media.jai.mlib.MediaLibAccessor com.sun.media.jai.mlib.MediaLibLoadException
The DLLs are on the classpath and referenced as Bundle-NativeCode libraries in my Manifest. Is it possible to run the native JAI DLLs within OSGi? If so, what do I need to do?
(edit: clarifications)
I downloaded the Windows JAI library and extracted JARs and DLLs from the download package.
Mainfest:
Manifest-Version: 1.0 Bundle-Name: Java Advanced Imaging Bundle-SymbolicName: javax.media.jai Bundle-Version: 1.1.3 Bundle-ClassPath: libs/, jai_codec.jar, jai_core.jar, mlibwrapper_jai.jar Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-NativeCode: libs/mlib_jai_mmx.dll; osname=WindowsXP; processor=x86, libs/mlib_jai_util.dll; osname=WindowsXP; processor=x86, libs/mlib_jai.dll; osname=WindowsXP; processor=x86 Export-Package:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Bundle-NativeCode
块的声明看起来不正确。根据 OSGi 规范(我强烈建议您下载 - 它非常简单),单个平台的所有库都应在同一个子句中指定,因此将其更改为:一般来说,我不建议滚动您自己的库如果您可以在其他地方找到它们,则捆绑清单会显示(除了本机代码部分之外,这一个非常简单)。在本例中,我在 Spring 存储库 中找到了其中的 2 个。它不包括本机代码部分 - 可能是由于许可证问题。
The declaration of the
Bundle-NativeCode
block doesn't look right. According to the OSGi specification (which I highly recommend you download - it's pretty straight-forward), all libraries for a single platform should be specified in the same clause, so that changes it to:In general I don't recommend rolling your own bundle manifests if you can find them elsewhere (this one is pretty simple besides the native code part). In this case, I found them 2 of them at the Spring repository. It doesn't include the native code part - probably due to license issues.