Null Poimter

  • Lakshmi Nadig

    Lakshmi Nadig - 2008-10-04

    I get this exception in my application after establishing a connection with YM.

    Exception in thread "Thread-1" java.lang.NullPointerException
        at com.itbs.aimcer.commune.ymsg.YMsgConnection.connectReal(
        at com.itbs.aimcer.commune.ymsg.YMsgConnection$

    What could the problem be?

    • Alex

      Alex - 2008-10-04

      Not sure how old your code is, but I don't see as a valid line of code for this repository.

      What's your ?
      Did you set all the things a connection needs to have to login? Username, password, properties etc?

    • Lakshmi Nadig

      Lakshmi Nadig - 2008-10-05

      that seems to be the the call to connectReal fromt he thread run method in connect().
      Yes, I have set the username , password and the eventHandler. Are there any other properties other than this?

              MessageSupport yconn = new YMsgConnection();

                conn.assignGroupFactory(new GroupImplFactory());
              conn.assignContactFactory(new ContactImplFactory());

    • Alex

      Alex - 2008-10-05

      Unless you overwrote YMsgConnection, there is no way that line 139 blows up. Make sure you are not missing more stack trace lines.

      you also need to assign Properties to each connection.

      • Lakshmi Nadig

        Lakshmi Nadig - 2008-10-07

        No, we have not overridden YMsgConnection. Please point me to some examples/documentation of Connection.setProperties.

        • Alex

          Alex - 2008-10-07

                      final WeatherConnection weather = new WeatherConnection();

          Other setProperties are in:

          LoginPanel is prolly your best choice to see how to create connections from scratch.

    • Lakshmi Nadig

      Lakshmi Nadig - 2008-10-15

      Hey Alex, Thanks for helping out. I checked out the latest sources and recompiled the whole code again. I find that the null pointer exception is becasue the getGroupList implementation in the factory class is returning null.
      1. IS there an example implementation for the GroupImplFactory class?
      2. Is there a default GroupImplFactory class in JClaim taht can be reused if we dont have any specific requirements on this GroupImplFactory class?

      • Alex

        Alex - 2008-10-15

        Um, YES, take a look at the Main class.
        It's all inthere.
        Search for word GroupFactory, I think.

        I just moved those classes out into the bean package, but SVN is having issues (I think they moved the repositories wrong today). So I can't check it in at the moment.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks