CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2011
    Posts
    3

    Next Generation Plugin Problem

    Hi,

    I have modified a simple java applet that displays the version of java the user has and if it is compatible with our system. For the system we recommend 1.6.0_18 because we have problems with some versions of 1.6.0 but technically 1.4.2 is the minimum. My applet and website is not part of the system, it is just to display info about a users browser setting so we can gather data on what version of java works the best and what settings work the best.

    Problem is we recommend that the "Next Generation plugin" be turned off. The applet works fine when "Next Generation plugin" is on, but when its off the applet doesn't load correctly in IE 6,7, and 8. It works fine in firefox 3.6, 4, 5 no matter what.

    Here is the error I get in the java console.

    ERROR: unexpectedly couldn't get the codebase

    here is my code and compile instructions.

    javac -target 1.4 -source 1.4 JavaVersionDisplayApplet.java

    import java.applet.*;
    import java.awt.*;
    public class JavaVersionDisplayApplet extends Applet
    {
    private Label m_labVersionVendor;
    private Label m_labUpdate;
    private String javaVersion;
    private String javaUpdate;
    private String delims="_";
    private String bad_v= " ";
    public JavaVersionDisplayApplet() //constructor
    {
    Color colFrameBackground = Color.green;
    Color colFrameBackground2 = Color.red;

    javaVersion = System.getProperty("java.version");
    String[] tokens = javaVersion.split(delims);
    javaVersion = tokens[0];
    javaUpdate = tokens[1];
    String[] tokens2 = javaVersion.split("\\.");

    int j_update = Integer.parseInt(javaUpdate.trim());
    int j_vers1 = Integer.parseInt(tokens2[0].trim());
    int j_vers2 = Integer.parseInt(tokens2[1].trim());
    int j_vers3 = Integer.parseInt(tokens2[2].trim());

    if( j_vers1 == 1 && j_vers2 >= 4)
    {
    if (j_update != 10 && j_update != 11 && j_update != 12 && j_update != 13 && j_update != 14 && j_update != 19 && j_update != 20 && j_update != 21)
    {
    this.setBackground(colFrameBackground);
    }
    else
    {
    this.setBackground(colFrameBackground2);
    bad_v = " ";
    }
    }
    else
    {
    this.setBackground(colFrameBackground2);
    bad_v = "Incompatible version of Java. 1.4.2 is minimum";
    }
    m_labVersionVendor = new Label ( "Version : " + javaVersion );
    m_labUpdate = new Label ( "Update : " + javaUpdate + bad_v);
    this.add(m_labVersionVendor);
    this.add(m_labUpdate);
    }
    }


    Here is the html with the applet

    <applet code="JavaVersionDisplayApplet.class" height="60" width="120"></applet>

    Any help would be awesome.

    thanks

  2. #2
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: Next Generation Plugin Problem

    I don't know if it matches your problem exactly, but there seems to be an IE7/JRE interation bug that gives this error when running applets - see the Java Bug Database : 6694620 - a suggested workaround is described at the end of the comments.

    In theory, there is no difference between theory and practice, but not in practice...
    Anon.
    Please use &#91;CODE]...your code here...&#91;/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

  3. #3
    Join Date
    Jul 2011
    Posts
    3

    Re: Next Generation Plugin Problem

    i took a look, but didn't really find anything. The problem is happening on XP. I was wondering if the JDK im using could be causing the problem. I'm using JDK 6 update 25

  4. #4
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: Next Generation Plugin Problem

    Possibly. I can only suggest you search online for that error message. If others have encountered the same problem, their discussions may be out there.

    One can think effectively only when one is willing to endure suspense and to undergo the trouble of searching...
    J. Dewey
    Please use &#91;CODE]...your code here...&#91;/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

  5. #5
    Join Date
    Jul 2011
    Posts
    3

    Talking Re: Next Generation Plugin Problem

    I figured out my problem. I was using MooTools 1.3.2 which has a variable call this.Document which is interfering with the java applet. Since javascript is case sensitive this.document doesn't cause a conflict. For some reason that variable in javascript effects java applets. Just found some one posting a bug report about it by pure chance. I switched to MooTools 1.2.5 which doesn't have the variable and it works.

  6. #6
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: Next Generation Plugin Problem

    Glad you fixed it. Thanks for getting back to us

    All truths are easy to understand once they are discovered; the point is to discover them...
    G. Galilie
    Please use &#91;CODE]...your code here...&#91;/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured