简体   繁体   English

JNA:应用程序启动期间的小程序警报

[英]JNA : Applet Alert during startup of application

I try to get familiar with the JNA. 我试图熟悉JNA。 So I implement a simple JAVA application which load a C DLL and execute one function from this DLL. 因此,我实现了一个简单的JAVA应用程序,该应用程序加载了C DLL并从该DLL执行一个功能。 If I start the application I got many applet alerts. 如果启动该应用程序,则会收到许多小程序警报。 After allow all of them the application hangs and do nothing at all. 允许所有这些对象后,应用程序将挂起,并且什么也不做。 The output in netbeans IDE is the following: netbeans IDE中的输出如下:

Current policy properties:
mmc.sess_pe_act.block_unsigned: false
window.num_max: 5
jscan.sess_applet_act.sig_trusted: pass
jscan.sess_applet_act.block_all: false
file.destructive.state: disabled
window.num_limited: true
jscan.sess_applet_act.unsigned: instrument
mmc.sess_pe_act.action: validate
jscan.session.daemon_protocol: http
file.read.state: disabled
mmc.sess_pe_act.block_invalid: true
mmc.sess_pe_act.block_blacklisted: false
jscan.session.policyname: TU1DIERlZmF1bHQgUG9saWN5
net.bind_enable: false
mmc.sess_cab_act.block_unsigned: false
file.nondestructive.state: disabled
jscan.session.origin_uri: http://repo1.maven.org/maven2/net/java/dev/jna/jna/4.4.0/jna-4.4.0.jar
mmc.sess_cab_act.action: validate
net.connect_other: false
jscan.session.user_ipaddr: 172.20.65.19
jscan.sess_applet_act.sig_invalid: instrument
thread.thread_num_max: 8
mmc.sess_cab_act.block_invalid: true
jscan.sess_applet_act.sig_blacklisted: block
net.connect_src: true
thread.thread_num_limited: true
jscan.sess_applet_act.stub_out_blocked_applet: true
mmc.sess_cab_act.block_blacklisted: true
jscan.session.user_name: MTcyLjIwLjY1LjE5
thread.threadgroup_create: false
file.write.state: disabled
-->> returning Frame NULL
BaseDialog: owner frame is a java.awt.Frame
-->> returning Frame NULL
BaseDialog: owner frame is a java.awt.Frame
-->> returning Frame NULL
BUILD STOPPED (total time: 14 seconds)

I also try an example from internet to check if this is related to the DLL which I try to load, but also with this example it fails. 我还尝试从Internet上查看一个示例,以检查该示例是否与我尝试加载的DLL有关,但在此示例中,该示例也会失败。

The example looks like this 这个例子看起来像这样

import com.sun.jna.Library;
import com.sun.jna.Native;


public interface testDll extends Library {

    testDll INSTANCE = (testDll) Native.loadLibrary("msvcrt", testDll.class);

    void printf(String format, Object... args);    
}

Here the main function which calls this testDll 这里调用这个testDll的主要功能

public static void main(String[] args) {

    testDll dll = testDll.INSTANCE;
    dll.printf("hallo");
}

Could be that this problem has something to do with the JAVA security settings, but I have no clue how to solve this. 可能是这个问题与JAVA安全设置有关,但是我不知道如何解决此问题。 Maybe someone had similar issue and can help me on this. 也许有人遇到过类似的问题,可以帮助我。 Thanks, Boo 谢谢,嘘

I found the reason why it was not working. 我找到了它不起作用的原因。 In our company they use anti virus from Trend Micro. 在我们公司中,他们使用趋势科技的防病毒软件。 It seems that TM modify jar files if you download them and add some extra package 'trend' to it. 如果您下载了TM文件,并为其添加了一些额外的软件包“趋势”,TM似乎会对其进行修改。 I don't know why TM do this, but it caused all of my applet alerts. 我不知道为什么TM这样做,但是它引起了我所有的applet警报。 Just deletion of 'trend' package didn't solve the problem. 只是删除“趋势”包并不能解决问题。 I got the JNA sources from GitHub repository and use at the moment the jar from this build. 我从GitHub存储库中获取了JNA源码,并在此版本的jar中使用它。 Now JNA works without problems. 现在,JNA可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM