如何在2.1 RC2中包含本机库(JNI)? [英] How to include native library (JNI) in play 2.1 RC2?
问题描述
我正在使用 Play Framework 2.1 RC2
来构建一个使用 TFS Java SDK
的应用程序。 TFS API
需要包含一组本机dll(例如 native_auth.dll
)。
I am using Play Framework 2.1 RC2
to build an application that utilizes TFS Java SDK
. TFS APIs
require a set of native dlls (e.g. native_auth.dll
) to be included.
如何在应用程序运行时使本机库可用?我在哪里可以指定要包含的原生dll?
How do I make the native libraries available when the application is running? Where can I specify the native dlls to be included?
更新:
我试过 static
block System.load(full path)
并使用
app.classloader()加载它.loadClass(NativeUtils.class);
,但我仍然得到例外:
Update:
I tried static
block System.load("full path")
and loaded it using
app.classloader().loadClass("NativeUtils.class");
, but still I get the exception:
java.lang.UnsatisfiedLinkError:com.microsoft.tfs.jni。 internal.platformmisc.NativePlatformMisc.nativeGetEnvironmentVariable(Ljava /郎/字符串;)Ljava /郎/字符串;
at com.microsoft.tfs.jni.internal.platformmisc.NativePlatformMisc.nativeGetEnvironmentVariable(Native Method)
at com.microsoft.tfs.jni.internal.platformmisc.NativePlatformMisc.getEnvironmentVariable(NativePlatformMisc.java:134 )
at com.microsoft.tfs.jni.PlatformMiscUtils.getEnvironmentVariable(PlatformMiscUtils.java:52)
at com.microsoft.tfs.core.config.httpclient.DefaultHTTPClientFactory.shouldAcceptUntrustedCertificates(DefaultHTTPClientFactory.java:288 )
at com.microsoft.tfs.core.config.httpclient.DefaultHTTPClientFactory.configureClientParams(DefaultHTTPClientFactory.java:324)
at com.microsoft.tfs.core.config.httpclient.DefaultHTTPClientFactory.newHTTPClient(DefaultHTTPClientFactory) .java:137)
at com.microsoft.tfs.core.TFSConnection.getHTTPClient(TFSConnection.java:1041)
at com.microsoft.tfs.core.TFSConnection.getWebService(TFSConnection.java:874) )com.microsoft.tfs.core.config.client.DefaultClientFactor
y $ 9.newClient(DefaultClientFactory.java:265)
at com.microsoft.tfs.core.config.client.DefaultClientFactory.newClient(DefaultClientFactory.java:90)
at com.microsoft.tfs.core .TFSConnection.getClient(TFSConnection.java:1470)
at com.microsoft.tfs.core.TFSTeamProjectCollection.getWorkItemClient(TFSTeamProjectCollection.java:370)
提前感谢您的投入!
推荐答案
我找不到问题的解决方案,否则而不是运行游戏开始,并在开发糟糕时将其作为播放开始运行,所以我创建了一个问题: https://github.com/playframework/playframework/issues/2212 。如果遇到问题,可以添加注释,描述情况。
添加评论会在问题列表中将其置于上方。问题的上限是,更高的概率,它将被修复。
I didn't find a solution to a problem, else than running play start, and running it as play start while development sucks, so I've created an issue: https://github.com/playframework/playframework/issues/2212 . If you encounter the problem, you can add there a comment, describing the situation. Adding there a comment rases it upper in issue list. Upper the issue is, higher probability, that it'll be fixed.
这篇关于如何在2.1 RC2中包含本机库(JNI)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!