2010-06-27 34 views
0

我有一个小问题,我有我的SIP客户端工作,并且我改变了代码的结构。我保留了以前的SIP对象的创建过程,但现在它不起作用。发起SIP会话/ getClientTransaction(请求)问题抛出NullPointerException

我不断收到:在gov.nist.javax.sip.SipProviderImpl.getNewClientTransaction(SipProviderImpl.java:285)

显示java.lang.NullPointerException

并没有这样的错误没有参考在文档中......这是什么意思?

这里是SIP协议的实例代码:

 sipFactory.setPathName(host); 
     sipFactory.resetFactory(); 
     sipStack = sipFactory.createSipStack(getProperties()); 
     String address = Inet4Address.getLocalHost().getHostAddress(); 
     sipFactory.createHeaderFactory(); 
     sipFactory.createAddressFactory(); 
     sipFactory.createMessageFactory(); 

     udpPoint = sipStack.createListeningPoint(address, SIPPort, SIPConstants.UDP); 
     udpSipProvider = sipStack.createSipProvider(udpPoint); 
     udpSipProvider.addSipListener(this); 

     tcpPoint = sipStack.createListeningPoint(address, SIPPort, SIPConstants.TCP); 
     tcpSipProvider = sipStack.createSipProvider(tcpPoint); 
     tcpSipProvider.addSipListener(this); 

     sipStack.start(); 
     setSessionState(SipSessionState.Connected); 

任何帮助,请?

亚当。

回答

0

WWWWWWWWWWWOOOOOOOOOOOWWWWWWWWWWWWW

如果有人曾经猜到这一点,我会吃我的笔记本电脑....

在第一个项目

我用的是耆那教-SIP 1.2 并在新的一个我使用1.2.1

大问题,在1.2,据我所知,request.getMethod()返回Cseq头的方法的情况下,我请勿使用request.setMethod(方法)的

虽然在1.2.1,如果不设置request.setMethod(方法),所述request.getMethod()方法返回null。

这是我的错误...

现在当你读到这,请表扬什么的...我很沮丧,我现在坐在这个开溜4小时。该死的。

亚当。

+0

我还是不敢相信这是错误......非常深入的调试! – TacB0sS 2010-06-28 21:05:27