在WAR文件中使用SIGAR API [英] Using SIGAR API inside a WAR file

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

问题描述

我遇到了Hyperic的Sigar API(http://www.hyperic.com/products/sigar),它是Java的系统信息和报告API。它大量使用JNI来收集数据,而独立版本包含/ lib文件夹中的.SO和.DLL文件。

I came across Sigar API from Hyperic (http://www.hyperic.com/products/sigar) which is a system information and reporting API for Java. It heavily uses JNI to gather data, and standalone version contains .SO and .DLL files in a /lib folder.

它在独立模式下工作正常,但我想要在WAR中使用此库。在启动服务器时,如果没有在-Djava.library.path中指定lib路径,是否仍然可以这样做?我希望能够将它捆绑在WAR文件中并将其部署到正在运行的服务器中。

It works fine in Standalone mode, but I want to use this library inside a WAR. Is there anyway to do that without specifying the lib path in "-Djava.library.path" when starting the server? I want to be able to bundle it inside the WAR file and deploy it into a running server.

谢谢。

推荐答案

我使用了以下设置。

我将所有内容(SO / DLL)文件复制到WAR文件中lib文件夹。然后我将它部署到JBoss,它没有任何自定义系统属性设置。

I copied all the content (SO / DLL) files to WAR file's lib folder. Then I deployed it to JBoss, and it worked without any custom system property setup.

这是否特定于JBoss?或者我可以在任何符合J2EE的服务器中期待这种行为吗?

Is this specific to JBoss? or can I expect this behavior in any J2EE compliant server?

这篇关于在WAR文件中使用SIGAR API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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