Results 1 to 8 of 8
  1. #1
    phu004 is offline Member
    Join Date
    Nov 2012
    Posts
    6
    Rep Power
    0

    Default What's wrong with my applet?

    Hi guys,

    I have an applet stored on a free web hosting website. The problem is, when you try to load it, it pauses for like 30 seconds before the the applet starts. I am not sure what is is doing during that period, it doesn't seem to be running any java code based on the java console output or downloading any applet files since the pause happens after the java download splash sceen.

    Any one would like to help me debug this weird behavior please take a look at my applet at [Moderator edit: link removed]

    Thanks in advance.
    Pan


    P.S I just hosted the same applet on my local machine ( [Moderator edit: link removed] ) , and it doesn't have the pause at all.
    Last edited by DarrylBurke; 11-21-2012 at 05:28 AM. Reason: Removed links

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,453
    Rep Power
    20

    Default Re: What's wrong with my applet?

    Please go through the Forum Rules -- particularly the third paragraph.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    phu004 is offline Member
    Join Date
    Nov 2012
    Posts
    6
    Rep Power
    0

    Default Re: What's wrong with my applet?

    I wasn't trying to put an advertisement here. It's just an easier way to show others the issue i was talking about.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,453
    Rep Power
    20

    Default Re: What's wrong with my applet?

    Seeing the issue without any knowledge of the code doesn't facilitate understanding the possible cause. To get better help sooner, post a SSCCE (Short, Self Contained, Correct (Compilable), Example) that demonstrates the problem.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    phu004 is offline Member
    Join Date
    Nov 2012
    Posts
    6
    Rep Power
    0

    Default Re: What's wrong with my applet?

    My applet uses 2 files, a jar file (2.2MB) which contains all the class files and some resource files; a simple html file which tells the browser to load the jar file. The 2 files were uploaded to the same folder on the website server.

    The problem is when I run the applet by visiting the html file on the website server, the applet didn't start until around 30 seconds after the java applet loading screen. No error message in the java console,

    I am sure during that 30 seconds:
    1. it's not running any java code. Because I included a print statement in the first line of init() method, and I didn't see any printout message on the console during that period.
    2. It's not downloading the jar file, because the pause was after the java applet loading screen.

    my html file contains the following:

    XML Code:
    <html>
    <body>
    <center>
    <applet code=main.class codebase="." archive="church.jar" width="640" height="480" >
    </applet>
    </center>
    </body>
    </html>
    Any suggestion on this weird behavior is much appreciated!
    Last edited by phu004; 11-22-2012 at 01:22 AM.

  6. #6
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default Re: What's wrong with my applet?

    Quote Originally Posted by phu004 View Post
    Because I included a print statement in the first line of init() method, and I didn't see any printout message on the console during that period.
    If a jar contains several classes you should have a manifest.txt file inside the jar with the line

    Main-Class: ClassNameWithEntryPoint

    and the name of the class (without extension .class) that should be used as entry point. I suppose you couldn't see you print statements because the init() was never started. If you start the applet inside the browser and inside the applet you invoke System.out.println() the output is send to the java.Console. To see the java console go to Internet Options -> Advanced -> Section Java and then check the Show Java Console. Close the browser and restart it again. You can also start your applet locally with:

    appletviewer yourhtml.html

    In this case the output is send to your os-console.

    About your performace problem I can't tell you nothing, bacause the problem could be the network or the server or something else.

  7. #7
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,453
    Rep Power
    20

    Default Re: What's wrong with my applet?

    Quote Originally Posted by j2me64 View Post
    If a jar contains several classes you should have a manifest.txt file inside the jar with the line

    Main-Class: ClassNameWithEntryPoint

    and the name of the class (without extension .class) that should be used as entry point.
    That isn't needed for a jar'ed Applet. The HTML tag identifies the class to be launched.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  8. #8
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default Re: What's wrong with my applet?

    Quote Originally Posted by DarrylBurke View Post
    That isn't needed for a jar'ed Applet. The HTML tag identifies the class to be launched.
    I had a blackout!

Similar Threads

  1. Replies: 4
    Last Post: 06-11-2013, 02:37 AM
  2. I can't find anything wrong with this but somehow it's wrong.
    By Biscuit Tickler in forum New To Java
    Replies: 2
    Last Post: 09-12-2012, 10:28 PM
  3. What's wrong with this Applet?
    By lsaffre in forum New To Java
    Replies: 4
    Last Post: 09-16-2011, 06:55 AM
  4. Beginner. What's wrong in my applet declaration?
    By rforte in forum New To Java
    Replies: 4
    Last Post: 04-16-2010, 12:01 PM
  5. What's wrong with this applet?
    By Arnold in forum New To Java
    Replies: 9
    Last Post: 11-22-2009, 06:21 PM

Posting Permissions

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