I think I'm having some problems with Java, please help? ^_^

Discussion in 'Java' started by selina.andor, Mar 23, 2006.

  1. selina.andor

    selina.andor Guest

    Hi!

    I'm not a java developer or a talented computer person, so I apologize
    in advance if I make an idiot out of myself. ^_^; I tend to do it a
    lot, afterall. I found a Japanese chatroom that I would really enjoy
    talking in (a paint chat, in specific) that runs off of Java. However,
    while the applet will load, it will stay loaded for about a minute and
    then the page will refresh and I'll be back to the sign in page.

    In my Java console, it says:
    java.lang.NullPointerException
    at paintchat_client.Data.run_out(Data.java)
    at paintchat_client.Data.run(Data.java)
    at java.lang.Thread.run(Unknown Source)
    java.lang.NullPointerException
    at paintchat.MgLine.getData(MgLine.java)
    at paintchat_client.Data.m_odirect(Data.java)
    at paintchat_client.Data.m_exit(Data.java)
    at paintchat_client.Data.run_out(Data.java)
    at paintchat_client.Data.run(Data.java)
    at java.lang.Thread.run(Unknown Source)
    java.lang.InterruptedException: sleep interrupted
    at java.lang.Thread.sleep(Native Method)
    at paintchat_client.Data.run_read(Data.java)
    at paintchat_client.Data.run(Data.java)
    at java.lang.Thread.run(Unknown Source)

    That always pops up right as it refreshes. The website in question is:
    http://220.210.147.184/ (The java applet I'm talking about is initiated
    by clicking either "Paint Chat" buttons).

    Thank you for reading over this and I appreciate greatly any help that
    anyone has to offer!
     
    selina.andor, Mar 23, 2006
    #1
    1. Advertisements

  2. selina.andor

    Roedy Green Guest

    THis is a problem for the author of the program, not you to solve.
    However, you can help by at least ensuring you have the latest Java
    installed. See http://mindprod.com/jgloss/installingjava.html
     
    Roedy Green, Mar 23, 2006
    #2
    1. Advertisements

  3. selina.andor

    hiwa Guest

    ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸:
    It's just a broken software, isn't it?
     
    hiwa, Mar 23, 2006
    #3
  4. selina.andor

    Seri Guest

    Thanks for the reply. I do have the latest Java. The only thing that
    led me to believe that it was maybe a mishap on my side was because the
    chatroom has 10 or so people in it, but they're all Japanese. Maybe
    it's just a problem with the languages clashing ^_^;
     
    Seri, Mar 23, 2006
    #4
  5. selina.andor

    Tom Leylan Guest

    Interesting spot I took a look It loads and runs fine for me.

    You might try a complete uninstall of Java and then a reinstall if you
    didn't do it that way.
     
    Tom Leylan, Mar 23, 2006
    #5
  6. selina.andor

    Chris Uppal Guest

    I don't suppose this will help much, but it appears that the chatroom is using
    rather an old version of the "PaintChat" applet (2.51) when other sites using
    it seem to be up to 3.35b.

    Unfortunately, I haven't been able to find where PaintChat comes from -- or
    maybe I did find it, but didn't realise it was the website I was looking for
    because I can't read Japanese...

    I did find a suggestion (in the FAQ section of another website that uses
    PaintChat) that it can disconnect spontaneously if your machine is heavily
    loaded, or if there is a lot of other network activity at the same time.

    -- chris
     
    Chris Uppal, Mar 23, 2006
    #6
  7. selina.andor

    Oliver Wong Guest

    It looks like there's more than one software called "PaintChat". The one
    that the OP is interested in seems to have its homepage at
    http://shichan.jp/ I was unable to find the source code for the client, so I
    tried decompiling the source with JAD.

    The code structure for the relevant method is:

    <pseudocode>
    private void run_out() {
    try {
    if (stm_out != null) {
    //do some stuff.
    l3 = System.currentTimeMillis();
    }
    } catch (Exception e) {/*Swallow exception*/}
    try {
    if (stm_write != null) {
    //do some stuff.
    l2 = System.currentTimeMillis();
    }
    } catch (Exception e) {/*Swallow exception*/}
    long l1 = System.currentTimeMillis();
    if(l1 - l3 >= 45000L) {
    stm_out.write(abyte0);
    stm_out.flush();
    }
    if(l1 - l2 >= 45000L) {
    stm_write.write(abyte1);
    stm_write.flush();
    }
    }
    </pseudocode>

    In other words, it looks the author checked against null in the earlier
    parts of the code, but then neglected to do so in later parts, hence the
    NullPointerException.

    The later parts of the code seem to only trigger when a time-out
    condition occurs (i.e. 45 seconds have elapsed).

    Combined with the OP's description of "It'll stay loaded for about a
    minute", I'm pretty confident this is the culprit.

    As Chris has mentioned, the site that the OP linked to uses version 2.51
    of the app, and 3.35b is available. I decompiled 3.35b just for kicks, and
    it looks like in that version they've removed the "run_out()" method
    completely.

    The the OP, if you can convince the web administrator at
    http://220.210.147.184/ to upgrade to 3.35b, that might fix your problems.
    Otherwise, what you could *try* to do is download the 3.35b stand-alone
    client, and use that to connect to the server at http://220.210.147.184/,
    but that might not work: It's possible version 2.51 and 3.35b use a
    completly different set of protocols.

    - Oliver
     
    Oliver Wong, Mar 24, 2006
    #7
  8. selina.andor

    Seri Guest

    I appreciate all the thought you put into your post and going to the
    trouble of looking at the code for me! That answers my question
    completely. ^_^ I'll try downloading the standalone progam, and if it
    doesn't work, I'll just keep searching for a new paint chat that uses
    the newer client.
     
    Seri, Mar 24, 2006
    #8
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.