Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Java NullPointer Exception in Server chat program

  1. #1
    Junior Member
    Join Date
    May 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Java NullPointer Exception in Server chat program

    Hi i am having problem with my java chat. when i go to load it i get a NullPointerException i know what code is causeing the problem but im not quite sure what it does can u explain to me please. Ive been looking at this error trying to fix it for a few weeks now and its annoying. Thank you for any help. Here is the code that causes the NullPointerException

         public static final void j()
        {
            try
            {
                String as[] = {
                    "ar", "aq", "ao"
                };
                Class class1;
                Object obj = (class1 = Class.forName((new StringBuilder()).append(com/diginet/oldchat/server/g.getPackage().getName()).append(".an").toString())).getMethod(as[0], new Class[0]);
                if(q)
                {
                    obj = ((Method) (obj)).invoke(null, new Object[0]);
                    Class aclass[];
                    (aclass = new Class[1])[0] = java/lang/String;
                    Object aobj[];
                    (aobj = new Object[1])[0] = obj;
                    for(int i1 = 1; i1 < as.length; i1++)
                    {
                        Method method;
                        (method = class1.getMethod(as[i1], aclass)).invoke(null, aobj);
                    }
     
                    q = false;
                }
                return;
            }
            catch(Exception _ex)
            {
                ChatServer.q_java_util_Vector_static_fld = new Vector();
            }
            ChatServer.q_com_diginet_digichat_common_SerialInfo_static_fld = null;
        }

    If part of the program uses
     com.diginet.oldchat.server.g.j();
    wich will load the code above it always gives NullPointerException and then wont continue loading what is wrong? Please help me

    Oh and by the way this is my first post on this forum and i found it quite easy to use!


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 287 Times in 225 Posts
    Blog Entries
    4

    Default Re: Java Server Chat, Help Needed PLEASE!! - NullPointerException

    Sorry but I have no idea what is causing this exception

    I am looking at the code within the other thread too but this doesn't help me either!
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

    Looking for a Java job? Visit - Java Programming Careers

Similar Threads

  1. Replies: 16
    Last Post: August 27th, 2010, 04:30 PM
  2. Replies: 10
    Last Post: May 8th, 2009, 11:49 AM
  3. Replies: 1
    Last Post: April 20th, 2009, 12:17 PM
  4. Java/J2EE with Linus/Unix
    By markthomas20 in forum Paid Java Projects
    Replies: 2
    Last Post: November 5th, 2008, 09:19 AM
  5. Replies: 4
    Last Post: May 22nd, 2008, 11:59 AM