I have created one aspx application to get client system information. For getting the client system information, i have created a JNI library.
I have used java script to load a applet jar which in-turns will load the JNI library where the JNI library is located in every client system.
I have tested this application and it is working fine.
For testing purpose, i have hosted my application in two to three system. For eg, Server A, B and C. I had access the server pages in a system (TEST system).
When i access the page from system A and C in the TEST system, the application works fine.
But when i access the page from system B in the TEST system, the java script gives error.
The error is object does not support this method or property in the line Obj.GetUserName().
Sample source is below:
document.write('<applet code="Client.Information.class" width="0" height="0" MAYSCRIPT archive="Client.jar" id="Obj"></applet>');
function ClientInformation ()
public class Information extends Applet
public native string GetUserName();
public native string GetSystemMemory();
As surfing through internet, updating the java version and clearing the browser cache will solve this problem. But i have tried this.
Please guide me to solve this error.
Thanks for your reply.
Google how to use JNI in an applet - you can't just do that, there are all kinds of security layers in your way and depending on the version of Java those layers will be either strict or incredibly strict. As far as I know, even in a signed applet you can't just call loadLibrary, you need to go through an AccessController. Now I've given you stuff to google.
Is your jar signed? Do you use AccessController as suggested? What you did in the Control Panel does not disable the applet security, only a certain aspect of it.
Does the java console show something? Is it an inability to access the java method or something fishy happens inside the java method? (Hint: try to empty the method and see if the same happens.)
Since it works with two servers and not the third, are the deployments identical 100%. If not, what are the differences?
1) Yes, i have properly signed the jar file.
2) I will try with Access Controller as suggested.
3) The java does not show any error.
4) Can you please explain this "Hint: try to empty the method and see if the same happens"?
5) All the three server are identical (Different can be in OS and RAM). Another point is that the about error will pop suddenly in the working server also.