Signed applets load slower than javascript

I have a signed applet and i had problems with certifications but i solved them.
Now i have a new problem with the chat , it�s when the page is load, javascript tries to get some variables from the applet but it has�n load jet and javascript stops.
Is 1.5 slower than 1.4??
How can i solve it'??

In javascript you can use try and catch. When caught use setTimeout
var varOfTheApplet = null;
function callPublicMethodOfTheApplet(){
  try{
        varOfTheApplet = document.getElementById("idOfMyApplet").publicMethod();
   }catch(e){
        setTimeout("callPublicMethodOfTheApplet();",500);
}

Similar Messages

  • What EXACTLY is happening when a signed applet loads in a page?

    I'd like to know what happens when a signed applet is loaded in a page with the Java Plug-in. What methods are called, in which order, what happens when the user denies the applet, etc.
    Any links to resources are also welcome.
    Thanks!!

    Hi there,
    Please go thru the following links. I think they are self explanatory and does not need more elaboraion. These links expalin how the Signed Applet is loaded and how does the Class Loader and Code Verifier make it possible for the applet to work within it's security restriction.
    Here are the links:
    1.http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/rsa_how.html
    2. http://ntrg.cs.tcd.ie/undergrad/4ba2.96/group2/applets.html
    For more information about policy files you can check the following link:
    http://www.interex.org/pubcontent/enterprise/jan01/14chew.html

  • Problems with RSA Signed Applets methods called by JavaScript

    Hi Folks,
    I need to give all permissions to an Applet used in an Intranet application, so I signed the jar containing it with a RSA self-cert and I did the same for all the other jar files userd by the applet.
    The applet runs under Java Plugin with JRE 1.5.0_06: I am requested by the browser to install the cert and all works fine.
    When a JavaScript function calls a public method of the applet I received a security exception when the code tries to read a system property.
    The same method works fine if called by the applet itself or by a gui event (i.e. a button click) inside the applet, so the problem seems to be related to the fact the applet is used by JavaScript (in Explorer 6).
    Does anyone know some way to overcome this problem????
    Message was edited by:
    piero

    If I may be so bold as to ask you to elaborate on this fix? I have encountered an identical issue, but I have no idea about your reference to your fix, sorry.

  • Firefox 23 loads slower than Internet Explorer 10

    I was doing a speed test between Firefox 23 and Internet Explorer 10. If you visit http://ie.microsoft.com/testdrive/Performance/PenguinMark/ all addons are disable on Firefox 23 and still slower than internet explorer. Why is that?

    I don't know how to interpret my results. I got 1 in Firefox (no snow visible) and 8370 in IE (blizzard). Maybe I'm blocking something?

  • Problem in Signed Applet while communicating with Javascript

    Hi,
    I’m facing a problem with applet. Applet calls JavaScript methods and vice versa. Applet works fine with JRE 5 to JRE 6 up to build no 1.6.0._7 but it fails with build no 1.6.0_10.
    The problem description is given below:
    After embedding applet in my HTML page using <OBJECT> tag, I’ve to check either any problem during applet’s execution, I want to get the error reason by calling my defined method getErrorReason() in applet that returns the error reason, I call the getErrorReason() against the applet’s object in JavaScript immediately after embed applet code in my HTML page, a JavaScript errors occurs and my applet fails to perform its execution.
    JavaScript error: Object does not support this property.
    The error points to the HTML page area where I’m calling getErrorReason() against applet object.
    The above JavaScript error occurs after the successful completion of Applet’s init(). I’m facing this problem only in JRE 6 build 1.6.0_10-b33.
    Please suggest me any solution.
    Thanks in advance.
    Regards,
    Israr Ahmed

    We are using the HttpURLConnection. If I have to go down the stack to the Socket object, well I guess I have to re event the wheel so to speak.
    I have tried both Connection: close and Connection: Keep-Alive. Not at the same time :) but in different intrim releases of test applet.
    // Here is the current incarnation of how I am trying to connect.
    URL url = new URL(sURL);
    trace("attempting to connect to URL: " + sURL, DEBUG);
    connection = (HttpURLConnection)url.openConnection();
    connection.setDoOutput(true);
    connection.setDoInput( true );
    connection.setRequestMethod("POST");
    connection.setUseCaches( false );
    connection.setInstanceFollowRedirects( true );
    connection.setAllowUserInteraction( false );
    connection.setRequestProperty("Pragma", "no-cache");
    connection.setRequestProperty("Expires", "-1");
    connection.setRequestProperty("Connection", "Keep-Alive");
    connection.connect();
    // Now I write our form POST data and flush and close the output stream.
    BufferedOutputStream bos = new BufferedOutputStream(connection.getOutputStream());
    bos.write(sForm.getBytes());
              bos.flush();
    bos.close();
    // Get the input and read
    bis = new BufferedInputStream(connection.getInputStream());
    trace( "reading input stream for action: " + sAction );
    byte[] responseBuffer = new byte[4096];
    int bytesRead = 0;
    while( (bytesRead = bis.read( responseBuffer, 0, responseBuffer.length )) != -1 )
    sbResponse.append( new String( responseBuffer, 0, bytesRead ));
    totalBytesRead += bytesRead;
    catch (Throwable e)
    e.printStackTrace();
    try
    m_connections.remove( sAction );
    connection.disconnect();
    catch ( Throwable t ) {}
    finally
    if ( bis != null )
    try
    bis.close();
    catch( Throwable t ) {}
    With the above code in place what I am now seeing, as opposed to a premature EOF exception, is blocking behavior on the read.

  • Firefox loads slower than internet explorer- WHY?

    It takes twice as long to load Firefox. I took it to Best Buy to check out. They couldn't figure out. No virus.

    Firefox needs longer to startup than IE. IE is part of Windows and large parts are already loaded if Windows is started. Firefox uses XUL and JavaScript code that needs to be loaded and compile on startup and that takes longer. That is what makes Firefox configurable by extensions makers and proficient users.
    How long does it take for Firefox to start?
    A few seconds (less that 20) is quite normal for the first start, especially if you have a lot of bookmarks or history or extensions. A subsequent start should be much faster with all the files in the disk cache. There is also security software that can monitor disk access of Firefox to strictly and cause extra delays in starting.

  • Videos load slower than in the past

    Since upgrading to Firefox/3.6.13, videos load much slower. I have run speed test on system and that is not the problem. I have DSL. The later in the day, the slower the down load.

    Hello Paul,
    Least likely is Malware.
    Check the S.M.A.R.T. status of the drive in Disk Utilty by highlighting the Drive & looking at the bottom of the window.
    Open Activity Monitor in Applications>Utilities, select All Processes & sort on CPU%, any indications there?
    How much RAM & free space do you have also, click on the Memory & Disk Usage Tabs.
    In the Memory tab, are there a lot of Pageouts?

  • Why is C# code slower than Javascript code?

    I'm porting a Javscript to C#, for deployment and management issues, but I have an issue which I cannot figure out;  A same function written in C# is ten times slower compared to Javascript.
    For example, I wrote a Javascript which changes the size of every images within the current InDesign document, and it takes about 10 seconds. In C#, via InDesign classes, it takes about 2 minutes.
    I think this is because of the real-time update whenever a document is opened. Duration is nearly the same with Javascript when I set property:visible to false.
    I tried what I can, but failed. Any help would be very grateful.
    Thank you.

    You have to know more about this to work out from reply 2 what the answer to reply 1 is -- "Are you using A or B? Yes." -- And while I'm not faced with the problem, I am interested in the answer.
    Ah, I think I'm reading the "duration" comment in the OP wrongly: I think you mean that switching document-visibility property to false causes the C# to run fast. I read it as though you meant JavaScript got slower.
    Bear in mind that must of the activity in this kind of code is in the interactions with the Object Model and then with the UI if it is active. The code in the script is going to zip through its part no matter which language (assuming reasonable competence).
    Not sure this helps, but I am fascinated by the COM vs. SOAP question and the implications of that.
    Dave

  • Web sites loading slower than usual, sometimes not loading at all...

    Hello everyone!
    I´m using Lion on an iMac (mid-2010) and I´m frequently having problems loading some web sites using a wi-fi. They take much more time than usual to load and not all elements of the pages are loaded, like thumbnails and other images for example.
    E-mail, torrent and instant-messaging programs work as usual though.
    As you guys might guess, I had no problems using Snow Leopard.
    I tried many things to solve the problem: resetting the SMC, setting a fixed ip, resetting the iMac and the router, setting other dns addresses.
    They seem to work for a while but the problem eventually returns.
    Is anybody experiencing something like this?

    Your above posted system details show outdated plugin(s) with known security and stability risks.
    *Shockwave Flash 9.0 r999
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/
    In Firefox 3.6 and later versions you need the Next-Generation Java™ Plug-In present in Java 6 U10 and later (Linux: libnpjp2.so; Windows: npjp2.dll).
    http://java.com/en/download/faq/firefox_newplugin.xml
    See also http://java.sun.com/javase/6/webnotes/install/jre/manual-plugin-install-linux.html

  • Do externally linked F4V files load slower than FLVs?

    Hey there,
    I have used the FLVPlaybackComponent in my project to load an external F4V (about 2.5 minutes long) which is on the same server, in the same directory as my .swf. Firefox seems to take forever (about 15-20 seconds cable or T1) to load the file, while Safari and Internet Explorer seem to be very zippy (1-3 seconds cable or T1). Is there something that I can do to make Firefox load the .f4v as quickly as the other browsers? Of course, I've tried this on multiple computers, multiple OS's, and cleared caches until kingdom come. Troublesome version of Firefox is 3.6.
    Thanks,
    -Steve

    If anyone is interested...the answer to this is yes.
    At least, with Firefox...
    I encoded the same source file to flv instead of f4v, and lo and behold, it snaps to attention when loaded in Firefox. I was even able to encode the data rate of the flv to one twice the amount of the f4v and it still loaded immediately.
    While I know this may not be as much of an f4v issue as it is a Mozilla handling issue, I hope others will benefit from this information. Actually, Chrome had the same problem as Firefox, so, whatever Google and Mozilla are doing to handle f4v content is kinda' screwy at the moment.
    Viva flv!

  • Oracle Forms loading slower with Sun JRE in Oracle E-Business Suite 11i

    Hi,
    After Deploying Sun JRE (Native Plug-in) for Windows Clients in Oracle E-Business Suite 11i (Note 290807.1) we find that Oracle Forms are loading slower than using Jinitiator.
    Also the PDF reports are opening in a minimized fashion. Meaning the PDF reports are opening correctly in new browser window (as expected) but is minimized.
    Customer is not willing to go live with Sun JRE due to these issues.
    Plz advice is there is any additional configuration I need to do.
    Rgds,
    Thiru

    When the JRE was installed/configured on the workstations was the jar cache placed on a LAN drive instead of the local drive? We have experienced poor performance with both the JRE and Jinitiator when the Workstation Sysadmins configured the jar cache to be located on a LAN drive. Also is the size of the jar cache on the workstation sufficient to hold all of your required jar files. It could be downloading the jar files all the time.
    Overall our performance with the JRE is comparible to the Jinitiator.
    Sorry I have not experienced the problem that you are having with you pdf reports so I can't provide any comments on it.

  • Signed applets called from javascript - how/where to load policy file?

    I'm running into some apparently well-known problems with signed applets accessing a client machine's hard drive.
    So, I can get things to work if I place the following two lines in my 'local' JDK installation:
    permission java.io.FilePermission "${user.home}/x.properties", "read,write";
    permission java.util.PropertyPermission "user.home", "read";These let me a) read the user's home directory and b) read/write a file that's located there.
    What I don't want to do is edit the java.policy file, but I'm having problems loading a separate policy file. The app server we run with our product is jetty, and I'm assuming I would be passing in the '-Djava.security.policy=='filename' with the other jetty start-up parameters- is this a correct assumption? And, what path do I give for the file, will I need to put it somewhere in the .war file we distribute, or in the JDK installation on the server? If it's on the server, will client machine's know about these extra rights?
    I'd REALLY appreciate any help I could get on this...
    thanks in advance,
    +0^^

    Maybe you didn't realize but my previous post was sarcastically ment:
    "hello SUN security stop bugging me in writhing this malicious program"
    and
    "hello SUN security, I'm a good boy now trust what I'm doing"
    Are in a practical sense exactly the same.
    SUN should either remove the stack check or the doprivileged. The stack check takes up
    valuable resources for nothing since a malicious program can easily circumvent that.
    Your post about a malicious user abusing your (CA) signed applet to ruine someone's
    system is correct, it would not be difficult. A CA signed applet will not even ask a user to
    trust or not. This is one of the reasons we have the usepolicy in affect, but this cannot be
    used on "grandma's old PC" since it's too complicated for users to do such things.
    YOU seem to be the one to blame, not the hacker! (The user accepted YOUR
    certificate!).Actually you are to blame, because you made software that exposes a vonurability
    other people can take advantage of.
    what you can do before calling the doprivileged private method is check the call stack.
    So your signed applet has a public method checking the callstack, if this lookes OK
    that method will call the private doprivileged method.
    Here is the example
    package t;
    import java.util.Properties;
    import java.applet.Applet;
    public class test extends Applet {
             public test(){
                   startingPrivileged();
             public void startingPrivileged(){
                   System.out.println("this is the stack");
                   try{
                        throw new Exception("get the call stack");
                   }catch(Exception e){
                        StackTraceElement stack[] = e.getStackTrace();
                        for (int i=0; i<stack.length; i++) {
                             System.out.println("file: " + stack.getFileName() + " method: " + stack[i].getMethodName() + " class: " + stack[i].getClassName() + " at " + new Integer(i).toString());
                        // this is a really simple check to see if this method was started from the t. package
                        // a good hacker can just create it's own package named t and take advantage of this method
                        // if this method was started from the same package there is no reason to make this method
                        // public, protected would work.
                        // there must be a better way to check if this method was called by "your" or "trusted" code
                        if(stack[1].getClassName().startsWith("t.")){
                             dosomePrivileged();
              private void dosomePrivileged(){
                   System.out.println("this is the method that does privileged stuff");
         public static void main(String args[]) {
              new test();

  • 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.

  • Classloader caching in signed applet is very slow and weird

    I have a signed applet running in the 1.4.1_01 plugin environment, and
    I'm getting the following kinds of messages when I use debug mode 5 in the console:
    Connecting http:[myserver]/someclass.class with no proxy
    Connecting http:[myserver]/someclass.class with cookie "JSESSIONID=..."
    Sometimes, the classloader will say:
    WARNING: Unable to cache someclass.class
    Moreover, some classes will be repeated two or three times, as if the classloader is trying to get the same class two or three times.
    Some of these classes are even in the java.lang package!!
    The thing is, I'm actually trying to get the applet to use webservices, so I've signed the Apache Axis jar files (about 8 or so) and included them in the "cache_archive" parameter. The classes giving problems are from these archives, not from my main applet jar.
    The applet will eventually work, but the first time takes a LONG time to initialize because the classloader is trying to verify all the classes (i think). Subsequent runnings of the applet within the same browser will be much faster, but the same thing will happen if I start a new browser instance.
    My questions are:
    1) Why is the classloader trying to load from my http server rather than from the local jars? (they seem to be statically cached, I checked the plugin control panel)
    2) Why is the classloader reloading the same classes multiple times?
    3) Is the classloader verifying the signatures for each class, because it's taking a long time due to very many classes (100's).
    I can't seem to find ANY documentation for this at Sun or Google.
    Please help if you can!
    Andrew

    I've got the same problem with applet using SOAP based on jwsdp.
    But classloader only try to get classes from server that are used in SOAP calls.
    The only workaround I found is to move this classes to root package, but still there are problems with
    Connecting http://<host>/int.class with no proxy
    Connecting http://<host>/int.class with no proxy
    WARNING: Unable to cache http://<host>/int.class
    requests.
    Maybe this is a bug of Sun SOAP implementation?

  • Calling1.4.1 signed applet from Javascript causes keyboard/focus problems

    Pretty sure there's a JRE bug here, but I'm posting to forums before I open one in case I'm missing something obvious :-)
    This issue may be specific to IE, I haven't tested elsewhere yet. Our web application is centered around a signed applet that is initialized with XML data via Javascript. We first noticed the problem when our users started upgrading from the 1.3.x plug-in to the 1.4.x plug-in. The major symptom was that shortcut keys stopped working. I debugged the problem off and on for about a month before I boiled it down to a very simple program that demonstrates the issue (included below). Basically, the program has a function that adds a JButton to a JPanel and registers a keyboard listener (using the new DefaultKeyboardFocusManager class) that prints a message to the console. This function is called by the applet's init() method, as well as by a public method that can be called from Javascript (called callMeFromJavascript()). I also included a very simple HTML file that provides a button that calls the callMeFromJavascript() method. You can test this out yourself: To recreate, compile the class below, JAR it up, sign the JAR, and put in the same dir with the HTML file. Load the HTML file in IE 5.0 or greater, and bring the console up in a window right next to it. Now click the button that says init--you should see the small box appear inside the button that indicates it has the focus. Now press some keys on your keyboard. You should see "KEY PRESSED!!!" appearing in the console. This is proper behavior. Now click the Init Applet from Javascript button. It has removed the button called init, and added one called "javascript". Press this button. Notice there is no focus occurring. Now press your keyboard. No keyboard events are registered.
    Where is gets interesting is that if you go back and make this an unsigned applet, and try it again, everything works fine. This bug only occurs if the applet is signed.
    Furthermore, if you try it in 1.3, signed or unsigned, it also works. So this is almost certainly a 1.4 bug.
    Anyone disagree? Better yet, anyone have a workaround? I've tried everything I could think of, including launching a thread from the init() method that sets up the components, and then just waits for the data to be set by Javascript. But it seems that ANY communication between the method called by Javascript and the code originating in init() corrupts something and we don't get keyboard events. This bug is killing my users who are very reliant on their shortcut keys for productivity, and we have a somewhat unique user interface that relies on Javascript for initialization. Any help or suggestions are appreciated.
    ================================================================
    Java Applet (Put it in a signed JAR called mainapplet.jar)
    ================================================================
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MainApplet extends JApplet implements KeyEventDispatcher
        JPanel test;
        public void init()
            System.out.println("init called");
            setUp("init");
        public void callMeFromJavascript()
            System.out.println("callMeFromJavascript called");
            setUp("javascript");
        private void setUp(String label)
            getContentPane().removeAll();
            test = new JPanel();
            getContentPane().add( test );
            JButton button = new JButton(label);
            test.add( button );
            test.updateUI();
            DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this);
        public boolean dispatchKeyEvent(KeyEvent e)
            System.out.println("== KEY PRESSED!!! ==");
            return false;
    }================================================================
    HTML
    ================================================================
    <form>
    <APPLET code="MainApplet" archive="mainapplet.jar" align="baseline" id="blah"
         width="200" height="400">
         No Java 2 SDK, Standard Edition v 1.4.1 support for APPLET!!
    </APPLET>
    <p>
    <input type="button" onClick="document.blah.callMeFromJavascript();" value="Init Applet via Javascript">
    </form>

    I tried adding the requestFocus() line you suggested... Same behavior.
    A good thought, but as I mention in my description, the applet has no trouble gaining the focus initially (when init() is called). From what I have seen, it is only when the call stack has been touched by Javascript that I see problems. This is strange though: Your post gave me the idea of popping the whole panel into a JFrame... I tried it, and the keyboard/focus problem went away! It seems to happen only when the component hierarchy is descended from the JApplet's content pane. So that adds yet another variable: JRE 1.4 + Signed + Javascript + components descended from JApplet content pane.
    And yes, signed or unsigned DOES seem to make a difference. Don't ask me to explain why, but I have run this little applet through quite a few single variable tests (change one variable and see what happens). The same JAR that can't receive keyboard events when signed, works just fine unsigned. Trust me, I'm just as baffled as you are.

Maybe you are looking for

  • Error while creating OAM MBean Conection

    I am in the process of integrating OAM with OIM. When I run the idmConfigTool, I get the following error. Any suggestions [oracle@idmhost2 bin]$ /u01/app/oracle/middleware/Oracle_IDM1/idmtools/bin/idmConfigTool.sh -configOAM input_file=/u01/OAMconfig

  • Playbook will not let me upload pictures, music or videos from Comp

    Hi, When the new playbook came out, a new desktop software was program was made. In the past I would open the playbook folder in my computer and i was able to put stuff in no problem. (It has been updated to the lastest version. I got the playbook  d

  • I minimize PSE6, but it keeps popping up

    I used PSE6 to edit some graphics and inserted (not copy & paste) one of the graphic files into a Word document. I minimized PSE6 to work on the text of the Word file, and PSE keeps sporadically popping up on its own. It just started doing this yeste

  • Flash Caching - How to stop?!?

    Does anyone know the most full-proof method for ensuring Flash movies don't cache in both IE, FirefFox and Safari as I am constantly having to instruct clients to remove their temporary internet files every time we update their movies. I've tried the

  • Jaas login in uix, like the jaas login in jsp

    I read the note on jaas with jsp / vpd but this is not working on a uix application is there a easy way to have jaas login with uix