Applets and certificates in jdk1.4

Hello all...
I have an applet which imports the java.awt.Robot class. I can not use the methods from a html page due to security restrictions...
I've searched high and wide for documentation on how to overcome this (as i am only going to be running this applet from my own machine)...i know it involved signing and certificates - i've tried several methods but none seem to work.....does anyone have an idea of exactly how i would go about getting this working??
Thanks in advance........
Johnno

Johno
If you're only going to run this 'applet' on your own machine why not write a program instead ?

Similar Messages

  • Signed Applet and certificat expiration

    Hi,
    My applet was signed with a Thawte certificat because it must access printers and TCP/IP layer.
    It's running in a JRE 1.3.1.
    The certifcate will soon expire.
    What will happen ?
    Will my applet still keep on running ?
    Will I be able to renew my certificate once expired or must i do it before ?
    Thanks in advance.

    I have a similar problem in that our company purchased a Verisign certificate last year that was renewed. However, you get a new certificate each year. The problem with this is that we have distributed tens of thousands of applets with one certificate that must now be replaced with a new certificate.
    According to Verisign, this is a fault of Sun for not implementing timestamping within the JRE.
    Is there a plan for timestamping signed certificates?

  • Signed Applet and certificate Expiration

    Hi,
    I have got an applet that was signed with a Thawte certificate because it must access printers and TCP/IP layer.
    It's running in a JRE 1.3.1.
    The certifcate will soon expire.
    What will happen ?
    Will my signed applet still keep on running ?
    Will I be able to renew my certificate once expired or must i do it before ?
    Thanks in advance.

    it'll run... fine... except that the user will be warned that the certificate has expired and they'll have to decide to let the applet run or not... so the user can have it not run.
    you can renew your certificate any time you want, and re-sign your jars with the new certificate.

  • Security issues with applets and windows Vista when printing to file

    Hi, everyone
    I am currently developing an application that prints out the result of some calculations.
    from a Javascript file, the output finally ends up in a java applet that should print the file in a special printer.
    For debugging purposes I have created a File printer that creates a file from the output comming to the printer; this way I can debug what commands the printer is receiving.
    This worked well on Windows Xp; Vista always asks for permissions for the applet, and altough I guarantee these permissions, printer is not allowed to create the output file and reports an error writing
    after a little research, I have found that java applets have all permissions when certificated as trusted applications; all but file creating permissions
    anyone has any idea of how could I fix this problem?
    Thanks in advance

    HI,
    Have you actually signed your applet? If the signers certificate is the trusted key store for Java it should treat your applet as trusted. You can use a self signed certificate for testing as long as the cert is in the trusted key store.
    Some links that might help:
    [http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/keytool.html]
    [http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/rsa_signing.html]
    Cheers,
    Shane

  • How to access a file via Applet and JavaScript

    I want to copy one file on the client machine from one place to another place from a Java Bean.
    To do this I created an applet and a Java Bean as follows:
    import java.applet.*;
    public class FileUtils extends Applet {
        public void copyFile(String src, String dest)  {
        private String source, destination; // setters/getters are there of course
        public void copyFile(ActionEvent actionEvent) { // Bean
            FacesContext fctx = FacesContext.getCurrentInstance();
            ExtendedRenderKitService erks = Service.getRenderKitService(fctx, ExtendedRenderKitService.class);
            String command = "var s = '"+ source +"'; var d ='" + destination +"'; " +  " document.fileUtilsApplet.copyFile(s, d); ";
            erks.addScript(fctx, command);
        }Then I added the APPLET tag referencing the above class in the page fragment:
                    <f:verbatim>
                        <applet code="FileUtils.class" name="fileUtilsApplet" height="30"
                                archive="/context-root/Applet.jar"
                                width="200">
                        </applet>
                    </f:verbatim>From the Java console I can see the jar is successfully downloaded, but when the code in the bean is executed, the JavaScript code does not seem to do anything, as if the "copyFile" public method was not called at all and no output in the Java Console as well.
    Note that I already followed the guidelines at http://www.oracle.com/technetwork/developer-tools/adf/learnmore/71-adf-to-applet-communication-307672.pdf .
    Do you have any ideas?

    Ok, I can see the permission problem now:
    java.security.AccessControlException: access denied (java.io.FilePermission c:\myfile.txt read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkRead(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
    Edited by: user10047839 on 1-feb-2013 7.29
    signing the Jar and downloading the certificate permanently does not change anything in Firefox. The Java console keeps giving the above exception.
    Any idea?

  • About applets and secure connection

    Hello. I've read some threads but I can't understand a thing about applets and SSL.
    I've a signed applet. This applets is embedded with applet tag in a jsp page.
    The applet works as a file uploader.
    With signing, the applet can access to the user file system without problem, open a connection with the server and upload files.
    Now, If I want to use HttpsUrlConnection instead of the standard http connection, what certificate does the applet use for handshake? Does the applet automatically use the same certificate used for signing?
    Thank you

    Hello. I've read some threads but I can't understand a thing about applets and SSL.
    I've a signed applet. This applets is embedded with applet tag in a jsp page.
    The applet works as a file uploader.
    With signing, the applet can access to the user file system without problem, open a connection with the server and upload files.
    Now, If I want to use HttpsUrlConnection instead of the standard http connection, what certificate does the applet use for handshake? Does the applet automatically use the same certificate used for signing?
    Thank you

  • JRE 1.4.x Plugin - Signed Applets and Weird Behaviour (Policy)

    Hello.
    I have recently experienced some strange behaviour related to signed applets and policy files in JRE 1.4.2-b28 ( a friend got the same behaviour in a flavour of 1.4.1-xx as well ). Both tests were on Windows 2000 Professional platforms.
    Initially my unsigned applet, which attempts socket connections to a server different from the download location, fails with security exceptions ( as expected ). Then I did the following to sign the applet jar and configure my environment
    Steps: 1) Import "trusted CA" certificate into ${java.home}/lib/security/cacerts. (JRE home outside the JDK)
    2) Signed the jar using jarsigner and a certificate generated from the "trusted CA" (Entrust CA and certificate).
    3) Imported the signing certificate into the Java plugin using import in the plugin control panel.
    4) Created a new keystore (keytool,jks) and imported the signing certificate into the keystore with alias "developer". The keystore is stored in the user home as .keystore.
    5) Created a .java.policy for the user and attaching the keystore in 4) to it. ( also stored in user home ).
    6) Used the policy tool to grant socketpermissions to the specific codebase ( testing with file:/C:/test/* initially ) signed by "developer"
    After this, when I ran the test page under IE 5.5SP2 and Netscape 7.1 it worked without any security exception. Ditto for using the appletviewer and the policy file I created for the user.
    The weird part occurred when I removed the policy entry from the user policy file. After doing this, Netscape and IE still allow the applet to execute - somehow remembering that it was granted permissions at some point. The appletviewer does not allow it to execute, generating security exceptions.
    It appears the old policy is being cached somewhere, but I cannot find where. If I replace the applet jar with an unsigned version it does fail in IE and Netscape. I tried cleaning the plugin cache and removing the "deployment.certs" files related to the users but still get the same behaviour.
    Does anyone know where the old policy information is being stored ? Does anyone know how to revoke the permissions so that I am restored to my original base environment ( no permissions for "designer" signed applets ) ? Would attempting to utilize the AccessController.doPriveleged( xxxx ) operations in JDK 1.4 avoid all of this confusion with policy files, keystores and certificate storage ? After all the messing about I would like a zero-footprint alternative ( or minimzed footprint anyway ).
    Any ideas would be most welcome.
    Regards,
    James.

    Hello Again.
    I am either enlightened or confused at this point. I found that as long as all of my related Jars are signed ( even by self-signed certificates ) I am granted SocketPermissions for calls outside of the originating server. Unsigned code is refused, but even when the Jars were signed using a self-signed certificate the Socket calls were allowed.
    Am I experiencing the appropriate behaviour in this case ( which would mean not having to utilize policy files to distribute an applet that uses calls to arbitrary servers - e.g. JavaMail ) or am I suffering from something damaged in my environment ?
    It has been a long time since I played with signed applets and I am having difficulty determining what operations require policy file entries/AccessController.doPrivileged() calls and which are granted when a user elects to trust a signed applet without policy.
    Any assistance in clearing up my confusion would be appreciated.
    Regards,
    James.

  • Signed Applets and Permissions

    Hi All,
    After deploying a selfsigned jar for the applet , and accepting the certificate it gives the following error:
    java.lang.Exception: java.security.AccessControlException: access denied (java.awt.AWTPermission setWindowAlwaysOnTop). All this happens when I call javascript which calls the java method.
    Basically the applet is denied the AWTPermission. What could be the problem?
    Edited by: nitin-36 on Jan 12, 2009 12:16 AM
    Edited by: nitin-36 on Jan 12, 2009 7:33 AM

    All the code on the call stack leading to the sensitive call must be trusted.
    This is not the case when the call originates from javascript, which is not coming from inside your trusted jar.
    AccessController.doPrivileged() was designed specifically to solve your problem.

  • Signed Applet and native code

    Hi all,
    I have an application which I deploy with webstart and includes native code. This all works perfectly with webstart. I now want to deploy it as an applet. This works accept for the native code. I have done heaps of searching and cannot determine the most appropriate way to make the native code visible to the applet.
    Ultimately I am at the point where i recieve a UnsatisfiedLinkError when calling loadLibrary(...) for the native code. Currently i have the native code (dll's for windows, so's for Solaris etc) in independent jars which are also signed (as needed for webstart).
    Could anyone give me some advise or a reference to more info on this topic.
    I am using Java 1.5 and am happy to use 1.6 if neccessary.
    Thanks,
    Dave

    Andrew - of course you were correct about the signed cert - I misspoke when the CA signed applet didn't show a warning. (You were also right that I must have checked 'always accept' the certificate on the server I had the CA signed cert on).
    I think you guys are on to something about the privileged actions. It would explain where one popup has the icon and the other doesn't. We have Javascript making calls into the applet and we do use JNI (although I don't think there are any calls back). We do wrap these calls in privileged actions but maybe we missed something. What I've seen before is a security exception is thrown if we don't wrap them - but maybe there are areas where we don't and it doesn't throw an exception or it does and we eat it somehow (and for whatever reason doesn't cause anything noticeable).
    Now that I know it could likely be the applet code and not necessarily a build issue with signing the jars, I have another place to look...
    I'll check it out and let you know what I find.

  • Difference Between Applet and Swing

    Difference Between Applet and Swing

    The advantages and disadvantages of both applets and Swing are the small fluffy elephants you get inside of every box. They're quite well trained and can skeletonize your neighbors' annoying pets upon command.

  • IIS, Javascript, Signed Applet and ASP Blank Page Problem

    Hi,
    I'm having a problem using a Signed Applet in a site that runs in a IIS (Windows Server 2003).
    My aspx web page uses the applet to read my smart card and get information from it.
    This applet uses an auxiliar dll (stored in a second Signed Jar file) in order to read the information from my smart card.
    The way the solution is design:
    1) Aspx page is asked from server
    2) Internet Explorer recieve the page and asks the server for it content (images, applet, javascripts, etc)
    3) After this the JVM runs (console opens)
    4) After the Aspx page render fully a javascript register onload fires and call an applet method
    5) Applet receive the call and run the logic of the method:
         - reads the smart card;
         - calls Javascript function in order to fill aspx fields with information from smart card
         - calls Javascript function the simulates a click in a botton of aspx page (in order to call server side part sending data readed from smart card to server)
    5) The server makes some logic with the information receive and responds to client registering in aspx page a call to another Javascrit function
    6) The client received the asnwer from server and runs the Javascript function registered on step 5)
         This Javascript calls another method from applet and runs the following logic:
         - reads more information from smart card;
         - call javascript function in order to fill more fields of aspx page with the information readed
         - calls Javascript function the simulates a click in a botton of aspx page (in order to call server side part sending data readed from smart card to server)
    7) The server makes some logic and call another pages with no Applets
    8) Client asks for a second page with the same applet and we start with another logic express on steps 1);2);3),4);5) and then 7).
    This is all ok, until sometimes the server stop responding correcly for requests regarding this two pages with the Applet.
    When this happens the server just responds with a blank page.
         - with fiddler I can seer the request for the aspx page (that uses the applet)
         - but server responds with a blank html page
    The JVM doesn't fire.
    The IIS log don't show errors.
    The eventviewer doesn't show errors.
    The problem is solved with an IIS reset or a Application Pool reset.
    After a while the problem returns.
    This problem occours for other user in another machine, the server just stops responding correcly to request regarding pages with applets, the other pages still continue to work.
    If we disable Java Control Panel->Advanced->Java Plug-in->Enable the next-generation Java Plug-in the problem seend to stop, but we can't force all clients to disable this option right?
    Or there is a way to force the Applet to run with this option disabled?
    As anyone experience similar problem?
    Regards,
    OF

    This is all ok, until sometimes the server stop responding correcly for requests regarding this two pages with the Applet.
    When this happens the server just responds with a blank page.
    - with fiddler I can seer the request for the aspx page (that uses the applet)
    - but server responds with a blank html pageWell, if http requests look identical in case of success and failure (pay attention to cookies, etc) then it has to be something on the server side.
    It could be that server gets into this wrong state because of previous requests made by applet but it is hard to tell.
    I am not clear how old/new plugin can make a difference unless your applets run in the legacy mode (i.e. you are actually trying to reuse SAME instance of the applet when
    it is loaded next time).
    I'd start with
    1) carefully comparing good/bad sessions
    2) checking whether server will serve correct response to another client when it serves "bad" page for current client
    3) add debug statements to aspx - it is scripted page, may be some condition is not met and then it returns blank?
    4) record all http requests in one session until you get to "error" state and then use any http server testing tool to "replay" this set of requests.
    You should be able to get server into the same state without use of applet. Then you can try to tweak set of requests to see what makes a difference.

  • I need help with Applets and Multithreading

    [hello all.  first time poster. big fan of java.]
    now to the important matter: Applets and Threads
    =======================================
    1) I have an applet with that implements the runnable interface, and has one thread (and a simple animation). If I try to view this applet in the applet viewer with JGrasp, it spits an insane error telling me
    "java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)"
    but, if I run the applet through a web browser, by putting it in an html document, it runs correctly, without error
    What on earth is wrong, and how do I fix it?!?
    2) I want to put 2 threads in my applet?
    If I implement the Runnable interface, I can only have one Run() method in my applet, right?
    So how do I define behaviour for 2 threads when I only have one run method in which to define the behaviour? Can I use two threads with the runnable interface, or do I have to make objects of my own defined thread classes?
    3) I tried to make 2 threads in my applet by creating my own thread classes, and instantiating them in my applet (instead of implementing the runnable interface).
    I still get the same insane error as I mentioned in my first point (which I expected), except now, the applet won't work even when viewed through a web browser!!
    Please please help me. I am frustrated beyond belief (at what is probably a very simple problem)
    I have searched and searched all over and found no answers on this

    If I try to view this applet in the applet viewer with JGrasp, it spits an insane error telling me
    "java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)"Don't know anything about JGrasp, but it runs with pretty tight security - thats what this insane error is all about. Use the appletviewer or a browser.
    If I implement the Runnable interface, I can only have one Run() method in my applet, right?Correct
    So how do I define behaviour for 2 threads when I only have one run method in which to define the behaviour?
    Can I use two threads with the runnable interface, or do I have to make objects of my own defined thread classes?You can create two Runnable implementations (classes) in your applet.
    example (missing code)
    class MyApplet extends Applet {
      void doSomething() {
      void doSomethingElse() {
      void startThreads() {
        Thread t = new Thread(new Runnable() { public void run() { doSomething();}});
        t.start();
        t = new Thread(new Runnable2());
        t.start();
      class Runnable2 implements Runnable {
         public void run() {
           doSomethingElse();
    }If the above seems confusing, read up on anonymous and inner classes.
    3) I tried to make 2 threads in my applet by creating my own thread classesTry not subclassing thread - this causes a security check

  • Socket communication failure between Java applet and C++ application

    I have a java applet that connects to a C++ application via Java's ServerSocket and Socket objects. THe C++ application is using the Winsock 2 API. The applet and application are running on an NT workstation (SP 6) and using IE (5.5) For a very simple C++ test applications the communictions work fine. Once more code gets added to the C++ application the portion of the socket that C++ listens to seems to close. Upon performing a recv call the return value is a zero. Microsoft insists this is a sign the Java side has shut down the socket. The Java applet can still receive messages from the C++ app but C++ cannot receive responses from the Java side. Java throws no exceptions and an explicit check of the socket shows no errors. Again, what puzzles me is that it works for simple C++ applications. Are there any known conflicts between Java and C++ in this regard?
    I have inlcuded the basic java code segments below.
    / run Method.
      * This method is called by the Thread.start() method. This
      * method is required for the implementation of the Runnable interface
      * This method sets up the server side socket communication and
      * contiuously loops looking for requests from a external
      * socket.
      * @author Chris Duke
      public void run(){
         // create socket connections
         boolean success = false;
         try {
             cServerSocket = new ServerSocket(cPortID);
             System.out.println("Waiting for client to connect...");
             cClientSocket = cServerSocket.accept();
             System.out.println("Client connected");
             // Create a stream to read from the client
             cInStream = new BufferedReader(new InputStreamReader(
               cClientSocket.getInputStream()));
             // Create a stream to write to the client       
             cOutStream = new PrintWriter(
               cClientSocket.getOutputStream(), true);
             success = true;
         }catch (IOException e) {
             System.out.println("CommSocket:Run - Socket Exception(1) " + e);
             success = false;
         // if the socket was successfully created, keep the thread running
         while (success){
             try{
                // check socket to see if it is still available for reading
                if (cInStream != null && cInStream.ready()){
                    // check for an incoming message
                    String message = ReceiveMessage();
                    // Send message to listeners
                    Event(message);
                if (cInStream == null){
                    success = false;
                    System.out.println("CommSocket:Run - shutdown");
             }catch (IOException e){
                System.out.println("CommSocket:Run - Socket not ready exception");
                break;
    // SendMessage method -
      *  Sends a text message to a connected listener through port specified by portID
      * @author Chris Duke
      * @param  String message - This will be the message sent out through the server
      * socket's port specified by portID.
       public void SendMessage(String message){
          cOutStream.println(message);
          if (cOutStream.checkError() == true)
            System.out.println("SendMessage : Flush = Error");
          else{
            System.out.println("SendMessage : Flush - No Error");
       }

    a very simple C++ test applications the communictions work fine. Once more code gets added to the C++ application the portion of the socket that C++ listens to seems to close.
    This quite strongly implicates the extra code in the C++ App. The firstly thing I would try would be telnet. Try connecting to both versions of the C++ Application and manually reproducing a proper exchange.
    a recv call the return value is a zero. Microsoft insists this is a sign the Java side has shut down the socket.
    A correct implementation of recv should return the number of bytes received, or -1 for an error. A zero return indicates no bytes received not a socket closed/error. This sounds like FUD to me.
    Are there any known conflicts between Java and C++ in this regard?
    I can see no obvious faults, though the code is incomplete, I don't think it's an sockets implementation issue, at either end, it sounds more likely to be a protocol/handshaking bug in the C++ App.

  • Server 2012 R2 - Essentials Experience - - I jacked my CA and certificates all to @#&$%!!

    Windows Server 2012 R2 - Essentials Experience
    In trying to put pieces together, I jacked my CA and certificates all to @#&$%!!
    Some of the factors involved are:
     Server0 - Hyper-V Host
      Server1 - DC, 2012 R2 Essentials Experience role
      Server2 - Exchange 2013
     Client Machines -
      Windows 7 Pro
      XP (Yes, these are my cross to bear... - worth noting their presence, but I'm working them out) 
     The functional requirements:
      Anywhere Access for Remote users
       - Remote Desktop for Windows 7 machines
      Outlook Web Access
    The mistake... 'Web Application Proxy'
     -which uninstalled the CA
    There is a CA back now, but after days of spinning in cirles in a rare area where I feel nearly completely lost (Certificate services) I am asking for help getting these pieces put back together.
    The current situation:
     The network is up with all of the network and business services required to work 'Inside the Office' - so the client is "functional".
     The "Essentials Experience" is broken and won't install to the clients, though it does provide the Essentials website, access to server shared files (fairly gracefully, I might add) and, as an administrator user, I can get to the servers via
    RWA through the site and there are no certificate problems with that since I have a secured certificate for the domain. 
     OWA has been moved to a further back burner while I try to get the Essentials Experience functioning t the point where the remote users can get to their workstations through RWA... This is the biggest current hurdle... RWA for the clients.
    Trying to install the client to the workstations nets me the "The Server is not available.  Try connecting this computer again,..." message at the point of username and password authentication.
    The clientdeploy.log finishes like this:
     [4976] 141016.153746.2670: ClientSetup: Standard Error:
     [4784] 141016.153746.2670: ClientSetup: The exit code of the process (C:\Windows\system32\nslookup.exe) is: 0
     [4784] 141016.153746.2670: ClientSetup: Set CD Fail reason 10 for SQM in ClientDeployment.exe
     [4784] 141016.153746.2670: ClientSetup: RecordClientDeploymentFailReason: Save registry failed in ClientDeployment.exe : System.UnauthorizedAccessException: Cannot write to the registry key.
      at Microsoft.Win32.RegistryKey.EnsureWriteable()
      at Microsoft.Win32.RegistryKey.CreateSubKeyInternal(String subkey, RegistryKeyPermissionCheck permissionCheck, Object registrySecurityObj, RegistryOptions registryOptions)
      at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck)
      at Microsoft.WindowsServerSolutions.ClientSetup.ClientDeploy.Helper.RecordClientDeploymentFailReason(UInt32 failReason)
     [4784] 141016.153746.2670: ClientSetup: Exiting ValidateUserTask.Run
     [4784] 141016.153746.2670: ClientSetup: Task with Id=ClientDeploy.ValidateUser has TaskStatus=Failed
     [4784] 141016.153746.2670: ClientSetup: Task with Id=ClientDeploy.ValidateUser has RebootStatus=NoReboot
     [4784] 141016.153746.2670: ClientSetup: Exting ConnectorWizardForm.RunTasks
     [1272] 141016.153755.0976: ClientSetup: Back from the Client Deployment Wizard
     [1272] 141016.153755.0976: ServerDiscovery:HostsFileUpdater: Removing hosts file entry: 1-WGB-01
     [1272] 141016.153755.0976: ClientSetup: Saving Wizard Data
     [1272] 141016.153755.0976: ClientSetup: End of ClientDeploy: ErrorCode=1603
    The computerconnector.log shows nothing of value.
    What I want to accomplish as a 'first step' toward recovery is to get the workstations properly connected so they show up in the Dashboard 'Devices' pane and can be managed and access by the Essentials tools.
    Secondarily, I would like to get the client side tools in place and functioning (I expect the latter will be a side effect of the former).
    So,... for anyone patient enough to have read this far... uh,... help?

    Actually,... I can now confirm the delicacy of which you speak...
    After a support incident with Microsoft which spanned a marathon 18+ hours on the phone and remote access by no fewer than 7 Microsoft Engineers, we got to a successful result. 
    It is a point of utter frustration for me when people put in threads like this then don't bother to come back and report 'how the issue was solved', and sadly, I am about to have done that merely because my span of functional attention and valuable reporting
    capability was basically gone before I submitted the ticket and following all that was done in my state was not conceivably possible. 
    So - all I can do is apologize for not being able to report a valuable resolution and give a few little tidbits.
    The net result is this - DO WHAT YOU CAN TO AVOID THE SITUATION IN THE FIRST PLACE.  Once your CA is in place, LEAVE IT THE $%@& ALONE!!!!  I mean... my best current advice.
    In all, the CA was uninstalled and reinstalled 4 times after my blunder and significant work was done in ADSIEdit as well as substantial manual manipulation of certificates and CAs that was well outside of my (quite considerable) scope of expertise.
    I wish I had more to offer in the world of resolution.
    With this said, I will make one more request of viewers and moderators alike:
    THIS QUESTION IS OFFICIALLY NOT ANSWERED.  IT WILL NEVER BE ANSWERED.  THE RESOLUTION IS NOT AVAILABLE TO THE MORTAL MAN.
    DO NOT MARK IT AS ANSWERED
    IF YOU MUST DO SOMETHING, DELETE THE WHOLE THREAD, BUT DO NOT BURDON PEOPLE WHO ARE LOOKING FOR REAL ANSWERS WITH THE NECESSITY OF READING THROUGH THIS.
    DO NOT MARK THIS QUESTION AS ANSWERED
    I hope this makes sense for people, and I hope people will appreciate NOT having to read this as though there is some 'resolution' contained within.

  • I'm crazy!Applet and JNA Error:Library 'jnidispatch' was not found!

    Hi all,
    sorry to bother you, I really have no idea how to do JNA and Applet. I'm hardly mazy, man.
    Every time it will throw an error to me :
    Exception in thread "thread applet-JNAApplet-1" java.lang.UnsatisfiedLinkError: Library 'jnidispatch' was not found by class loader sun.plugin2.applet.JNLP2ClassLoader@291aff
         at com.sun.jna.Native.getWebStartLibraryPath(Native.java:858)
         at com.sun.jna.NativeLibrary.<clinit>(NativeLibrary.java:576)
         at com.sun.jna.Library$Handler.<init>(Library.java:140)
         at com.sun.jna.Native.loadLibrary(Native.java:372)
         at com.sun.jna.Native.loadLibrary(Native.java:357)
         at JNAApplet.init(JNAApplet.java:15)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)My program is so easy, I just want use Applet to revoke JNA and use the JNA to load a native lib.
    here is the structure of my program:
    Applet code :
    import javax.swing.JApplet;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    import com.sun.jna.Native;
    public class JNAApplet extends JApplet {
         public static Kernel32 kernel32 = null;
         @Override
         public void init() {
              createGUI();
              kernel32 = (Kernel32)Native.loadLibrary("Kernel32", Kernel32.class);
              if (kernel32 == null) {
                   System.out.println("load kernel32 fail!");
              } else {
                   System.out.println("load kernel32 success!");
         private void createGUI() {
              JPanel panelCenter = new JPanel();
              JButton butTest = new JButton("Test");
              panelCenter.add(butTest);
              setContentPane(panelCenter);
    }When I run it on debug mode, it is ok! but when I deploy it , it will throw above error message to me.
    My Applet html:
    <html>
         <head>
              <title>JNA Applet</title>
         </head>
         <body>
         <script src="deployJava.js"></script>
        <script>
            var attributes = { code:'JNAApplet',  width:300, height:300} ;
            var parameters = {jnlp_href: 'JNAApplet.jnlp'} ;
            deployJava.runApplet(attributes, parameters, '1.5');
        </script>
         </body>
    </html>File 'JNAApplet.jnlp':
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="" href="">
        <information>
            <title>JNA Applet</title>
            <vendor>Steven</vendor>
        </information>
        <resources>
            <j2se version="1.5+"
                  href="http://java.sun.com/products/autodl/j2se" />
            <jar href="JNAApplet.jar" main="true" />
        </resources>
        <applet-desc
             name="JNA Applet"
             main-class="JNAApplet"
             width="300"
             height="300">
         </applet-desc>
         <update check="background"/>
    </jnlp>     I really have no idea. and I can't search any usefull infomation from Google and officer site.
    Can any one help me? Thank you very much!!!!

    Hi AndrewThompson64:
    Did you mean the JNA project? Or are you refering to JNI, or ..something else?Yes, I mean is that I wanna jna.jar to replace JNI to code with Applet. I want Applet can run native library(.dll files).
    That reads like so much nonsense to me.Sorry fo that.
    Was there any 'caused by' part that you trimmed? I expected to see something to do with 'Security' or 'AccessControl'.Sorry, I can't saw any 'cause by' subsentence there. This message is just gain from Applet Console.(Is there any method to gain more message?)
    About 'Security' and 'AccessControl' I just modify my java.policy file to allpermission. Subsequently, I signed all jar files.
    For now I have 3 jar files(all have been signed ):
    --example.jar :  for this little program.(code include applet and application entry)
    --jna.jar
    --win32-x86.jar : include kernel32.dll and jnidispatch.dll for win32 and x86.
    and 2 JNLP files:
    --JNAApplet.jnlp the entry is JNAApplet.class (this jnlp does not work)
    --JNAApp.jnlp     the entry is JNAApp.class  (this jnlp works)
    And for now new error message show like this:
    Exception in thread "thread applet-JNAApplet-1" java.lang.UnsatisfiedLinkError: Library 'Kernel32' was not found by class loader sun.plugin2.applet.JNLP2ClassLoader@4aeb52
         at com.sun.jna.Native.getWebStartLibraryPath(Native.java:858)
         at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:97)
         at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:228)
         at com.sun.jna.Library$Handler.<init>(Library.java:140)
         at com.sun.jna.Native.loadLibrary(Native.java:372)
         at com.sun.jna.Native.loadLibrary(Native.java:357)
         at JNAApplet.init(JNAApplet.java:12)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Did you mean invoke?
    Revoke: To annul by withdrawing.
    Invoke: To call on.Yes, you got it. Thank you.
    The JNLP file is invalid. ..I was about to put my 'standard' text here, but I'm sick of saying it. Search the forum for my posts - 50% of them, at least, mention validation and how to go about it.
    Also, the applet-desc requires a documentbase.Thank you, I really think I have some invalid section. But I can't find it, and you said 'Search the forum for my posts - 50% of them...' , I can read the JNLP structure on site of sun and I can to read you post too(I'm doing like this).*I only want to know about how to load "native lib like *.dll" properly*.
    What 'officer site'?I mean jna project site. Sorry for ambiguity.
    Please fix that sticky '!' key. One '!' indicates astonishment, while two or more typically indicates a bozo. Thanks for your advice. Because I tried to find solution do my best lasting two days. I got nothing. I'm sadness.
    here post my new files:
    import javax.swing.JFrame;
    import com.sun.jna.Native;
    public class JNAApp {
         public static Kernel32 kernel32 = null;
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              kernel32 = (Kernel32)Native.loadLibrary("Kernel32", Kernel32.class);
              JFrame frame = new JFrame();
              frame.setSize(500, 500);
              frame.setVisible(true);
    import javax.swing.JApplet;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    import com.sun.jna.Native;
    public class JNAApplet extends JApplet {
         public static Kernel32 kernel32 = null;
         public void init() {
              createGUI();
                   kernel32 = (Kernel32)Native.loadLibrary("Kernel32", Kernel32.class);
         private void createGUI() {
              JPanel panelCenter = new JPanel();
              JButton butTest = new JButton("Test");
              panelCenter.add(butTest);
              setContentPane(panelCenter);
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="" href="">
        <information>
            <title>JNA Applet</title>
            <vendor>Steven</vendor>
        </information>
        <resources>
            <j2se version="1.5+"
                  href="http://java.sun.com/products/autodl/j2se" />
             <jar href="JNAApplet.jar" main="true"/>
             <jar href="jna.jar"/>
        </resources>
           <resources os="Windows" arch="x86">
             <nativelib href="win32-x86.jar"/>
             <nativelib href="kernel32.jar"/>
           </resources>
        <applet-desc
             documentBase=""
                name = "success"
             main-class="JNAApplet" width = "200" height = "200">
         </applet-desc>
         <update check="background"/>
           <security>
             <all-permissions/>
           </security>
    </jnlp>     
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="" href="">
        <information>
            <title>JNA Applet</title>
            <vendor>Steven</vendor>
        </information>
        <resources>
            <j2se version="1.5+"
                  href="http://java.sun.com/products/autodl/j2se" />
             <jar href="JNAApplet.jar" main="true"/>
             <jar href="jna.jar"/>
        </resources>
           <resources os="Windows" arch="x86">
             <nativelib href="win32-x86.jar"/>
             <nativelib href="kernel32.jar"/>
           </resources>
        <application-desc
             main-class="JNAApp">
         </application-desc>
         <update check="background"/>
           <security>
             <all-permissions/>
           </security>
    </jnlp>     Thanks & Best Regards,
    Su Heng

Maybe you are looking for