简体   繁体   中英

JNA : Applet Alert during startup of application

I try to get familiar with the JNA. So I implement a simple JAVA application which load a C DLL and execute one function from this 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:

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.

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

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. 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. I don't know why TM do this, but it caused all of my applet alerts. 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. Now JNA works without problems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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