Menu

#93 NullPointerException when getting connection

open
Steve
API (125)
5
2012-12-15
2010-05-24
Elsa B
No

thrown by getSessionManager() :

com.vmware.vim25.mo.ServiceInstance.getSessionManager(Unknown Source)
com.vmware.vim25.mo.ServiceInstance.<init>(Unknown Source)
com.vmware.vim25.mo.ServiceInstance.<init>(Unknown Source)

Discussion

  • Steve

    Steve - 2010-05-24

    Hi Elsa,

    Thanks for reporting this. Do you have a stack that I can see the line numbers? Are you taling to ESX or vCenter? Is this issue new? Thanks!

    -Steve

     
  • Elsa B

    Elsa B - 2010-05-27

    Hi Steve, I haven't got a line number but I did look at the code and see that in getSessionManager() there is a line getServiceContent().getSessionManager() but my understanding is that getServiceContent() could return null and does in our case thus causing the nullPointerException. I am not sure why getServiceContent() return null, is it when the VC refuses to respond or what other conditions might cause a null return? I am not that familiar with the functioning of the soap mechanism to fully understand that... elsa

     
  • Steve

    Steve - 2010-05-27

    Thanks Elsa,

    Do you get null exception while calling ohter get*Manager() methods? Also what happens if you you call currentTime() method on ServiceInstance? Thanks!

    -Steve

    -Steve

     
  • Steve

    Steve - 2010-07-21

    Hi Elsa,

    Is it still a problem? Please let me know. I am now cleaning up the bugs for 2.1 GA.

    -Steve

     
  • Anonymous

    Anonymous - 2010-07-21

    I am using vijava2120100715.jar. If VC url is not correct i.e. VC is not running at the url used to login, it throws NPE.

    Code:
    ServiceInstance serviceInstance = new ServiceInstance(new URL(url), username, password, true);

    Stack trace:
    java.lang.NullPointerException
    at com.vmware.vim25.mo.ServiceInstance.<init>(ServiceInstance.java:86)
    at com.vmware.vim25.mo.ServiceInstance.<init>(ServiceInstance.java:69)
    ....