Browser closing when applet is loaded

Hi,
As you can see from the forum list i'm having soooooooo much problems with my applets!
Please can some one point me in the right direction!
When my applet loads the browser tells me that the main class is loaded but then closes with for no apparent reason!
Does anyone know why?
Regards
Richard

It appears from the following statement that a native code process failed when called by the jvm.
The crash happened outside the Java Virtual Machine in native code.Not much more can be said. The cause does not appear to Java code.

Similar Messages

  • JVM crashed when applet is loaded in browser

    when applet is loaded in browser after some time JVM crashedwith hs error log.
    i am using
    JRE 1.6.0_10,
    1GB RAM,
    XP SP3,
    IE6
    Error log
    # An unexpected error has been detected by Java Runtime Environment:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d02bd1d, pid=6032, tid=4772
    # Java VM: Java HotSpot(TM) Client VM (11.0-b15 mixed mode windows-x86)
    # Problematic frame:
    # C [awt.dll+0x2bd1d]
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #

    It appears from the following statement that a native code process failed when called by the jvm.
    The crash happened outside the Java Virtual Machine in native code.Not much more can be said. The cause does not appear to Java code.

  • Sun.applet.appletPanel.run() is invoked twice when applet is loaded.

    When I am loading my applet in the browser, sun.applet.appletPanel.run() function is invoked 2 times according to JProfiler.
    How can we solve this problem to reduce the number of calls to one???
    TIA
    Ashish

    Anyone having slightest of idea about this problem please reply....

  • Close browser window when applet closes (seperateFrame=True)

    Hello,
    Does anyone know a way to close the parent browser window when the java applet closes when the config setting seperateFrame=True?
    Thanks

    Do a little search in the forum, there are 100s of solutions on how to close the browser window.

  • ActionPerformed method not working when applet is loaded in browser window.

    Hey there guys. I need urgent help from anybody who has experience in deploying websites whose code is in java.
    I am having two problems as mentioned below...
    first, I have made a simple login screen using java swing and JApplet. there is a single button to login. the action performed for this button accesses a private method to check the username and password which are there in atext file. the applet is working perfectly in appletviewer but when i load the applet in a Internet Explorer window using HTML's Applet tag, the button is giving no response at all even when i enter the correct username and password.
    I guess it is either not calling the private function that is checking the username and password from the tes=xt file or it can not access the file. Please help as soon as possible as this is related to my college project.
    I am attaching the code herewith. Suggestions to improve the coding are also welcome.
    the second problem is that while writing my second program for generating a form which registers a user the html is not at all loading the applet into the browser and also if im trying to access a file to write all the details into the console is showing numerous amount of error after i press the button which i can't not understand. the only thing i can understand is that it is related to file access permissions. If anybody could put some light on the working of worker threads and thread safe activities of SwingUtilities.invokeandWait method it would be really appreciable.
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.plaf.*;
    <applet code = "UserLogin" width = 300 height = 150>
    </applet>
    public class UserLogin extends JApplet implements ActionListener, KeyListener {
         private JLabel lTitle;
         private JLabel lUsername, lPassword;
         private JTextField tUsername;
         private JPasswordField tPassword;
         private JButton bLogin;
         private JLabel lLinkRegister, lLinkForgot;
         private JLabel lEmpty = new JLabel(" ", JLabel.CENTER);
         private JPanel panel1, panel2;
         public void init() {
              try {
                   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                   SwingUtilities.invokeAndWait(new Runnable() {
                        public void run() {
                             LoginGUI();
              catch(Exception e) {
                   e.printStackTrace();
         public void start() {
              setVisible(true);
         public void stop() {
              setVisible(false);
         private void LoginGUI() {
              super.setSize(300, 150);
              super.setBackground(Color.white);
              lTitle = new JLabel("<HTML><BODY><FONT FACE = \"COURIER NEW\" SIZE = 6 COLOR = BLUE>Login</FONT></BODY></HTML>", JLabel.CENTER);
              lUsername = new JLabel("Username : ", JLabel.CENTER);
              lPassword = new JLabel("Password : ", JLabel.CENTER);
              tUsername = new JTextField(15);
              tPassword = new JPasswordField(15);
              bLogin = new JButton("LOGIN");
    //          bLogin.setEnabled(false);
              bLogin.addActionListener(this);
              bLogin.addKeyListener(this);
              panel2 = new JPanel();
              GridBagLayout gbag = new GridBagLayout();
              GridBagConstraints gbc = new GridBagConstraints();
              panel2.setLayout(gbag);
              panel2.addKeyListener(this);
              gbc.anchor = GridBagConstraints.CENTER;
              panel2.setMinimumSize(new Dimension(300, 200));
              panel2.setMaximumSize(panel2.getMinimumSize());
              panel2.setPreferredSize(panel2.getMinimumSize());
              gbc.gridx = 1;
              gbc.gridy = 1;
              gbag.setConstraints(lUsername,gbc);
              panel2.add(lUsername);
              gbc.gridx = 2;
              gbc.gridy = 1;
              gbag.setConstraints(tUsername,gbc);
              panel2.add(tUsername);
              gbc.gridx = 1;
              gbc.gridy = 2;
              gbag.setConstraints(lPassword,gbc);
              panel2.add(lPassword);
              gbc.gridx = 2;
              gbc.gridy = 2;
              gbag.setConstraints(tPassword,gbc);
              panel2.add(tPassword);
              gbc.gridx = 2;
              gbc.gridy = 3;
              gbag.setConstraints(lEmpty,gbc);
              panel2.add(lEmpty);
              gbc.gridx = 2;
              gbc.gridy = 4;
              gbag.setConstraints(bLogin,gbc);
              panel2.add(bLogin);
              panel1 = new JPanel(new BorderLayout());
              panel1.add(lTitle, BorderLayout.NORTH);
              panel1.add(panel2, BorderLayout.CENTER);
              add(panel1);
              setVisible(true);
         public void keyReleased(KeyEvent ke) {}
         public void keyTyped(KeyEvent ke) {}
         public void keyPressed(KeyEvent ke) {
              if(ke.getKeyCode() == KeyEvent.VK_ENTER){
                   String username = tUsername.getText();
                   String password = new String(tPassword.getPassword());
                   if(username.length() == 0 || password.length() == 0) {
                        JOptionPane.showMessageDialog(new JFrame(),"You must enter a username and password to login", "Error", JOptionPane.ERROR_MESSAGE);
                   else {
                        boolean flag = checkUsernamePassword(username, password);
                        if(flag)
                             JOptionPane.showMessageDialog(new JFrame(),"Username and Password Accepted", "Access Granted", JOptionPane.INFORMATION_MESSAGE);
                        else
                             JOptionPane.showMessageDialog(new JFrame(),"Username or password Incorrect", "Access Denied", JOptionPane.INFORMATION_MESSAGE);
         public void actionPerformed(ActionEvent ae) {
              String gotCommand = ae.getActionCommand();
              if(gotCommand.equals("LOGIN")) {
                   String username = tUsername.getText();
                   String password = new String(tPassword.getPassword());
                   if(username.length() == 0 || password.length() == 0) {
                        JOptionPane.showMessageDialog(new JFrame(),"You must enter a username and password to login", "Error", JOptionPane.ERROR_MESSAGE);
                   else {
                        boolean flag = checkUsernamePassword(username, password);
                        if(flag)
                             JOptionPane.showMessageDialog(new JFrame(),"Username and Password Accepted", "Access Granted", JOptionPane.INFORMATION_MESSAGE);
                        else
                             JOptionPane.showMessageDialog(new JFrame(),"Username or password Incorrect", "Access Denied", JOptionPane.INFORMATION_MESSAGE);
         private boolean checkUsernamePassword(String username, String password) {
              String user = null, pswd = null;
              try {
                   FileInputStream fin = new FileInputStream("@data\\userpass.txt");
                   DataInputStream din = new DataInputStream(fin);
                   BufferedReader brin = new BufferedReader(new InputStreamReader(din));
                   user = (String) brin.readLine();
                   pswd = (String) brin.readLine();
              catch(IOException ioe) {
                   ioe.printStackTrace();
              if(username.equals(user) && password.equals(pswd))
                   return true;
              else
                   return false;
    }PLEASE HELP ME GUYS......

    RockAsh wrote:
    Hey Andrew, first of all sorry for that shout, it was un-intentional as i am new to posting topics on forums and didn't new that this kind of writing is meant as shouting. Cool.
    Secondly thank you for taking interest in my concern.No worries.
    Thirdly, as i mentioned before, I am reading i file for checking of username and password. the file is named as "userpass.txt" and is saved in the directory named "@data" which is kept in the same directory in which my class file resides.OK - server-side. That makes some sense, and makes things easier. The problem with your current code is that the applet will be looking for that directory on the end user's local file system. Of course the file does not exist there, so the applet will fail unless the the end user is using the same machine as the server is coming from.
    To get access to a resource on the server - the place the applet lives - requires an URL. In applets, URLs are relatively easy to form. It might be something along the lines of
    URL urlToPswrd = new URL(getCodeBase(), "@data/userpass.txt");
    InputStream is = urlToPswrd.openStream();
    DataInputStream din = new DataInputStream(is);
    So the problem is that it is reading the file and showing the specific output dialog box when i run it through appletviewer.. Huhh. What version of the SDK are you using? More recent applet viewers should report security exceptions if the File exists.
    ..but the same is not happening when i launch the applet in my browser window using the code as written belowHave you discovered how to open the Java Console in the browser yet? It is important.
    Also the answer to your second question
    Also, the entire approach to storing/restoring the password is potentially wrong. For instance, where is it supposed to be stored, on the server, or on the client?is that, as of now it is just my college project so all the data files and the username and password wiles will be stored on my laptop only i.e. on the client only. no server involved.OK, but understand that an applet ultimately does not make much sense unless deployed through a server. And the entire server/client distinction becomes very important, since that code would be searching for a non-existent file on the computer of the end user.

  • Browser crash when applet in init method - JRE 1.5

    When using the 1.5 JRE to display an applet within a web page and the applet is in the start method the browser crashes.
    Steps to recreate:
    1. Create a simple applet that has a while loop within the start method.
    2. create a web page that contains the applet, a text box, and a link to a url.
    3. Open the web page with IE.
    4. select the textbox.
    5. select the link.
    The browser will crash at this point.
    Does anyone know what can be done to prevent the crash of the browser? I am trying to limit changes to the applet, but the latest jre may require that changes are made.
    *** Start Method ****
    public void start() { 
         while (true) {
              try {
                   Thread.sleep(200);
              catch (Exception e)
    }

    Anyone?

  • Browser closing when opening PDF output in Apps

    Hello,
    When opening the concurrent request/report output (for PDF output), the browser just closes.
    The PDF output were generated thru XML Publisher (reports converted in XML Publisher - rtf).
    PDF is defined in the Viewer Options/ System Options(Viewer). I could open PDF output by
    pressing CTRL key while clicking on the output request Output button. It will give prompt on
    whether to Open or Save the PDF.
    Not sure if it's really related to XML Publisher, maybe more on concurrent request, but idea
    will be very much appreciated.
    Thanks,
    Rownald

    To clarify what you posted:
    When opening the PDF document, your browser closes. When pressing the control key and opening the document, you get a dialog window (with the choices of open or save). What happens when you select open?
    This is browser behavior, nothing to do with this being a PDF file. Which browser and which platform? If you are using IE7, popup blocker is automatically enabled, and if you are viewing this on a 2003 server, you have server security settings to override. Pressing the control key allows popups.

  • Where browser saved its applet files?

    Hi friends,
    When applet is loaded into browser, is there any local copy somewhere under browser or its temp directory? I am wondering where the browser saves the applet.jar or *.class files in user's local machine? Or it just loaded into the user's memory, and does not save anywhere?
    Thanks.

    The applet class file is cached in the user's home directory if you are using Windows. For example I'm using win2k so it gets cached in C:\Documents and Settings\jaind\.jpi_cache\file\1.0\ directory and there are two files XYZApplet.class-680e2d01-7c564852.class and UnzipApplet.class-680e2d01-7c564852.idx. Next time when browser tries to load applet it looks at this version. If the server version is newer than this it again downloads the applet class otherwise uses the cached class.

  • Browser crashes when trying to open 2 applets in 2 browser windows-

    i am having this weird problem, on windows XP, if i open a applet in IE or firefox browser and then open a new browser window and try to open another applet in that windows, the browser simply crashes with no error message or anything,
    For example
    if i click on link below and then when this applet is loaded i open a new browser window and try to open other applet from the link the new opened window closes.
    can some one try this on there PC and let me know if it happens there, and what might be the issue?
    [http://www.realapplets.com/applets/quizmaster/]
    [http://www.realapplets.com/applets/secretpass/]

    Open the Console app in Applications>Utilities and look for log entries at the time of the problem and post them here

  • No return in JS when accessing an applet in loading process

    When I try to access a property or a method of an applet which is
    not completely loaded by the plug-in, my javascript instruction
    never returns. Not even an exception or a null. The CPU is 100% busy
    with the netscape.exe for ever. When I close the browser, I get a
    Dr. Watson.
    Context :
    Netscape 6.2, plug-in 1.3.1 or
    Netscape 7.0, plug-in 1.4.0
    My purpose is to call the applet just after everything is put in place:
    the applet is loaded, ready is work and laid out on screen. So I do
    the call on the BODY onload event. It's fine with NN4.7 or IE5.5 and
    their internal JVM because when the event fires, the applet is ready.
    The problem is with the plug-in. I know that the onload event fires
    as soon as the HTML is ready, independently from the applet which is
    taken in charge by the plug-in. The availability of the applet takes
    some time because it comes from a signed Jar from a protected area of
    the web server. So you have to walk through two additional steps:
    authentify yourself with the server (first popup) and grant session
    privileges to the applet code (second popup). During this time, onload
    has been executed. I know I have to check if the applet is up and if
    not try again later with a setTimeout().
    But how to check the readiness of the applet? When I try to read
    whatever from it too soon, the code will never return !
    To demonstrate the no-return, just put an alert and wait for the applet
    to be loaded and fully active. Then you can have a return from it.
    Don't forget: because of the user prompts (authentication and grant),
    I can't determine a time to delay the check.
    The code:<HTML>
    <HEAD>
    <SCRIPT>
    function initApplet() {
    // If you uncomment the following alert() and wait
    // for the applet to be fully loaded and running, it will be OK.
    // If you don't, "document.applets[0].isActive" will never return.
    // alert("wait")
    if (document.applets.length != 0
      && document.applets[0].isActive
      && document.applets[0].isActive()) updateApplet()
    else setTimeout("initApplet()",1000)
    function updateApplet() {
    alert("call the applet")
    </SCRIPT>
    </HEAD>
    <BODY onload="initApplet()">
    <APPLET code="test.class" width="760" height="220" name="theApplet"
    archive="theSignedJar.jar" MAYSCRIPT>
    </APPLET>
    </BODY>
    </HTML>

    I am having a very similar problem in Netscape 6.2 or later. (It never occurs in Internet Explorer) The applet can contain a few or many (in the 1000's) of applet parameters.
    I am following the same pattern to determine when the applet is loaded (by referencing a flag that is set to true through the applet), which seems pretty standard. The applet is loaded, and the flag is set, but when I begin to process the parameters, the first parameter that is examined is returned as null, even though it is included as an applet parameter in the HTML file that is generated. FYI the first parameter processed is the last one included in the source file. The worst part about this error is that the error seems random. Sometimes it works; other times it doesn't.
    Has anybody ever seen documentation as to how the parameters are loaded into memory, i.e. in what order? Does anybody know the algorithm used by the runtime system to find a parameter when a call to getParameter() is made?
    Any insight would be greatly appreciated!

  • Security problem when signed applet dynamically load plugins

    Hi!
    I have one problem : "security problem when signed applet dynamically load plugins"
    This is the scenario:
    the main program [app.jar]
    . contain applet and shared library (interface & implement of common class)
    . it is signed and run normally on browser
    . it can draw image loaded from other URL [ex] http://bp1.blogger.com/image.jpg
    . the image loader is in the shared library
    . dynamically load amazon.jar through URLClassLoader and reflection
    the plugin [amazon.jar]
    . search amazon product [ex] Harry Potter book
    . draw image on applet
    . use image loader from shared library, BUT CANNOT LOAD IMAGE
    The question: "Why it cannot load image, because the image loader is in the shared library which has been signed and working?" I tried to sign the amazon.jar too, but it did not work.
    Your reply would be very helpful. Thank you.
    Sovann

    hello. i have create a signed applet for A.jar. A.jar include two package B and C. the main applet class is within B.
    B need some classes in C to run the applet. but i got the error that class in package c are not found.
    what shall i do?

  • Closing the Applet when I exit the form

    I am deploying an application on web plataform using Forms Server 6i. I have created my own base.html with a logo and a menu as appropiate. I am using Oracle JInitiator to run the forms. When I run a form, the applet is loaded in a frame created in my base.html. All is working fine, but, when I exit the form, I supposse the applet it's still there, because in the page a gray rectangle still remains. I would like to have a background image in the page, and when I close the form, the applet was unloaded, so I can view the background again. How can I get that.
    Thanks.
    P.D.: Sorry but my english it's not so good.

    Make a new project and import old one into this new one.
    See if you can find a up to date Auto Save.
    Also make a habit of 'Save A Copy' to a different drive after each edit session. Save A Copy does not overwrite after so many times as Auto Save does.

  • Problem when applet going to load local machine jar files

    hi all,
    I have an applet that contains a 'core' module(jar) and 'core dependency' modules(jars).To reduce the applet download time i decided to load some heavy weight and lesser use 'core dependency' jars from local machine and core jar module and other low weight and highly use 'core dependency' jar modules from applet archives. I use the same class loader that used to load the applet archives for load local machine 'core dependency' modules.
    eg- this.getClass().getClassLoader().loadClass("class")
    When applet starts, Local machine 'core dependency' jar modules start loading but it couldn’t find classes in the core module (that download from archives) and stop the loading applet . But when i run that applet using IDE it is work fine. Please someone help me to solve this problem.
    Exception in thread "thread applet-com.dfn.pro.ui.UIContext-1" java.lang.NoClassDefFoundError: com/dfn/pro/plugins/dataupdate/UpdatableTable
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.dfn.pro.plugins.JarClassLoader.invokeClass(Unknown Source)
    at com.dfn.pro.plugins.PluginContext.loadPlugins(Unknown Source)
    at com.dfn.pro.plugins.PluginContext.analyzeDependancies(Unknown Source)
    at com.dfn.pro.plugins.PluginContext.<init>(Unknown Source)
    at com.dfn.pro.plugins.PluginContext.getPluginContext(Unknown Source)
    at com.dfn.pro.ui.UIContext.init(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: com.dfn.pro.plugins.dataupdate.UpdatableTable
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)

    eg- this.getClass().getClassLoader().loadClass("class")Try using Thread.currentThread().getContextClassLoader() instead of this.getClass().getClassLoader().

  • My web pages keep closing when I type in the web browser. How do I fix this?

    My web pages keep closing when I type in the web browser. How do I fix this?

    Safari?
    Safari > Preferences > Extensions
    Turn those off and try.

  • How to stop Execution of Queries when the Browser closed in middle?

    Hi,
    I have JSP search page, which takes search parameters from previous page runs queries and display the results. I am using connection pool to connect to AS400 database.
    The problem I am facing is... The query still runs on database server, when the user closes browser before getting the search results.
    I am closing all my statements and returning connection to pool at the end of the JSP page.
    Is there any way to terminate the execution of the queries, when the user closes browser?
    Thanks in advance.

    Allright.
    As you know there is no direct way to catch that event, you will have to do this workaround :
    1. Create a class which implements HttpSessionBindingListener. The valueUnbound method will have flag or code to stop running query.
    2. Instantiate this in your search page, and add it into session.
    3. Add javascript in search JSP to access another(dummy) JSP on unload event(to catch browser closing) something like:
    function unload()
    location.href = "/kill.jsp";
    4. The code in dummy JSP will remove the object from session, and will fire valueUnbound method.
    Let me know if this helps.
    -Mak

Maybe you are looking for

  • FBL3N....missing tax codes.

    Hi all, in FBL3N report of G/L account Line  Item Display, in the column of tax code, there are some document nos against which no tax code is showing up. I selected the "All Items" option at startup of the transaction with the G/L Account no. What c

  • Display color array then 1 second later display same array with color change

    Hi there, I'm new to LabVIEW and this is my first post. I'm using LabVIEW 9.0.1 Please have a look at this simple program attached below; when I've worked out this part of the program, it will be the starting up sequence of a game the lights need to

  • Satellite P300-20H - HHD upgrade to 1 TByte

    Dear All, I would like to upgrade my internal hard drive from 250 Gbyte to 1 Tbyte. The 1 Terabyte hard drive have the following specifications: Capacity - 1 TB Interface type - Serial ATA-300 Data transfer rate - 300 MBps Spindle speed - 5,400 rpm B

  • WRT160NL - reset/reboot through web interface

    Hello there, Is it possible to reboot / reset the router remotely by using the web interface? On SMC routers that option is available and is of great value. I'm using my WRT160NL with a usb hub (powered) so I can connect 2 hard drives at the same tim

  • Does FOR i IN 1..10 Uses Cursor?

    Hi, Yesterday i was conducting an interview and was asking questions related to cursor. I asked the candidate to explain about Implicit cursor. He gave me an example like this. for i in 1..10 loop end loop; At a first look it felt he was wrong. Becau