Differences between Appletviewer and Browser plugin

Discussion in 'Java' started by Roedy Green, Jul 15, 2007.

  1. Roedy Green

    Roedy Green Guest

    On Sun, 15 Jul 2007 11:21:21 +0000, Daniel Kraft <> wrote,
    quoted or indirectly quoted someone who said :

    >The applet is this one:
    >http://domob.do.funpic.de/klammgolf/turnier.php?id=1


    your invoking code looks like this

    <applet code="eu.domob.klammgolf.player.PlayApplet"
    width="750" height="550"
    archive="java/klammgolf.jar, java/minigolf.jar, java/Piccolo.jar , ,
    , , ">
    <param name="numCourses" value="4" />
    <param name="course0"
    value="bahnen/bahn_1182668925894638649.jar" />
    <param name="course1"
    value="bahnen/bahn_1182668933804355172.jar" />
    <param name="course2"
    value="bahnen/bahn_11826689382141266564.jar" />
    <param name="course3"
    value="bahnen/bahn_1182668944163310470.jar" />
    Du ben&ouml;tigst eine <a href="http://java.sun.com/">Java-VM</a>, um
    Klammgolf
    spielen zu k&ouml;nnen.
    </applet>

    My typical invoking code looks like this:
    <applet class="cmp" code="com.mindprod.wassup.Wassup.class"
    archive="wassup.jar" width="540" height="310" alt="Sorry, you need
    Java to run this Applet">
    </applet>

    Note the .class on the code param. Also there should be no embedded
    spaces in your archive param, just commas. I would get rid of the
    trailing commas.


    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Jul 15, 2007
    #1
    1. Advertising

  2. Roedy Green

    Daniel Kraft Guest

    Hi all,

    first of all, I'm not completely sure whether this is really a good
    group for Java Applet questions -- if not, please point me to another one.

    I've written a Java Applet; my problem is that the very same applet runs
    fine under Sun's appletviewer, but the Browser plugin (Mozilla) of the
    same JDK (1.5.0_06, GNU/Linux) complains that it does not find my Applet
    class.

    What are the differences between appletviewer and the Browser with plug
    in that could make such a thing happen? I'm currently a bit confused by
    this problem...

    The applet is this one:
    http://domob.do.funpic.de/klammgolf/turnier.php?id=1

    # appletviewer http://domob.do.funpic.de/klammgolf/turnier.php?id=1
    works fine, opening this URI in my browser gives me a "broken applet"
    symbol!

    Could this be a problem with caches or something similar?

    Many thanks,
    Daniel

    --
    Got two Dear-Daniel-Instant Messages
    by MSN, associate ICQ with stress --
    so please use good, old E-MAIL!
    Daniel Kraft, Jul 15, 2007
    #2
    1. Advertising

  3. Daniel Kraft wrote:
    ...
    >I've written a Java Applet; my problem is that the very same applet runs
    >fine under Sun's appletviewer, but the Browser plugin (Mozilla) of the
    >same JDK (1.5.0_06, GNU/Linux) complains that it does not find my Applet
    >class.


    FF on Win. running Java 1.6 reports..
    ...
    basic: Exception: java.lang.ClassFormatError: Incompatible
    magic value 1008813135 in class file eu/domob/klammgolf/player/PlayApplet

    >What are the differences between appletviewer and the Browser with plug
    >in that could make such a thing happen?


    The differences between how applets behave in most
    browsers, running most Java versions, with any variety
    of plug-ins installed or security enabled, is slightly
    different in most combinations.

    If one combination (of browser make and version,
    combined with Java version, plug-ins/security) actually
    matched the behaviour of AppletViewer in every way,
    it would be almost purely by accident.

    >...I'm currently a bit confused by
    >this problem...


    Yes - applets can be that way - epsecially with every
    browser reporting the problem in slightly different ways.
    An earlier test with IE showed an odd applet loaded
    (odd in the sense that nothing seemed to be in the
    center of the GUI, just a title bar and a bar on the lower
    right), but when I clicked something that attempted to
    reload the page, IE 'froze and crashed'.

    >Could this be a problem with caches or something similar?


    Why not launch that applet using web start?*
    It uses applet viewer, and removes a lot of the
    browser based variables. At least the error
    messages, if any, should be consistent!

    * e.g. <http://www.physci.org/jws/#jtest>

    --
    Andrew Thompson
    http://www.athompson.info/andrew/

    Message posted via JavaKB.com
    http://www.javakb.com/Uwe/Forums.aspx/java-general/200707/1
    Andrew Thompson, Jul 15, 2007
    #3
  4. Roedy Green

    Daniel Kraft Guest

    >> The applet is this one:
    >> http://domob.do.funpic.de/klammgolf/turnier.php?id=1

    >
    > your invoking code looks like this
    >
    > <applet code="eu.domob.klammgolf.player.PlayApplet"
    > width="750" height="550"
    > archive="java/klammgolf.jar, java/minigolf.jar, java/Piccolo.jar , ,
    > , , ">
    > <param name="numCourses" value="4" />
    > <param name="course0"
    > value="bahnen/bahn_1182668925894638649.jar" />
    > <param name="course1"
    > value="bahnen/bahn_1182668933804355172.jar" />
    > <param name="course2"
    > value="bahnen/bahn_11826689382141266564.jar" />
    > <param name="course3"
    > value="bahnen/bahn_1182668944163310470.jar" />
    > Du ben&ouml;tigst eine <a href="http://java.sun.com/">Java-VM</a>, um
    > Klammgolf
    > spielen zu k&ouml;nnen.
    > </applet>
    >
    > My typical invoking code looks like this:
    > <applet class="cmp" code="com.mindprod.wassup.Wassup.class"
    > archive="wassup.jar" width="540" height="310" alt="Sorry, you need
    > Java to run this Applet">
    > </applet>
    >
    > Note the .class on the code param. Also there should be no embedded
    > spaces in your archive param, just commas. I would get rid of the
    > trailing commas.


    Thanks for your reply, however, the very same invocation code used to
    work with a previous version of my Java code (unfortunatelly I can't
    trace down which change made it break), the main difference between
    these versions is that I added a Frame which displays what prior was the
    Applet's content and another Applet into the same Jar which is not
    referenced from this file.

    I changed my code according to your suggestions but I still get this
    error from within the browser:

    load: class eu.domob.klammgolf.player.PlayApplet.class not found.
    java.lang.ClassNotFoundException: eu.domob.klammgolf.player.PlayApplet.class
    at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:168)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:119)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:599)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:721)
    at sun.plugin.AppletViewer.createApplet(AppletViewer.java:1757)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:650)
    at sun.applet.AppletPanel.run(AppletPanel.java:324)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.io.IOException: open HTTP connection failed.
    at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:271)
    at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:44)
    at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:158)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:155)
    ... 9 more
    Exception in thread "Thread-5" java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(GrayBoxPainter.java:153)
    at sun.plugin.AppletViewer.showAppletException(AppletViewer.java:1928)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:655)
    at sun.applet.AppletPanel.run(AppletPanel.java:324)
    at java.lang.Thread.run(Thread.java:595)
    java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(GrayBoxPainter.java:153)
    at sun.plugin.AppletViewer.showAppletStatus(AppletViewer.java:1861)
    at sun.applet.AppletPanel.run(AppletPanel.java:369)
    at java.lang.Thread.run(Thread.java:595)
    Exception in thread "thread
    applet-eu.domob.klammgolf.player.PlayApplet.class"
    java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(GrayBoxPainter.java:153)
    at sun.plugin.AppletViewer.showAppletException(AppletViewer.java:1928)
    at sun.applet.AppletPanel.run(AppletPanel.java:533)
    at java.lang.Thread.run(Thread.java:595)

    I've really no clue at all why something would work inside appletviewer
    and not the browser. But the problem must be some difference in how
    they resolve or download classes, must it not?

    Cheers,
    Daniel

    --
    Got two Dear-Daniel-Instant Messages
    by MSN, associate ICQ with stress --
    so please use good, old E-MAIL!
    Daniel Kraft, Jul 15, 2007
    #4
  5. Daniel Kraft schrieb:
    >
    > I changed my code according to your suggestions but I still get this
    > error from within the browser:
    >
    > load: class eu.domob.klammgolf.player.PlayApplet.class not found.
    > java.lang.ClassNotFoundException:
    > eu.domob.klammgolf.player.PlayApplet.class
    > at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:168)

    [...]
    >
    > I've really no clue at all why something would work inside appletviewer
    > and not the browser. But the problem must be some difference in how
    > they resolve or download classes, must it not?


    I visited your page
    <http://domob.do.funpic.de/klammgolf/turnier.php?id=1> with my browser
    (Mozilla/4.0 (Windows XP 5.1) with Java Plug-in 1.6.0_01) and also got
    the "applet broken" icon. But in my Java console I have the output:

    java.lang.ClassFormatError: Incompatible magic value 1008813135 in class
    file eu/domob/klammgolf/player/PlayApplet
    at java.lang.ClassLoader.defineClass1(Native Method)
    ...

    Note that this exception is about the PlayApplet class being
    *corrupted*, not about PlayApplet class being *not found*.

    When looking into your jar file
    <http://domob.do.funpic.de/klammgolf/java/klammgolf.jar> with WinZip,
    I see that it contains all class files (including PlayApplet.class)
    *two* times. You should fix this first.

    --
    Thomas
    Thomas Fritsch, Jul 15, 2007
    #5
  6. Roedy Green

    Roedy Green Guest

    On Sun, 15 Jul 2007 13:31:03 +0000, Daniel Kraft <> wrote,
    quoted or indirectly quoted someone who said :

    >Caused by: java.io.IOException: open HTTP connection failed.


    Sounds like it might be having trouble reading the jars. Are they in
    the same directory as the *.html file that invoked them?

    Is your firewall blocking *.jar file downloads?
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Jul 15, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Bradley
    Replies:
    2
    Views:
    330
    Kevin Spencer
    Jul 16, 2003
  2. Momo
    Replies:
    4
    Views:
    362
  3. jeffbruce
    Replies:
    1
    Views:
    2,251
    travishein
    Aug 22, 2008
  4. Home_Job_opportunity
    Replies:
    0
    Views:
    485
    Home_Job_opportunity
    Jan 8, 2009
  5. Home_Job_opportunity
    Replies:
    0
    Views:
    569
    Home_Job_opportunity
    Jan 14, 2009
Loading...

Share This Page