Solved

Java Applet works in IE but not Netscape 7.x....

Posted on 2003-12-10
36
961 Views
Last Modified: 2013-12-22
I have a digitally signed applet that needs to brigde the cross domain communications issues inherint with the Java Security "Sandbox".

The applet works as expected in I.E. 6.x but when attempting to load in Netscape, I get an error consistant with what I would expect if the applet was NOT signed.

Here is the error:
Error: java.security.AccessControlException: access denied (java.net.SocketPermission machine.name.com resolve)


Here is the html code I am using to embed the applet:

<applet
code="wrapper.class"
archive="wrapper.jar"
name=wrapper
width=0
height=0>
</applet>

When I access the page, it gives me the alert box that you would expect to see when accessing a signed applet (in both browsers) but it just doesnt work in Netscape.

Any tips/tricks?

Thanks,
Chris Meyer
0
Comment
Question by:MeyerCa
  • 17
  • 14
  • 2
  • +1
36 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 9913428
I don't think there's an easy answer beyond checking your NS signing step-bystep
0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9913477
What do you mean by "NS signing"

Do you mean, some setting in netscape? or the actuall signing of the applet?
0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9913656

<b>Here are the contents of the Java Console with the trace level set to 5 (basic, net, security, ext, liveconnect ...) from IE 6.x</b>

Invoking method: public void wrapper.cmiSetURL(java.lang.String)
Needs conversion: java.lang.String --> java.lang.String
Invoking method: public void wrapper.cmiSetSessionID(java.lang.String)
Needs conversion: java.lang.String --> java.lang.String
Invoking method: public java.lang.String wrapper.cmiPost(java.lang.String,java.lang.String)
Needs conversion: java.lang.String --> java.lang.String
Needs conversion: java.lang.String --> java.lang.String
Connecting http://ipd.company.corp/cgi-bin/docentcgi.exe/lms,IPD,2151/SQN%3D20814431,CMD=GET,file=aicc_catcher.jsm,SVR=ipd.company.ad%3A2680,SID=ipd.company.ad%3A2680-0001-2-990888F5-00000CCC/ with no proxy
Connecting http://ipd.company.corp/cgi-bin/docentcgi.exe/lms,IPD,2151/SQN%3D20814431,CMD=GET,file=aicc_catcher.jsm,SVR=ipd.company.ad%3A2680,SID=ipd.company.ad%3A2680-0001-2-990888F5-00000CCC/ with cookie "SID=ipd.company.ad:2680-0001-2-990888F5-00000CCC; SVR=ipd.company.ad:2680"


<b>Here is the results of the same test in Netscape 7.1</b>
JavaScript: caller and callee have same origin
JavaScript: default security policy = http://test.srv.company.corp
JavaScript: caller and callee have same origin
JavaScript: default security policy = http://test.srv.company.corp
JavaScript: caller and callee have same origin
JavaScript: default security policy = http://test.srv.company.corp
Error:  java.security.AccessControlException: access denied (java.net.SocketPermission ipd.company.corp resolve)
JavaScript: calling Java system code
JavaScript: default security policy = http://test.srv.company.corp
JavaScript: calling Java system code
JavaScript: default security policy = http://test.srv.company.corp
JavaScript: calling Java system code
JavaScript: default security policy = http://test.srv.company.corp


I dont get it!

Any clues?

Chris
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9913682
Can't help in detail i'm afraid. This page could have some useful links:

http://mindprod.com/jgloss/signedapplets.html
0
 
LVL 92

Expert Comment

by:objects
ID: 9915238
> What do you mean by "NS signing"

you didn't answer the question?
0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9915344
Hey objects...

I see you pretty much the "man" (or woman as the case may be) on this board.   Do you have any insight on this one?

Ill be happy to post the code of the applet if necessary.

Thanks,
Chris
0
 
LVL 92

Expert Comment

by:objects
ID: 9915608
not sure what CEHJ was referring to with "NS signing".

post a stack trace for the error I'll see what I can find.

0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9915648
This what you are looking for?


Full thread dump Java HotSpot(TM) Client VM (1.4.1_05-b01 mixed mode):

"TimerQueue" daemon prio=5 tid=0x02128110 nid=0xb30 in Object.wait() [13c3f000..13c3fd8c]
      at java.lang.Object.wait(Native Method)
      - waiting on <04FA0F60> (a javax.swing.TimerQueue)
      at javax.swing.TimerQueue.run(Unknown Source)
      - locked <04FA0F60> (a javax.swing.TimerQueue)
      at java.lang.Thread.run(Unknown Source)

"AWT-EventQueue-1" prio=7 tid=0x02474AB8 nid=0x59c waiting on condition [13b3f000..13b3fd8c]
      at sun.plugin.JavaRunTime.dumpAllStacks(Native Method)
      at sun.plugin.ConsoleWindow$1.actionPerformed(Unknown Source)
      at javax.swing.JComponent$ActionStandin.actionPerformed(Unknown Source)
      at javax.swing.SwingUtilities.notifyAction(Unknown Source)
      at javax.swing.JComponent.processKeyBinding(Unknown Source)
      at javax.swing.KeyboardManager.fireBinding(Unknown Source)
      at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
      at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source)
      at javax.swing.JComponent.processKeyBindings(Unknown Source)
      at javax.swing.JComponent.processKeyEvent(Unknown Source)
      at java.awt.Component.processEvent(Unknown Source)
      at java.awt.Container.processEvent(Unknown Source)
      at java.awt.Component.dispatchEventImpl(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
      at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
      at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
      at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
      at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
      at java.awt.Component.dispatchEventImpl(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Window.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.EventQueue.dispatchEvent(Unknown Source)
      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.run(Unknown Source)

"AWT-EventQueue-2" prio=4 tid=0x02577AE0 nid=0x92c in Object.wait() [13a3f000..13a3fd8c]
      at java.lang.Object.wait(Native Method)
      at java.lang.Object.wait(Unknown Source)
      at java.awt.EventQueue.getNextEvent(Unknown Source)
      - locked <04F39300> (a java.awt.EventQueue)
      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.run(Unknown Source)

"thread applet-aicc_wrapper.class" prio=4 tid=0x02474DA0 nid=0xec8 in Object.wait() [1383f000..1383fd8c]
      at java.lang.Object.wait(Native Method)
      - waiting on <04F3FF30> (a sun.plugin.AppletViewer)
      at java.lang.Object.wait(Unknown Source)
      at sun.applet.AppletPanel.getNextEvent(Unknown Source)
      - locked <04F3FF30> (a sun.plugin.AppletViewer)
      at sun.applet.AppletPanel.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

"AWT-EventQueue-0" prio=7 tid=0x02576520 nid=0x5f8 in Object.wait() [1353f000..1353fd8c]
      at java.lang.Object.wait(Native Method)
      at java.lang.Object.wait(Unknown Source)
      at java.awt.EventQueue.getNextEvent(Unknown Source)
      - locked <04EED188> (a java.awt.EventQueue)
      at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.run(Unknown Source)

"Java2D Disposer" daemon prio=10 tid=0x024AA7C8 nid=0x9b0 in Object.wait() [1343f000..1343fd8c]
      at java.lang.Object.wait(Native Method)
      at java.lang.ref.ReferenceQueue.remove(Unknown Source)
      - locked <04F401B8> (a java.lang.ref.ReferenceQueue$Lock)
      at java.lang.ref.ReferenceQueue.remove(Unknown Source)
      at sun.java2d.Disposer.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

"Cache Cleanup Thread" prio=4 tid=0x022917F8 nid=0x908 in Object.wait() [1333f000..1333fd8c]
      at java.lang.Object.wait(Native Method)
      - waiting on <04F24648> (a sun.plugin.cache.CleanupThread)
      at sun.plugin.cache.CleanupThread.run(Unknown Source)
      - locked <04F24648> (a sun.plugin.cache.CleanupThread)

"Main Console Writer" prio=7 tid=0x02288FD8 nid=0x8d8 in Object.wait() [1323f000..1323fd8c]
      at java.lang.Object.wait(Native Method)
      at java.lang.Object.wait(Unknown Source)
      at sun.plugin.MainConsoleWriter.run(Unknown Source)
      - locked <04F04300> (a java.util.LinkedList)
      at java.lang.Thread.run(Unknown Source)

"AWT-Windows" daemon prio=7 tid=0x022869C0 nid=0x18c runnable [1313f000..1313fd8c]
      at sun.awt.windows.WToolkit.eventLoop(Native Method)
      at sun.awt.windows.WToolkit.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

"AWT-Shutdown" prio=5 tid=0x022866A8 nid=0x770 in Object.wait() [1303f000..1303fd8c]
      at java.lang.Object.wait(Native Method)
      - waiting on <04F043C8> (a java.lang.Object)
      at java.lang.Object.wait(Unknown Source)
      at sun.awt.AWTAutoShutdown.run(Unknown Source)
      - locked <04F043C8> (a java.lang.Object)
      at java.lang.Thread.run(Unknown Source)

"Signal Dispatcher" daemon prio=10 tid=0x021B6458 nid=0xd80 runnable [0..0]

"Finalizer" daemon prio=9 tid=0x0212FFF0 nid=0xe3c in Object.wait() [ea5f000..ea5fd8c]
      at java.lang.Object.wait(Native Method)
      at java.lang.ref.ReferenceQueue.remove(Unknown Source)
      - locked <04EE3AA8> (a java.lang.ref.ReferenceQueue$Lock)
      at java.lang.ref.ReferenceQueue.remove(Unknown Source)
      at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

"Reference Handler" daemon prio=10 tid=0x0212ECD0 nid=0xc24 in Object.wait() [e95f000..e95fd8c]
      at java.lang.Object.wait(Native Method)
      at java.lang.Object.wait(Unknown Source)
      at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
      - locked <04EE3B10> (a java.lang.ref.Reference$Lock)

"main" prio=5 tid=0x02127408 nid=0x248 runnable [0..12ea38]

"VM Thread" prio=5 tid=0x019BD3D0 nid=0xda8 runnable

"VM Periodic Task Thread" prio=10 tid=0x0205F470 nid=0xf14 waiting on condition
"Suspend Checker Thread" prio=10 tid=0x01A1BD40 nid=0xb88 runnable
----------------------------------------------------
Done.

0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9915673
Here is a thread list dump if that helps....

Dump thread list ...
Group main,ac=11,agc=2,pri=10
    main,5,alive
    AWT-Shutdown,5,alive
    AWT-Windows,6,alive,dameon
    Java2D Disposer,10,alive,dameon
    AWT-EventQueue-0,6,alive
Group Plugin Thread Group,ac=3,agc=0,pri=10
    Main Console Writer,6,alive
    AWT-EventQueue-1,6,alive
    TimerQueue,5,alive,dameon
Group http://kn4152.srv.knowledgenet.corp/ICNDPREP/icndprep2_2553/shell/-threadGroup,ac=2,agc=0,pri=4
    thread applet-aicc_wrapper.class,4,alive
    AWT-EventQueue-2,4,alive
Done.
0
 
LVL 92

Expert Comment

by:objects
ID: 9915696
No what I'm after is a sytack trace of the point where the exception is thrown:

ex.printStackTrace();
0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9915712
you'll have to forgive me... i am abit of a fish out of water with java..

i dont really have any code in my applet that throws that expection... shall I post the source to the applet?
0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9915865
I think i finally understand!

Take a look here..



Error:  java.security.AccessControlException: access denied (java.net.SocketPermission ipd.knowledgenet.corp resolve)

java.security.AccessControlException: access denied (java.net.SocketPermission ipd.knowledgenet.corp resolve)

      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.checkConnect(Unknown Source)

      at sun.plugin.net.protocol.http.HttpURLConnection.checkPermission(Unknown Source)

      at sun.plugin.net.protocol.http.HttpURLConnection.connect(Unknown Source)

      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)

      at aicc_wrapper.cmiPost(aicc_wrapper.java:186)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

      at java.lang.reflect.Method.invoke(Unknown Source)

      at sun.plugin.liveconnect.PrivilegedCallMethodAction.run(Unknown Source)

      at java.security.AccessController.doPrivileged(Native Method)

      at sun.plugin.liveconnect.SecureInvocation$2.run(Unknown Source)

      at java.security.AccessController.doPrivileged(Native Method)

      at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source)

      at sun.plugin.liveconnect.SecureInvocation.access$300(Unknown Source)

      at sun.plugin.liveconnect.SecureInvocation$CallMethodThread.run(Unknown Source)
0
 
LVL 92

Expert Comment

by:objects
ID: 9915867
if its not too long
0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9915917
here is the applets code...

Again, this works like a charm in IE 6...... just not NS 7.X

(freaking browser compatibility requirements!)


[code]
// AICC Function Wrapper -- KnowledgeNet, INC.
//
// Purpose: To handle communications between LMS and Courseware
//          either across domains or within the same domain name space.
//
//


import java.applet.Applet;
import java.io.*;
import java.lang.*;
import java.net.*;

public class aicc_wrapper extends Applet
{
      //Global variables
    String mSessionID;
    String mTargetURL;

    public void start()
    {
            //TODO
    }
      
      public void stop()
    {
            //TODO
    }

    public void destroy()
    {
            //TODO
    }
      
      //Initialize variables
      public void init()
    {
        mTargetURL = new String();
        mSessionID = new String();
    }
      
      public aicc_wrapper()
    {
            //TODO
    }

      //initialize session id variable
    public void cmiSetSessionID(String parsedId)
    {
        mSessionID = parsedId;
    }

      //Initialize target url variable
    public void cmiSetURL(String parsedUrl)
    {
        mTargetURL = parsedUrl;
    }

    public String cmiPost(String formCommand, String aiccData)
      {
        try
            {
            //check target and session variables
                  if(mTargetURL.length() == 0 || mSessionID.length() == 0)
            {
                        //target and session variables are empty.
                        //parse document URL to obtain these variables.


                URL url = getDocumentBase();
                String urlString = url.getFile();
                String upperCaseUrlString = urlString.toUpperCase();
               
                //find start location of the AICC_SID variable
                        //and parse it out.
                        //check for the uppercase version of the string to find the locaiton
                        //but use the normal version to parse out the data.
                        int i = upperCaseUrlString.indexOf("AICC_SID");
                        if(i > -1)
                {
                    mSessionID = urlString.substring(i + 9);
                    if(mSessionID.indexOf("&") > -1)
                              {
                        mSessionID = mSessionID.substring(0, mSessionID.indexOf("&"));
                              }
                }

                        //find start location of AICC_URL variable
                        //and parse it out.
                i = upperCaseUrlString.indexOf("AICC_URL");
                if(i > -1)
                {
                    mTargetURL = urlString.substring(i + 9);
                    if(mTargetURL.indexOf("&") > -1)
                              {
                        mTargetURL = mTargetURL.substring(0, mTargetURL.indexOf("&"));
                              }
                }


                        //not sure what is occuring here.
                        //looks like some sort of URL encoding?

                String tempURL = new String("");
                for(int k = 0; k < mTargetURL.length(); k++)
                {
                              if(mTargetURL.charAt(k) == '+')
                    {
                                    tempURL += 32;
                              }
                              else
                              {
                                    if(mTargetURL.charAt(k) == '%')
                                    {
                                          int l = mTargetURL.charAt(k + 1);
                                          if(l < 65)
                                                l -= 48;
                                          else
                                          if(l < 80)
                                                l -= 65;
                                          else
                                                l -= 97;
                                          int i1 = mTargetURL.charAt(k + 2);
                                          if(i1 < 65)
                                                i1 -= 48;
                                          else
                                          if(i1 < 80)
                                                i1 -= 55;
                                          else
                                                i1 -= 87;
                                          tempURL += (char)(l * 16 + i1);
                                          k += 2;
                                    }
                                    else
                                    {
                                          tempURL += mTargetURL.charAt(k);
                                    }
                              }

                        }
               
                        mTargetURL = tempURL;

            }


            URL url1 = null;
            URLConnection urlconnection = null;
            DataInputStream datainputstream = null;
            DataOutputStream dataoutputstream = null;
            int j = 0;
            byte abyte0[] = new byte[1024];
            String aiccResults = "";


            try
            {
           
                        mTargetURL = "http://" + mTargetURL;
                  url1 = new URL(mTargetURL);
            }
            catch(MalformedURLException malformedurlexception)
            {
                System.out.println("Unable to create URL for CGI (" + mTargetURL + "): " + malformedurlexception);
            }


            try
            {
                urlconnection = url1.openConnection();
            }
            catch(IOException ioexception)
            {
                System.out.println("Unable to open URL connection: " + ioexception);
            }


            urlconnection.setDoOutput(true);
            urlconnection.setDoInput(true);
            urlconnection.setUseCaches(false);
            urlconnection.setRequestProperty("Content-type", "application/x-www-form-urlencoded");
            urlconnection.setAllowUserInteraction(false);
           
                  try
            {
                dataoutputstream = new DataOutputStream(urlconnection.getOutputStream());
            }
            catch(IOException ioexception1)
            {
                System.out.println("Unable to create the output stream: " + ioexception1);
            }

            String formVariables = "command=" + formCommand + "&version=3.0" + "&session_id=" + URLEncoder.encode(mSessionID) + "&aicc_data=" + URLEncoder.encode(aiccData);
                              
                  try
            {
                dataoutputstream.writeBytes(formVariables);
                dataoutputstream.flush();
                dataoutputstream.close();
            }
            catch(IOException ioexception2)
            {
                System.out.println("Unable to write the data:  " + ioexception2);
            }


            try
            {
                datainputstream = new DataInputStream(urlconnection.getInputStream());
            }
            catch(IOException ioexception3)
            {
                System.out.println("Unable to open HTTP connection to read: " + ioexception3);
                        //ioexception3.printStackTrace();

            }

            try
            {
                while((j = datainputstream.read(abyte0)) > 0)
                    aiccResults += new String(abyte0, 0, 0, j);
            }
            catch(IOException ioexception4)
            {
                System.out.println("Unable to read POST response: " + ioexception4);
            }

            finally
            {
                try
                {
                    if(datainputstream != null)
                        datainputstream.close();
                }
                catch(IOException ioexception5)
                {
                    System.out.println("Unable to close HTTP connection: " + ioexception5);
                }
            }

            return aiccResults;
        }
        catch(Exception exception1)
        {
            System.out.println("Error:  " + exception1);
                  exception1.printStackTrace();
        }
        return "";
    }



}


[/code]
0
 
LVL 92

Expert Comment

by:objects
ID: 9916219
>        catch(Exception exception1)
>        {
>            System.out.println("Error:  " + exception1);
>            exception1.printStackTrace();
>        }

You already appear to be printing out the stack trace. Does anything else appear in the console than what you posted above?
0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9916431
Yea I just added that stackTrace based on your previous comment.

No nothing else appears in the console when I load the page and execute the function.

0
 
LVL 92

Expert Comment

by:objects
ID: 9916453
try exitting IE, and starting again. IE maybe running old cached class.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 1

Author Comment

by:MeyerCa
ID: 9916464
IE actually is not the problem. Its Netscape 7.x.  Have exited, clear the cache, rebooted etc...  nothing is working but IE.

0
 
LVL 92

Expert Comment

by:objects
ID: 9916480
sorry meant to say NS :)
so you still aren't getting a stack trace in the console?
0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9916528
No I am getting the stack trace:  I posted this before the source code... you might have missed it.

Error:  java.security.AccessControlException: access denied (java.net.SocketPermission ipd.knowledgenet.corp resolve)
java.security.AccessControlException: access denied (java.net.SocketPermission ipd.knowledgenet.corp resolve)
     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.checkConnect(Unknown Source)
     at sun.plugin.net.protocol.http.HttpURLConnection.checkPermission(Unknown Source)
     at sun.plugin.net.protocol.http.HttpURLConnection.connect(Unknown Source)
     at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
     at aicc_wrapper.cmiPost(aicc_wrapper.java:186)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at sun.plugin.liveconnect.PrivilegedCallMethodAction.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at sun.plugin.liveconnect.SecureInvocation$2.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source)
     at sun.plugin.liveconnect.SecureInvocation.access$300(Unknown Source)
     at sun.plugin.liveconnect.SecureInvocation$CallMethodThread.run(Unknown Source)
0
 
LVL 2

Expert Comment

by:anthony_castillon
ID: 9916926
Is your applet in a JSP file?  Why not use the <jsp:plugin> instead of <applet>?  It should handle the differences among the browsers.

Use this link as a starting point:  http://java.sun.com/products/jsp/tags/syntaxref.fm12.html
0
 
LVL 92

Expert Comment

by:objects
ID: 9917924
is that method getting called by js?
0
 
LVL 92

Expert Comment

by:objects
ID: 9917985
if so I'd say its because NS considers your JS untrusted, try this test:
http://landons.freeservers.com/mozilla/TestApplet.html
0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9920456
I ran that test and I got the following in the java console:

Test begin -  - Test end
Test begin - access denied (java.io.FilePermission C:\Test.fil write) - Test end


So then the question is, how do I make my applet trusted by the client?  Do I need to get a certificate from a CA?
0
 
LVL 92

Expert Comment

by:objects
ID: 9924178
Your applet is trusted, it is the JS that isn't.
You need to sign your JS, or execute the operation on a seperate (trusted) thread.
0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9924196
Interesting...

so you are saying that the embeded javascript on the HTML page is what is causeing the security violation?

How would I go about signing that??

0
 
LVL 92

Expert Comment

by:objects
ID: 9924244
If javascript is invoking that method then yes.
Is that the case?
0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9924339
Below is the function on the HTML page that invokes the methods of the applet.

SOoooooo yes.. that IS the case.

How do I get around it?

Thanks,
Chris

function getParam(){
            document.aicc_wrapper.cmiSetURL(unescape(targeturl));
            document.aicc_wrapper.cmiSetSessionID(sessionid);
            var dataStr = "";
            getParamResults = document.aicc_wrapper.cmiPost("GetParam", dataStr );
            
            alert(getParamResults.toString());
}
0
 
LVL 92

Expert Comment

by:objects
ID: 9924383
Try queueing the request and processing it on a seperate thread.
0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9924402
ok, at risk of sounding stupid..... how do I do that. :)

0
 
LVL 92

Accepted Solution

by:
objects earned 100 total points
ID: 9924439
Save the parameters in a list and have a seperate thread read the parameters off that list and make the call.
Here's a tutorial on threads if needed:
http://java.sun.com/docs/books/tutorial/essential/threads/index.html
0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9924549
from just spot reading that tutorial.... I can spawn a new thread in the same applet?  (aka subclassing?)

or do i need to create an new applet, that the primary applet calls and sends the data to.

0
 
LVL 92

Expert Comment

by:objects
ID: 9924610
spawn a thread in the same applet.
0
 
LVL 1

Author Comment

by:MeyerCa
ID: 9924645
I will work on that and report my findings here.

Thanks!

chris
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now