Internal rpc error (error code:2).  Please help.

Our Oracle database is on Solaris 9. When we do stress testing on database and server. We have got this error message.
Monitor name :UNIX Resources. Internal rpc error (error code:2).
Hint: Check that RPC on this machine is up and running. Check that rstat daemon
on this machine is up and running (use rpcinfo utility for this verification).
Details: RPC: RPC call failed.
RPC-TCP: recv()/recvfrom() failed.
RPC-TCP: Timeout reached. (entry point: Factory::CollectData). [MsgId: MMSG-47197]
The error appears randomly when number of users querying database increases to high number.
Please help me to figure out the reason and solutions. Thanks in advance.

consider the following
not for copying
but for studying working code
to help clarify ideas
import java.io.*;
list items and count of each item
in a list of socks
file has list of socks ...
4
red sock
green sock
blue sock
green sock
the first line is n = count of socks
if no socks match, there are n items
for example : 3 items in ...
3
red sock
blue sock
green sock
if all socks match there is one item
for example : 1 item in ...
3
red sock
red sock
red sock
if socks come in pairs, there are at most n/2 items
for example : 2 items in ...
4
red sock
green sock
red sock
green sock
program does not assume that socks come in pairs !!
public class Socks {
public static void main(String args[]) throws IOException
String[] socks = new String[1000];
int numOfsocks;
String[] item = new String[1000];
int[] count = new int[1000]; // initializes each count to zero
int totalcount = 0;
int i;
int j;
boolean ifound;
FileReader fr = new FileReader("test.txt");
BufferedReader inFile = new BufferedReader(fr);
numOfsocks = Integer.parseInt(inFile.readLine());
for (i = 0; i < numOfsocks; i++)
socks[ i ] = inFile.readLine();
inFile.close();
for (i = 0; i < numOfsocks; i++) {
ifound = false;
for (j = 0; j < totalcount; j++) {
if (socks[ i ].equalsIgnoreCase(item[j])) {
ifound = true;
count[j]++; // increase count for matched item
break; // exit "for j loop"
} // for j
// sock not found so add it to item list ...
if (ifound == false) {
item[totalcount] = socks[ i ];
count[totalcount] = 1;
totalcount++;
} // for i
for (i = 0; i < totalcount; i++)
System.out.println (item[ i ] + ", count = " + count[ i ]);
} // class

Similar Messages

  • Hi.my itunes appear this error ERROE CODE:1009 please help me

    hi.my itunes appear this error ERROE CODE:1009 please help me

    Read my post. I don't know if you're having the same problem but I hope this helps. http://discussions.apple.com/thread.jspa?threadID=1351705&tstart=0
    Message was edited by: Happyfish

  • Error in code: Urgent, Please help, thanks alot

    I'm getting two errors with the following code. The code is supposed to read in a text file with the format
    11
    blue casual
    green athletic
    red athletic
    The first number represents the numbers of socks. The code is supposed to ouput the number of pairs, so if there were 2 red athletic , it would say
    1 matching pair
    1 pair of red athletic
    If possible can someone run my code to see if they can get it to output that, I'm having a hard time doing it.
    here is the code
    import java.io.*;
    public class Socks {
    public static void main(String args[])
    try
         String socks[1000];
    int pairs[500];
    int numOfsocks;
    int i;
    int j;     
    FileReader fr = new FileReader("test.txt");
    BufferedReader inFile = new BufferedReader(fr);
    numOfsocks = Integer.parseInt(inFile.readLine());
    int possiblePairs = numOfsocks/2;
    for(i = 0; i < numOfsocks; i++)
    socks[i] = inFile.readLine();
    for(i = 0; i <= possiblePairs;i++)
         for(j = i; j<=possiblePairs;j++)
         if (socks.equalsIgnoreCase(socks[j]))
              pairs[i] = i++;
    for(i = 0; i <= possiblePairs;i++);
    if(pairs[i] >= 2)
    System.out.println(pairs[i]/2 + " pairs" + socks[i]);
    inFile.close();     
    catch(IOException e){}
              System.out.println("File Not Found or no File Specified");
    --------------------Configuration: Socks - JDK version 1.3.1_04 <Default>--------------------
    C:\Socks\Socks.java:13: ']' expected
         String socks[1000];
    ^
    C:\Socks\Socks.java:14: ']' expected
    int pairs[500];
    ^
    2 errors

    consider the following
    not for copying
    but for studying working code
    to help clarify ideas
    import java.io.*;
    list items and count of each item
    in a list of socks
    file has list of socks ...
    4
    red sock
    green sock
    blue sock
    green sock
    the first line is n = count of socks
    if no socks match, there are n items
    for example : 3 items in ...
    3
    red sock
    blue sock
    green sock
    if all socks match there is one item
    for example : 1 item in ...
    3
    red sock
    red sock
    red sock
    if socks come in pairs, there are at most n/2 items
    for example : 2 items in ...
    4
    red sock
    green sock
    red sock
    green sock
    program does not assume that socks come in pairs !!
    public class Socks {
    public static void main(String args[]) throws IOException
    String[] socks = new String[1000];
    int numOfsocks;
    String[] item = new String[1000];
    int[] count = new int[1000]; // initializes each count to zero
    int totalcount = 0;
    int i;
    int j;
    boolean ifound;
    FileReader fr = new FileReader("test.txt");
    BufferedReader inFile = new BufferedReader(fr);
    numOfsocks = Integer.parseInt(inFile.readLine());
    for (i = 0; i < numOfsocks; i++)
    socks[ i ] = inFile.readLine();
    inFile.close();
    for (i = 0; i < numOfsocks; i++) {
    ifound = false;
    for (j = 0; j < totalcount; j++) {
    if (socks[ i ].equalsIgnoreCase(item[j])) {
    ifound = true;
    count[j]++; // increase count for matched item
    break; // exit "for j loop"
    } // for j
    // sock not found so add it to item list ...
    if (ifound == false) {
    item[totalcount] = socks[ i ];
    count[totalcount] = 1;
    totalcount++;
    } // for i
    for (i = 0; i < totalcount; i++)
    System.out.println (item[ i ] + ", count = " + count[ i ]);
    } // class

  • Error in code..please help

    Hi,
    I'm writing a SIP messaging klient and i am having problem with connecting the client to my SIP-server (OpenSER)
    javax.sip.InvalidArgumentException: 300:[email protected]: 300:[email protected]
    at gov.nist.javax.sip.SipStackImpl.createListeningPoint(SipStackImpl.java:645)
    at sipTrade.createProvider(sip.java:274)
    at sipTrade.main(sip.java:299)
    Caused by: java.net.UnknownHostException: 300:[email protected]: 300:[email protected]
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getAllByName(Unknown Source)
    at java.net.InetAddress.getByName(Unknown Source)
    at gov.nist.javax.sip.SipStackImpl.createListeningPoint(SipStackImpl.java:625)
    ... 2 more
    import java.io.*;
    import javax.sip.*;
    import javax.sip.address.*;
    import javax.sip.header.*;
    import javax.sip.message.*;
    import java.util.*;
    public class sip implements SipListener {
         private static AddressFactory addressFactory;
         private static MessageFactory messageFactory;
         private static HeaderFactory headerFactory;
         private static SipStack sipStack;
         private int port;
         protected SipProvider udpProvider;
         protected Dialog dialog;
         protected int notifyCount = 0;
         protected final String serverIP = "300:[email protected]";
         class MyEventSource implements Runnable {
              private sipTrade st;
              private EventHeader eventHeader;
              public MyEventSource(sipTrade notifier, EventHeader eventHeader ) {
                   this.st = notifier;
                   this.eventHeader = eventHeader;
              public void run() {
                   try {
                        for (int i = 0; i < 100; i++) {
                             Thread.sleep(100);
                             Request request = this.st.dialog.createRequest(Request.NOTIFY);
                             SubscriptionStateHeader subscriptionState = headerFactory.createSubscriptionStateHeader(SubscriptionStateHeader.ACTIVE);
                             request.addHeader(subscriptionState);
                             request.addHeader(eventHeader);
                             // Lets mark our Contact
                             ((SipURI)dialog.getLocalParty().getURI()).setParameter("id","not2");
                             ClientTransaction ct = udpProvider.getNewClientTransaction(request);
                             System.out.println("NOTIFY Branch ID "+((ViaHeader)request.getHeader(ViaHeader.NAME)).getParameter("branch"));
                             this.st.dialog.sendRequest(ct);
                             System.out.println("Dialog " + dialog);
                             System.out.println("Dialog state after active NOTIFY: " + dialog.getState());
                             synchronized (sipTrade.this) {
                             notifyCount ++;
                   } catch (Throwable e) {
                        e.printStackTrace();
         private static void usage() {
              System.exit(0);
         public void processRequest(RequestEvent requestEvent) {
              Request request = requestEvent.getRequest();
              ServerTransaction serverTransactionId = requestEvent.getServerTransaction();
              System.out.println("\n\nRequest " + request.getMethod()+" received at " + sipStack.getStackName()+" with server transaction id " + serverTransactionId+" and dialog id "+requestEvent.getDialog());
              if (request.getMethod().equals(Request.SUBSCRIBE)) {
                   processSubscribe(requestEvent, serverTransactionId);
          * Process the invite request.
         public void processSubscribe(RequestEvent requestEvent,
                   ServerTransaction serverTransaction) {
              SipProvider sipProvider = (SipProvider) requestEvent.getSource();
              Request request = requestEvent.getRequest();
              try {
                   System.out.println("notifier: got an Subscribe sending OK");
                   System.out.println("notifier:  " + request);
                   System.out.println("notifier : dialog = " + requestEvent.getDialog());
                   EventHeader eventHeader = (EventHeader) request.getHeader(EventHeader.NAME);
                   if ( eventHeader == null) {
                        System.out.println("Cannot find event header.... dropping request.");
                        return;
                   // Always create a ServerTransaction, best as early as possible in the code
                   Response response = null;
                   ServerTransaction st = requestEvent.getServerTransaction();               
                   if (st == null) {
                        st = sipProvider.getNewServerTransaction(request);
                   // Check if it is an initial SUBSCRIBE or a refresh / unsubscribe
                   boolean isInitial = requestEvent.getDialog() == null;
                   if ( isInitial ) {
                        // need random tags to test forking
                        String toTag = Integer.toHexString( (int) (Math.random() * Integer.MAX_VALUE) );
                        response = messageFactory.createResponse(202, request);
                        ToHeader toHeader = (ToHeader) response.getHeader(ToHeader.NAME);
                        // Sanity check: to header should not ahve a tag. Else the dialog
                        // should have matched
                        if (toHeader.getTag()!=null) {
                             System.err.println( "####ERROR: To-tag!=null but no dialog match! My dialog=" + dialog.getState() );
                        toHeader.setTag(toTag); // Application is supposed to set.
                        this.dialog = st.getDialog();
                        // subscribe dialogs do not terminate on bye.
                        this.dialog.terminateOnBye(false);
                        if (dialog != null) {
                             System.out.println("Dialog " + dialog);
                             System.out.println("Dialog state " + dialog.getState());
                   } else {
                        response = messageFactory.createResponse(200, request);
                   // Both 2xx response need a Contact
                   Address address = addressFactory.createAddress("xTrade <sip:127.0.0.1>");
                   ((SipURI)address.getURI()).setPort( udpProvider.getListeningPoint("udp").getPort() );                    
                   ContactHeader contactHeader = headerFactory.createContactHeader(address);               
                   response.addHeader(contactHeader);
                   // Expires header is mandatory in 2xx responses to SUBSCRIBE
                   ExpiresHeader expires = (ExpiresHeader) request.getHeader( ExpiresHeader.NAME );
                   if (expires==null) {
                        expires = headerFactory.createExpiresHeader(30);     // rather short
                   response.addHeader( expires );
                   st.sendResponse(response);
                    * NOTIFY requests MUST contain a "Subscription-State" header with a
                    * value of "active", "pending", or "terminated". The "active" value
                    * indicates that the subscription has been accepted and has been
                    * authorized (in most cases; see section 5.2.). The "pending" value
                    * indicates that the subscription has been received, but that
                    * policy information is insufficient to accept or deny the
                    * subscription at this time. The "terminated" value indicates that
                    * the subscription is not active.
                   Request notifyRequest = dialog.createRequest( "NOTIFY" );
                   // Mark the contact header, to check that the remote contact is updated
                   ((SipURI)contactHeader.getAddress().getURI()).setParameter("id","not");
                   // Initial state is pending, second time we assume terminated (Expires==0)
                   SubscriptionStateHeader sstate = headerFactory.createSubscriptionStateHeader(
                             isInitial ? SubscriptionStateHeader.PENDING : SubscriptionStateHeader.TERMINATED );
                   // Need a reason for terminated
                   if ( sstate.getState().equalsIgnoreCase("terminated") ) {
                        sstate.setReasonCode( "deactivated" );
                   notifyRequest.addHeader(sstate);
                   notifyRequest.setHeader(eventHeader);
                   notifyRequest.setHeader(contactHeader);
                   // notifyRequest.setHeader(routeHeader);
                   ClientTransaction ct = udpProvider.getNewClientTransaction(notifyRequest);
                   // Let the other side know that the tx is pending acceptance
                   dialog.sendRequest(ct);
                   System.out.println("NOTIFY Branch ID " +
                        ((ViaHeader)request.getHeader(ViaHeader.NAME)).getParameter("branch"));
                   System.out.println("Dialog " + dialog);
                   System.out.println("Dialog state after pending NOTIFY: " + dialog.getState());
                   if (isInitial) {
                        Thread myEventSource = new Thread(new MyEventSource(this,eventHeader));
                        myEventSource.start();
              } catch (Throwable ex) {
                   ex.printStackTrace();
                   // System.exit(0);
         public synchronized void processResponse(ResponseEvent responseReceivedEvent) {
              Response response = (Response) responseReceivedEvent.getResponse();
              Transaction tid = responseReceivedEvent.getClientTransaction();
              if ( response.getStatusCode() !=  200 ) {
                   this.notifyCount --;
              } else {
                  System.out.println("Notify Count = " + this.notifyCount);
         public void processTimeout(javax.sip.TimeoutEvent timeoutEvent) {
              Transaction transaction;
              if (timeoutEvent.isServerTransaction()) {
                   transaction = timeoutEvent.getServerTransaction();
              } else {
                   transaction = timeoutEvent.getClientTransaction();
              System.out.println("state = " + transaction.getState());
              System.out.println("dialog = " + transaction.getDialog());
              System.out.println("dialogState = "
                        + transaction.getDialog().getState());
              System.out.println("Transaction Time out");
        private static void initFactories ( int port ) throws Exception {
              SipFactory sipFactory = SipFactory.getInstance();
              sipFactory.setPathName("gov.nist");
              Properties properties = new Properties();
              properties.setProperty("javax.sip.STACK_NAME", "notifier" + port );
              // You need 16 for logging traces. 32 for debug + traces.
              // Your code will limp at 32 but it is best for debugging.
              properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "32");
              properties.setProperty("gov.nist.javax.sip.DEBUG_LOG",
                        "notifierdebug_"+port+".txt");
              properties.setProperty("gov.nist.javax.sip.SERVER_LOG",
                        "notifierlog_"+port+".txt");
              try {
                   // Create SipStack object
                   sipStack = sipFactory.createSipStack(properties);
                   System.out.println("sipStack = " + sipStack);
              } catch (PeerUnavailableException e) {
                   // could not find
                   // gov.nist.jain.protocol.ip.sip.SipStackImpl
                   // in the classpath
                   e.printStackTrace();
                   System.err.println(e.getMessage());
                   if (e.getCause() != null)
                        e.getCause().printStackTrace();
                   System.exit(0);
              try {
                   headerFactory = sipFactory.createHeaderFactory();
                   addressFactory = sipFactory.createAddressFactory();
                   messageFactory = sipFactory.createMessageFactory();
              } catch  (Exception ex) {
                   ex.printStackTrace();
                   System.exit(0);
         public void createProvider() {
              try {
                   ListeningPoint lp = sipStack.createListeningPoint(this.serverIP, this.port, "udp");
                   this.udpProvider = sipStack.createSipProvider(lp);
                   System.out.println("udp provider " + udpProvider);
              } catch (Exception ex) {
                   System.out.println((ex.getMessage()));
                   ex.printStackTrace();
                   usage();
         public sipTrade( int port ) {
              this.port = port;
         public sipTrade(){
         public static void main(String args[]) throws Exception {
              int port = args.length > 0 ? Integer.parseInt(args[0]) : 5060;
              initFactories( port );
              sipTrade notifier = new sipTrade( port );
              notifier.createProvider( );
              notifier.udpProvider.addSipListener(notifier);
              //sipTrade st = new sipTrade();
              //st.Send2xTrade("198202050897", "testdata");
              //st.getXTmsg(0);
         public void processIOException(IOExceptionEvent exceptionEvent) {
         public void processTransactionTerminated(
                   TransactionTerminatedEvent transactionTerminatedEvent) {
         public void processDialogTerminated(
                   DialogTerminatedEvent dialogTerminatedEvent) {
              // TODO Auto-generated method stub
          * Xtrade connection - DATA IN
          public void Send2xTrade(String data, String info) {
               try{
                    IServer is = ServerFactory.createObject(ip);
                    is.logOn(clientName_in, SessionType.LogOnRxTx);
                    is.sendMsg(contract_in,MsgPriority.Def, data.getBytes(), info);
                    is.logOff();
               catch (Exception e){
                    e.printStackTrace();
                    System.err.println(e.getMessage());
          public void getXTmsg(int xtMsgAck){
              IMsg msg;               // A single xTrade message
              MsgInfo msgInfo = null;      // Message information
              byte[] theData;
              try {
                   IServer is = ServerFactory.createObject(ip);
                   is.logOn(clientName_out, SessionType.LogOnRxTx);
                   msg = is.createNextRxMsg(contract_out);
                   FileOutputStream myStream = new FileOutputStream("rx" + msg.getHandle() + ".msg");     // Create the stream                    
                   msg.getData(myStream);
                   myStream.close();
                   if(msgInfo.getAcknowledge() == false){
                             msg.setReceived();
                        else if(msgInfo.getAcknowledge() == true && xtMsgAck == 0){
                              msg.setReceived();
                              msg.setAck();
                         else if(msgInfo.getAcknowledge() == true && xtMsgAck == 1){
                              msg.setReceived();
                              msg.setNack();
                   is.logOff();
              }catch (XTException e){
              catch(Exception e){
    }

    Made som more fixes:
    sipStack = gov.nist.javax.sip.SipStackImpl@e24e2a
    sipStack = gov.nist.javax.sip.SipStackImpl@e24e2a
    SipProviders: java.util.LinkedList$ListItr@1a73d3c
    AddressFactory: class gov.nist.javax.sip.address.AddressFactoryImpl
    InvalidArgumentException Cannot assign requested address: Cannot bindjavax.sip.InvalidArgumentException: Cannot assign requested address: Cannot bind
         at gov.nist.javax.sip.SipStackImpl.createListeningPoint(SipStackImpl.java:645)
         at sipClient.createProvider(sipClient.java:267)
         at sipClient.main(sipClient.java:302)
    Caused by: java.io.IOException: Cannot assign requested address: Cannot bind
         at gov.nist.javax.sip.stack.UDPMessageProcessor.<init>(UDPMessageProcessor.java:135)
         at gov.nist.javax.sip.stack.SIPTransactionStack.createMessageProcessor(SIPTransactionStack.java:1652)
         at gov.nist.javax.sip.SipStackImpl.createListeningPoint(SipStackImpl.java:626)
         ... 2 more
    Exception in thread "main" java.lang.NullPointerException
         at sipClient.main(sipClient.java:303)
    import java.io.*;
    import javax.sip.*;
    import javax.sip.address.*;
    import javax.sip.header.*;
    import javax.sip.message.*;
    import java.util.*;
    public class sipClient implements SipListener {
         private static AddressFactory addressFactory;
         private static MessageFactory messageFactory;
         private static HeaderFactory headerFactory;
         private static Address address;
         private static SipStack sipStack;
         private int port;
         protected SipProvider udpProvider;
         protected Dialog dialog;
         protected int notifyCount = 0;
         public static final int PORT_5060 = 5070;     
         protected final String serverIP = "192.168.1.99";
         class MyEventSource implements Runnable {
              private sipClient st;
              private EventHeader eventHeader;
              public MyEventSource(sipClient notifier, EventHeader eventHeader ) {
                   this.st = notifier;
                   this.eventHeader = eventHeader;
              public void run() {
                   try {
                        for (int i = 0; i < 100; i++) {
                             Thread.sleep(100);
                             Request request = this.st.dialog.createRequest(Request.NOTIFY);
                             SubscriptionStateHeader subscriptionState = headerFactory.createSubscriptionStateHeader(SubscriptionStateHeader.ACTIVE);
                             request.addHeader(subscriptionState);
                             request.addHeader(eventHeader);
                             // Lets mark our Contact
                             ((SipURI)dialog.getLocalParty().getURI()).setParameter("id","not2");
                             ClientTransaction ct = udpProvider.getNewClientTransaction(request);
                             System.out.println("NOTIFY Branch ID "+((ViaHeader)request.getHeader(ViaHeader.NAME)).getParameter("branch"));
                             this.st.dialog.sendRequest(ct);
                             System.out.println("Dialog " + dialog);
                             System.out.println("Dialog state after active NOTIFY: " + dialog.getState());
                             synchronized (sipClient.this) {
                             notifyCount ++;
                   } catch (Throwable e) {
                        e.printStackTrace();
         private static void usage() {
              System.exit(0);
         public void processRequest(RequestEvent requestEvent) {
              Request request = requestEvent.getRequest();
              ServerTransaction serverTransactionId = requestEvent.getServerTransaction();
              System.out.println("\n\nRequest " + request.getMethod()+" received at " + sipStack.getStackName()+" with server transaction id " + serverTransactionId+" and dialog id "+requestEvent.getDialog());
              if (request.getMethod().equals(Request.SUBSCRIBE)) {
                   processSubscribe(requestEvent, serverTransactionId);
          * Process the invite request.
         public void processSubscribe(RequestEvent requestEvent,
                   ServerTransaction serverTransaction) {
              SipProvider sipProvider = (SipProvider) requestEvent.getSource();
              Request request = requestEvent.getRequest();
              try {
                   System.out.println("notifier: got an Subscribe sending OK");
                   System.out.println("notifier:  " + request);
                   System.out.println("notifier : dialog = " + requestEvent.getDialog());
                   EventHeader eventHeader = (EventHeader) request.getHeader(EventHeader.NAME);
                   if ( eventHeader == null) {
                        System.out.println("Cannot find event header.... dropping request.");
                        return;
                   // Always create a ServerTransaction, best as early as possible in the code
                   Response response = null;
                   ServerTransaction st = requestEvent.getServerTransaction();               
                   if (st == null) {
                        st = sipProvider.getNewServerTransaction(request);
                   // Check if it is an initial SUBSCRIBE or a refresh / unsubscribe
                   boolean isInitial = requestEvent.getDialog() == null;
                   if ( isInitial ) {
                        // need random tags to test forking
                        String toTag = Integer.toHexString( (int) (Math.random() * Integer.MAX_VALUE) );
                        response = messageFactory.createResponse(202, request);
                        ToHeader toHeader = (ToHeader) response.getHeader(ToHeader.NAME);
                        // Sanity check: to header should not ahve a tag. Else the dialog
                        // should have matched
                        if (toHeader.getTag()!=null) {
                             System.err.println( "####ERROR: To-tag!=null but no dialog match! My dialog=" + dialog.getState() );
                        toHeader.setTag(toTag); // Application is supposed to set.
                        this.dialog = st.getDialog();
                        // subscribe dialogs do not terminate on bye.
                        this.dialog.terminateOnBye(false);
                        if (dialog != null) {
                             System.out.println("Dialog " + dialog);
                             System.out.println("Dialog state " + dialog.getState());
                   } else {
                        response = messageFactory.createResponse(200, request);
                   // Both 2xx response need a Contact
                   address = addressFactory.createAddress("xTrade <sip:192.168.1.99>");
                   ((SipURI)address.getURI()).setPort( udpProvider.getListeningPoint("udp").getPort() );                    
                   ContactHeader contactHeader = headerFactory.createContactHeader(address);               
                   response.addHeader(contactHeader);
                   // Expires header is mandatory in 2xx responses to SUBSCRIBE
                   ExpiresHeader expires = (ExpiresHeader) request.getHeader( ExpiresHeader.NAME );
                   if (expires==null) {
                        expires = headerFactory.createExpiresHeader(30);     // rather short
                   response.addHeader( expires );
                   st.sendResponse(response);
                    * NOTIFY requests MUST contain a "Subscription-State" header with a
                    * value of "active", "pending", or "terminated". The "active" value
                    * indicates that the subscription has been accepted and has been
                    * authorized (in most cases; see section 5.2.). The "pending" value
                    * indicates that the subscription has been received, but that
                    * policy information is insufficient to accept or deny the
                    * subscription at this time. The "terminated" value indicates that
                    * the subscription is not active.
                   Request notifyRequest = dialog.createRequest( "NOTIFY" );
                   // Mark the contact header, to check that the remote contact is updated
                   ((SipURI)contactHeader.getAddress().getURI()).setParameter("id","not");
                   // Initial state is pending, second time we assume terminated (Expires==0)
                   SubscriptionStateHeader sstate = headerFactory.createSubscriptionStateHeader(
                             isInitial ? SubscriptionStateHeader.PENDING : SubscriptionStateHeader.TERMINATED );
                   // Need a reason for terminated
                   if ( sstate.getState().equalsIgnoreCase("terminated") ) {
                        sstate.setReasonCode( "deactivated" );
                   notifyRequest.addHeader(sstate);
                   notifyRequest.setHeader(eventHeader);
                   notifyRequest.setHeader(contactHeader);
                   // notifyRequest.setHeader(routeHeader);
                   ClientTransaction ct = udpProvider.getNewClientTransaction(notifyRequest);
                   // Let the other side know that the tx is pending acceptance
                   dialog.sendRequest(ct);
                   System.out.println("NOTIFY Branch ID " +
                        ((ViaHeader)request.getHeader(ViaHeader.NAME)).getParameter("branch"));
                   System.out.println("Dialog " + dialog);
                   System.out.println("Dialog state after pending NOTIFY: " + dialog.getState());
                   if (isInitial) {
                        Thread myEventSource = new Thread(new MyEventSource(this,eventHeader));
                        myEventSource.start();
              } catch (Throwable ex) {
                   ex.printStackTrace();
                   // System.exit(0);
         public synchronized void processResponse(ResponseEvent responseReceivedEvent) {
              Response response = (Response) responseReceivedEvent.getResponse();
              Transaction tid = responseReceivedEvent.getClientTransaction();
              if ( response.getStatusCode() !=  200 ) {
                   this.notifyCount --;
              } else {
                  System.out.println("Notify Count = " + this.notifyCount);
         public void processTimeout(javax.sip.TimeoutEvent timeoutEvent) {
              Transaction transaction;
              if (timeoutEvent.isServerTransaction()) {
                   transaction = timeoutEvent.getServerTransaction();
              } else {
                   transaction = timeoutEvent.getClientTransaction();
              System.out.println("state = " + transaction.getState());
              System.out.println("dialog = " + transaction.getDialog());
              System.out.println("dialogState = "
                        + transaction.getDialog().getState());
              System.out.println("Transaction Time out");
        private static void initFactories ( int port ) throws Exception {
              SipFactory sipFactory = SipFactory.getInstance();
              sipFactory.setPathName("gov.nist");
              Properties properties = new Properties();
              properties.setProperty("javax.sip.STACK_NAME", "notifier" + port );
              // You need 16 for logging traces. 32 for debug + traces.
              // Your code will limp at 32 but it is best for debugging.
              properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "32");
              properties.setProperty("gov.nist.javax.sip.DEBUG_LOG","Xtradedebug_"+port+".txt");
              properties.setProperty("gov.nist.javax.sip.SERVER_LOG","Xtradelog_"+port+".txt");
              properties.setProperty("javax.sip.OUTBOUND_PROXY","192.168.1.99:5070/UDP");
              properties.setProperty("javax.sip.USE_ROUTER_FOR_ALL_URIS", "true");
              properties.setProperty("javax.sip.AUTOMATIC_DIALOG_SUPPORT","ON");
              try {
                   // Create SipStack object
                   sipStack = sipFactory.createSipStack(properties);
                   System.out.println("sipStack = " + sipStack);
              } catch (PeerUnavailableException e) {
                   // could not find
                   // gov.nist.jain.protocol.ip.sip.SipStackImpl
                   // in the classpath
                   e.printStackTrace();
                   System.err.println(e.getMessage());
                   if (e.getCause() != null)
                        e.getCause().printStackTrace();
                   System.exit(0);
              try {
                   headerFactory = sipFactory.createHeaderFactory();
                   addressFactory = sipFactory.createAddressFactory();
                   messageFactory = sipFactory.createMessageFactory();
              } catch  (Exception ex) {
                   ex.printStackTrace();
                   System.exit(0);
         public void createProvider() {
              try {
                   System.out.println("sipStack = " + sipStack);
                   System.out.println("SipProviders: "+sipStack.getSipProviders().toString());
                   System.out.println("AddressFactory: "+addressFactory.getClass());
                   ListeningPoint lp = sipStack.createListeningPoint(this.serverIP, 5070, ListeningPoint.UDP);
                   this.udpProvider = sipStack.createSipProvider(lp);
                   System.out.println("udp provider " + udpProvider);
              }catch(SipException e){
                   System.out.print("SipException "+e.getMessage());
                   e.printStackTrace();
              /*catch(TransportNotSupportedException e){
                   System.out.print("TransportNotSupportedException "+e.getMessage());
              catch (InvalidArgumentException e){
                   System.out.print("InvalidArgumentException "+e.getMessage());
                   e.printStackTrace();
              catch (Exception ex) {
                   System.err.println((ex.getMessage()));
                   ex.printStackTrace();
                   usage();
         public sipClient( int port ) {
              this.port = port;
         public sipClient(){
         public static void main(String args[]) throws Exception {
              int port = args.length > 0 ? Integer.parseInt(args[0]) : 5070;
              initFactories( port );
              sipClient st = new sipClient( port );
              st.createProvider();
              st.udpProvider.addSipListener(st);
         public void processIOException(IOExceptionEvent exceptionEvent) {
         public void processTransactionTerminated(
                   TransactionTerminatedEvent transactionTerminatedEvent) {
         public void processDialogTerminated(
                   DialogTerminatedEvent dialogTerminatedEvent) {
              // TODO Auto-generated method stub
    }

  • HT5676 my macpro (10.6.8) refused to install wireless printer (canon pixma MG4260). Whenever i tried to install, it keeps saying 'internal error number 12'. Please help!! and what does internal error got to do with installing a printer?

    my macbook pro (10.6.8) refused to install wireless printer (canon pixma MG4260). Whenever i tried to install, it keeps saying 'internal error number 12'. Please help me!! and what does internal error got to do with installing a printer?

    my macbook pro (10.6.8) refused to install wireless printer (canon pixma MG4260). Whenever i tried to install, it keeps saying 'internal error number 12'. Please help me!! and what does internal error got to do with installing a printer?

  • Photoshop CS6 could not update successfully.  Error codes Adobe Photoshop 13.0.1.3 Installation failed. Error Code: U44M1P7  Extension Manager 6.0.8 Update Installation failed. Error Code: U44M1P7  Please help me figure out how to call customer service. 

    Photoshop CS6 could not update successfully.  Error codes Adobe Photoshop 13.0.1.3 Installation failed. Error Code: U44M1P7  Extension Manager 6.0.8 Update Installation failed. Error Code: U44M1P7  Please help me figure out how to call customer service.  I would prefer to talk to someone directly.

    Are you using any disk cleaner or optimization tools like CleanMymac or Mackeeper?
    Regards,
    Ashutosh

  • Cannot restore my brand new iphone 4s ,got stuck in DFU mode and itunes shows error code (-1) please help?

    Cannot restore my brand new iphone 4s ,got stuck in DFU mode and itunes shows error code (-1) please help?
    repeatedly tried from diffierent computers and the same error code pops up (error -1)

    That's a hardware problem which will require a trip to the Apple store for evaluation, unless your phone has been jailbroken, then it's a corrupt hosts file (and we can't help you with that here as it is against the forum's terms of use).

  • I cannot restore my Iphone 4, I keep getting the error code 1611, please help and the Iphone keeps displaying the "Plug-In Itunes Symbol!??

    I cannot restore my Iphone 4, I keep getting the error code 1611, please help and the Iphone keeps displaying the "Plug-In Itunes Symbol!??

    http://tinyurl.com/nyj36v

  • HT1338 I receive this message ,repeatedly,when I try to update an App through App store:Error code 1009.Please help,what should I do?

    I receive this message ,repeatedly,when I try to update an App through App store:Error code 1009.Please help,what should I do?

    The App Store is not available in Iran.

  • Trying to download ios 3 getting error code 8288  please help

    Have a first generation ipod touch, trying to download ios 3 to computer getting error code 8288, please help.

    I finally solved this on my own. I installed iTunes 9.2 on my Mac. You can get it from here:
    http://support.apple.com/kb/dl1056
    Then I went to the iOS 3 purchase page here:
    http://support.apple.com/kb/HT2052
    and clicked the Purchasing link. It opens up iTunes. I connected my iPod touch G1 and did a check for system update. Miraculously, it found it this time and downloaded the update.
    No guarantee that this'll work for you, but I'm finally able to use my iPod touch again and put on some useful apps.

  • I can't download Lightroom for some reason.  I keep getting this error:  Exit Code: 7 Please see specific errors below for troubleshooting. For example,  ERROR: DW006 ...  -------------------------------------- Summary ------------------------------------

    I can't download Lightroom for some reason.  I keep getting this error:
    Exit Code: 7
    Please see specific errors below for troubleshooting. For example, ERROR: DW006 ...
    -------------------------------------- Summary --------------------------------------
    - 0 fatal error(s), 2 error(s)
    ----------- Payload: Adobe Photoshop Lightroom 5 5.4.0.0 Adobe Photoshop Lightroom 5.pkg_5.4 -----------
    ERROR: DW006: Apple Package failed to install successfully.
    ERROR: Third party payload installer Adobe Photoshop Lightroom 5.pkg failed with exit code: 1

    Link for Download & Install & Setup & Activation problems may help
    -Chat http://www.adobe.com/support/download-install/supportinfo/

  • HT5642 Unable to download app this time error while downloading app please help!!!

    when i download some app from apps store i get the following error
    "Unable to download app this time error while downloading app" please help!!!
    i ve tried these Things but
    didnt workout yet
    1) i tried hard reset
    2)i tried logout/login Itune & appstore
    3)Connected to pc and rest setting Network and Full Rest
    all of no use... i dont want to update my softwre from IOS 6.0
    Plx help!1

    Hey Prahaladvatsan,
    Thanks for the question. If I understand correctly, there is a blank app icon on the home screen. It looks like you have already done some troubleshooting. I would recommend that you read these articles, they may be helpful in troubleshooting your issue.
    Restart or reset your iPhone, iPad, or iPod touch - Apple Support
    Back up and restore your iPhone, iPad, or iPod touch using iCloud or iTunes - Apple Support
    Thanks for using Apple Support Communities.
    Have a good one,
    Mario

  • HT201263 Hi. I forgot my passcode and now I am unable to unlock my ipod. I tried restoring it using itunes in recovery mode as well as dfu mode but it says unable to restore,unknown error occured (3004).  Please help me out. My ipod is locked for one hour

    Hi. I forgot my passcode and now I am unable to unlock my ipod. I tried restoring it using itunes in recovery mode as well as dfu mode but it says unable to restore,unknown error occured (3004).  Please help me out. My ipod is locked for one hour now.

    Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device: Several Alternative Solutions
    1. iOS- Forgotten passcode or device disabled after entering wrong passcode
    2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    3. Restoring iPod touch after forgotten passcode
    4. What to Do If You've Forgotten Your iPhone's Passcode
    5. iOS- Understanding passcodes
    6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    Forgotten Restrictions Passcode Help
    You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
    Also, see iTunes- Restoring iOS software.

  • How to fix this: The iphone "iPhone" could not be restored. An unknown error occurred (3014). Please help me :(

    how to fix this: The iphone "iPhone" could not be restored. An unknown error occurred (3014). Please help me

    Read here:
    http://support.apple.com/kb/ts3694#3014

  • Error install illustrator cc please help!!

    error install illustrator cc please help!!

    Eli,
    This may be one for this specialized forum (where you may be able find the answer from previous threads),
    http://forums.adobe.com/community/download_install_setup
    or for Customer Care (tick I Still Need Help and hope for an agent available for a chat),
    http://helpx.adobe.com/contact.html?product=illustrator&topic=downloading-installing-and-s etting-up
    or for Adobe Support (phone),
    http://helpx.adobe.com/adobe-connect/adobe-connect-phone-numbers.html

  • I have Mac Pro 2010 model and it's giving heavy fan noise,so run the Apple hardware test but it's showing the Error: 4SMC 1 40000000  please help me in this issue.

    I have Mac Pro 2010 model and it's giving heavy fan noise,so run the Apple hardware test but it's showing the Error: 4SMC 1 40000000  please help me in this issue.

    Same error information here.
    https://discussions.apple.com/message/13083664?messageID=13083664

Maybe you are looking for

  • Pdf online with fields

    Hello, I am looking to post a document online, which users can add comments to & fill fields in, and then it be saved online, similiar to a guestbook. Will a pdf document work this way? I know I have write permissions issues to address on my website,

  • Can't pinch to minimize apps anymore

    When I try to pinch an app to minimize it nothing happens. I have to use the home button to navigate between apps. Why would this stop working?

  • Movies not syncing on iTunes?

    My movies appear on my tiniest desktop but won't download when I tick the  and sync to my iPad.

  • ¿Como recuperar mi número de serie?

    Recientemente mi máquina fue formateada y no se desactivo el serial de CS5.5, ahora compre una actualizacion a CS6 pero debo actualizar del CS5.5 y mi serial quedó atrapado. Al querer usarlo me dice que ya exedí el numero de equipos permitidos. ¿Como

  • Crystal Reports for Eclipse Version 2 Released!

    See here for more info: [https://www.sdn.sap.com/irj/boc/crystalreports-java] Sincerely, Ted Ueda