在OSGi中运行JAI [英] Running JAI in OSGi

查看:118
本文介绍了在OSGi中运行JAI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在OSGi容器(spring-dm)中运行Java Advanced Imaging(JAI).我可以访问JAI库,但是当我第一次调用JAI时会收到以下错误:

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

这些DLL位于类路径上,并在我的清单中作为Bundle-NativeCode库引用.是否可以在OSGi中运行本机JAI DLL?如果是这样,我该怎么办?

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?

(澄清)

我下载了Windows JAI库,并从下载包中提取了JAR和DLL.

I downloaded the Windows JAI library and extracted JARs and DLLs from the download package.

维护:


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:

推荐答案

Bundle-NativeCode块的声明看起来不正确.根据OSGi规范(我强烈建议您下载-非常简单),应该在同一子句中指定单个平台的所有库,以便将其更改为:

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:

Bundle-NativeCode: libs/mlib_jai_mmx.dll; libs/mlib_jai_util.dll; libs/mlib_jai.dll; 
 osname=WindowsXP; 
 processor=x86

通常,我不建议您滚动自己的捆绑清单,如果您可以在其他地方找到它们(除了本机代码部分,这很简单).在这种情况下,我在Spring 存储库中找到了其中的2个.它不包括本机代码部分-可能是由于许可证问题所致.

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.

这篇关于在OSGi中运行JAI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆