3 Replies Latest reply: May 9, 2012 4:13 PM by Michael Ferrante-Oracle RSS

    JVM closing with JRE 1.6.0.31

    933793
      I have an applet embedded in a html page (using the object tag) referring to JRE 1.6.0.25 (32 bit)
      The applet uses a JNI dll compiled with x86.

      Recently it was updated to run with JRE 1.6.0.31 (32 bit). The jar files are now being compiled with JDK 1.6.0.31
      Here is the object tag
      <!--[if IE]>
      <object
      name="myApplet"
      classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
      codebase="http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab#Version=1,6,0,31"
      width="100%"
      height="90%">
      <![endif]-->

      <!--[if !IE]>
      <object
      id="myApplet"
      name="myApplet"
      type="application/x-java-applet;version=1.6"
      width="800"
      height="600">
      <!--<![endif]-->

      I perform the following steps:
      Launch the html page that loads the applet.
      The applet loads fine
      Refresh the page (F5 or clicking the Refresh icon)
      The applet loads as expected, but within about 10 seconds the Java console closes.

      (The Java console does not have any exceptions/ error like messages when logging and tracing are turned on via Java Control Panel-->Advanced)

      This problem does not happen on a system that has JRE 1.6.0.25
      The problem does not happen in Firefox 12. It does happen in IE 8, IE9 and Chrome.

      Any suggestions on what might be wrong or how to debug would be appreciated.
        • 1. Re: JVM closing with JRE 1.6.0.31
          Michael Ferrante-Oracle
          Can you provide a little clarification? You said: "...within about 10 seconds the Java console closes...". What do you mean the console closes? Did you actually mean that the applet crashed or actually that you had the console open and it closed, but the applet continued to run? Or something else. Also, have you tested this with a different applet? There are some simple applets within the Oracle webpages as well as others on the Internet. Here is a simple one:

          <blockquote>http://docs.oracle.com/javase/tutorial/deployment/applet/deployingApplet.html</blockquote>
          Also, your current codebase line will not likely do what you think it will. As you have it now, if a JRE is not found on the machine, 1.6.0_25 would be installed. Is this what you want?

          <blockquote>codebase="http://java.sun.com/update/1.6.0/jinstall-6-windows-i586.cab#Version=1,6,0,31"</blockquote>
          If what you want is to install U31 then the entry should look more like this:

          <blockquote>codebase="http://java.sun.com/update/1.6.0/jinstall-6u31-windows-i586.cab#Version=1,6,0,31"</blockquote>
          And be aware that 1.6.0_32 is the latest version.

          More info about the auto install files can be found here:
          <blockquote>http://www.oracle.com/technetwork/java/javase/autodownload-140472.html</blockquote>
          • 2. Re: JVM closing with JRE 1.6.0.31
            933793
            I have the Java console open and after 10 seconds it closes and the applet becomes unresponsive. Usually when an applet crashes, some error messages show up in the console before it closes. That does not appear to happen in this case.
            If I load a webpage with an applet (http://java.sun.com/applets/jdk/1.4/demo/applets/Fractal/example1.html) and then move to a non-applet webpage, and have the Java console up, it stays up (alive) for about a minute before it closes. In the case of my applet it closes much faster.
            When I refresh, the second instance of the applet might be starting in the same process as the first process which is in the middle of closing (I am new to Java and JNI, so I might be using the wrong terminology). But with JRE 1.6.0.25 I was not seeing the crash on refresh. It manifested itself with the update to JRE 1.6.0.31

            I did realize the codebase was wrong. This is what I have now:

            <!--[if IE 9]>
            <object
            id="myApplet"
            name="myApplet"
            classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
            codebase="http://java.sun.com/update/1.6.0/jinstall-6u31-windows-i586.cab"
            type="application/x-java-applet;version=1.6"
            width="800"
            height="600">
            <![endif]-->
            <!--[if IE 8]>
            <object
            id="myApplet"
            name="myApplet"
            classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
            codebase="http://java.sun.com/update/1.6.0/jinstall-6u31-windows-i586.cab"
            type="application/x-java-applet;version=1.6"
            width="800"
            height="600">
            <![endif]-->
            <!--[if IE 7]>
            <object
            id="myApplet"
            name="myApplet"
            classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
            codebase="http://java.sun.com/update/1.6.0/jinstall-6u31-windows-i586.cab"
                 type="application/x-java-applet;version=1.6"
            width="100%"
            height="90%">
            <![endif]-->

            <![if !IE]>
            <object
            id="myApplet"
            name="myApplet"
            type="application/x-java-applet;version=1.6"
            width="800"
            height="600">
            <![endif]>
            • 3. Re: JVM closing with JRE 1.6.0.31
              Michael Ferrante-Oracle
              This may suggest a problem in your code. However, I would recommend trying two things:

              TEST 1:
              <blockquote>
              1. Close ALL open browsers
              2. Open the Java Control Panel (found in the Windows Control Panel)
              3. On the General tab, click on Settings... > Delete Files.... > OK This will clear the JRE cache
              4. Retest
              </blockquote>
              If it still fails, continue...

              TEST 2:
              <blockquote>
              For testing purposes...
              1. Close ALL open browsers
              2. Uninstall ALL installed JREs
              3. Download and install 1.6.0_32
              4. Retest
              </blockquote>
              If it still fails, continue...

              TEST 3:
              If you have a requirement to use JRE 6U31, close all open browser, uninstall U32, then reinstall U31
              <blockquote>
              1. Close ALL open browser
              2. Open the Java Control Panel (found in the Windows Control Panel)
              3. On the Advanced tab, expand Debugging and check "Enable tracing" and "Show applet lifecycle exceptions"
              4 Click OK to accept the changes and exit the Control Panel.
              5. Retest</blockquote>
              After the failure occurs, look in the the following directory for the resulting .trace file:

              On WinXP and older:
              <blockquote>C:\Documents and Settings\<USER NAME>\Application Data\Sun\Java\Deployment\log\</blockquote>
              On Vista and newer:
              <blockquote>C:\Users\<USER NAME>\AppData\LocalLow\Sun\Java\Deployment\log</blockquote>
              Open the file in a text editor. Carefully review it as it may offer a clue.

              One thing to consider is that you mentioned using a dll. If you compiled the dll for 32bit, you must be using a 32bit browser and JRE. However, the reverse is also true. If you are using a 64bit dll, the browser and JRE must be 64.

              .