Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 273
  • Last Modified:

Subject: URLGetMethod.executeMethod is hanging under multi threaded environment

Subject: URLGetMethod.executeMethod is hanging under multi threaded environment

Hello Guys,


Please see the folloiwng code. I am trying to download the mails of MS Exchange Server using
URLGetMethod.executeMethod( A Part of Slide API). But when execution pointer comes to the thread area
(URLGetMethod.executemethod),

URLGetMethod.executemethod is not coming out of it's loop. Could you please explain what is the
problem with this code??


class SaveAttachmentThread
    extends Thread
    implements Runnable {
  static int threadCount = 0;
  String uri = "";
  String strAttachmentName = "";
  private org.apache.commons.httpclient.HttpClient client = null;
  org.apache.commons.httpclient.methods.UrlGetMethod attachmentMethod = null;

  public SaveAttachmentThread(String uri, String strAttachmentName,
                              org.apache.commons.httpclient.HttpClient client) {
    this.uri = uri;
    this.strAttachmentName = strAttachmentName;
    this.client = client;

  }

  public SaveAttachmentThread(org.apache.commons.httpclient.methods.
                              UrlGetMethod _getMethod, String attachment) {
    attachmentMethod = _getMethod;
    this.strAttachmentName = attachment;
  }

  public void run() {
    //strAttachmentName = URLDecoder.decode(strAttachmentName);
    System.err.println("Saved to " + strAttachmentName);
    System.err.println("URL :" + uri);
    try {


        System.err.println("Saving the URL :" + strAttachmentName);
        org.apache.commons.httpclient.methods.UrlGetMethod getMethod = new org.
            apache.commons.httpclient.methods.UrlGetMethod(uri);
        int status = client.executeMethod(getMethod);


      byte attachmentBytes[] = getMethod.getResponseBody();
      FileOutputStream fout = new FileOutputStream(strAttachmentName);
      fout.write(attachmentBytes);
      fout.close();
      fout = null;

      threadCount++;
      System.err.println(threadCount);

    }
    catch (Throwable e) {
      System.err.println("Error raised while saving the URI : " +
                         strAttachmentName);
      e.printStackTrace();
    }
  }
}
0
sudhakar_koundinya
Asked:
sudhakar_koundinya
  • 13
  • 9
  • 3
  • +1
1 Solution
 
objectsCommented:
dump the state of the threads to determine cause of block.
0
 
sudhakar_koundinyaAuthor Commented:
How should I do that??
0
 
objectsCommented:
Ctrl Break
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
sudhakar_koundinyaAuthor Commented:
:-)

I have already done that. It's not showing anything
0
 
CEHJCommented:
Might be worth setting the timeout and then handling possible exceptions
0
 
objectsCommented:
> It's not showing anything

Must show something :)
0
 
sudhakar_koundinyaAuthor Commented:
when i  use Ctrl Break

It just teminates the entire program
0
 
objectsCommented:
Shouldn't do, what OS?
0
 
sudhakar_koundinyaAuthor Commented:
Windows 2000 Professional
0
 
objectsCommented:
works fine here with win2k
0
 
objectsCommented:
>    extends Thread
>    implements Runnable {

Not related to you problem, but you don't actually need to extend Thread here.
You can simply create a thread from a Runnable.

0
 
sudhakar_koundinyaAuthor Commented:
OK objects,

I am able to manage to get the stack trace

Here is the output what I get from the stack
0
 
sudhakar_koundinyaAuthor Commented:
OOPs,

Total Time in Millis :16594

Full thread dump Java HotSpot(TM) Client VM (1.4.1_01-b01 mixed mode):

"DestroyJavaVM" prio=5 tid=0x002362A0 nid=0x700 waiting on condition [0..6fadc]

"Thread-27" prio=5 tid=0x0ADBA8E0 nid=0x7ac runnable [b91f000..b91fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-26" prio=5 tid=0x0AD54C00 nid=0x7dc runnable [b8df000..b8dfd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-25" prio=5 tid=0x0AE259B0 nid=0x768 runnable [b89f000..b89fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-24" prio=5 tid=0x0AE25320 nid=0x744 runnable [b85f000..b85fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-23" prio=5 tid=0x0AFE61E0 nid=0x754 runnable [b81f000..b81fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-22" prio=5 tid=0x0AE24600 nid=0x74c runnable [b7df000..b7dfd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-21" prio=5 tid=0x0AE23680 nid=0x7d4 runnable [b79f000..b79fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-20" prio=5 tid=0x0AE3FE98 nid=0x78c runnable [b75f000..b75fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-19" prio=5 tid=0x008E54C8 nid=0x6e4 runnable [b71f000..b71fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-18" prio=5 tid=0x008E1B30 nid=0x794 runnable [b6df000..b6dfd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-17" prio=5 tid=0x008E04B0 nid=0x6f4 runnable [b69f000..b69fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-16" prio=5 tid=0x008DDDE8 nid=0x798 runnable [b65f000..b65fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-15" prio=5 tid=0x008DCFF8 nid=0x7d0 runnable [b61f000..b61fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-14" prio=5 tid=0x0AE08F50 nid=0x6e0 runnable [b5df000..b5dfd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-13" prio=5 tid=0x0AE06D48 nid=0x360 runnable [b59f000..b59fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-12" prio=5 tid=0x0AE05ED0 nid=0x6c0 runnable [b55f000..b55fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-11" prio=5 tid=0x0ADB91C8 nid=0x6f8 runnable [b51f000..b51fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-10" prio=5 tid=0x0AD8ACC0 nid=0x7e4 runnable [b4df000..b4dfd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-9" prio=5 tid=0x0B0753D0 nid=0x788 runnable [b49f000..b49fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-8" prio=5 tid=0x0ADCA1C8 nid=0x7ec runnable [b45f000..b45fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-7" prio=5 tid=0x0AE2DDD0 nid=0x7f8 runnable [b41f000..b41fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-6" prio=5 tid=0x0AE2D058 nid=0x654 runnable [b3df000..b3dfd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-5" prio=5 tid=0x0AE36198 nid=0x5a8 runnable [b39f000..b39fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-4" prio=5 tid=0x0AFF6320 nid=0x804 runnable [b35f000..b35fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-3" prio=5 tid=0x0B07EC28 nid=0x6c8 runnable [b31f000..b31fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-2" prio=5 tid=0x009369D8 nid=0x7f4 runnable [b2df000..b2dfd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Thread-1" prio=5 tid=0x0AD93E90 nid=0x7a4 runnable [b29f000..b29fd88]
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.FilterInputStream.read(FilterInputStream.java:66)
      at java.io.PushbackInputStream.read(PushbackInputStream.java:120)
      at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:109)
      at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:135)
      at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1086)
      at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:2188)
      at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1949)
      at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659)
      at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
      at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
      at org.prithvi.docparser.microsoft.msexchange.SaveAttachmentThread.run(MSExchangeMailDownLoad.java:1826)

"Signal Dispatcher" daemon prio=10 tid=0x008B4F90 nid=0x6c4 waiting on condition [0..0]

"Finalizer" daemon prio=9 tid=0x008FF100 nid=0x734 in Object.wait() [ab4f000..ab4fd88]
      at java.lang.Object.wait(Native Method)
      - waiting on <02EF0728> (a java.lang.ref.ReferenceQueue$Lock)
      at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
      - locked <02EF0728> (a java.lang.ref.ReferenceQueue$Lock)
      at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
      at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=10 tid=0x008FDC78 nid=0x784 in Object.wait() [ab0f000..ab0fd88]
      at java.lang.Object.wait(Native Method)
      - waiting on <02EF0790> (a java.lang.ref.Reference$Lock)
      at java.lang.Object.wait(Object.java:426)
      at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:113)
      - locked <02EF0790> (a java.lang.ref.Reference$Lock)

"VM Thread" prio=5 tid=0x008FCA40 nid=0x7e0 runnable

"VM Periodic Task Thread" prio=10 tid=0x008B3B28 nid=0x748 waiting on condition
"Suspend Checker Thread" prio=10 tid=0x008B45A8 nid=0x738 runnable
0
 
CEHJCommented:
If you do this. it'll make that debugging a whole lot easier:

thread.setName("Url thread: " + urlToGet);
0
 
sudhakar_koundinyaAuthor Commented:
sorry for posting such a big message.

I did not realise that. I thought that was smaller :(
0
 
sudhakar_koundinyaAuthor Commented:
what does that mean??

"Reference Handler" daemon prio=10 tid=0x008FDC78 nid=0x784 in Object.wait() [ab0f000..ab0fd88]
     at java.lang.Object.wait(Native Method)
     - waiting on <02EF0790> (a java.lang.ref.Reference$Lock)
     at java.lang.Object.wait(Object.java:426)
     at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:113)
     - locked <02EF0790> (a java.lang.ref.Reference$Lock)

By chance , Is any thread locked??
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> extends Thread
>>    implements Runnable {

Why do you have both?
0
 
sudhakar_koundinyaAuthor Commented:
will that give any problem??. Let me check that
0
 
sudhakar_koundinyaAuthor Commented:
No Sridhar,

Even if  I just use extends thread or Implements runnable. The problem  is same.

0
 
Mayank SAssociate Director - Product EngineeringCommented:
The problem could be there. I pointed that out not as something relevant to this question but as basic Java programming practice/ concepts. You should not need to do both.
0
 
CEHJCommented:
>>what does that mean??

It's not relevant. Nor is the interface/extends issue. What you most probably have is a blocked read in one of the threads, which is perfectly usual, so you should treat it as i mentioned earlier
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> The problem could be there.

I meant it could NOT be there ;) but I pointed it out as....
0
 
objectsCommented:
Perhaps the problem is with the server, I'd suggest having a look at what it's doing.
May be that it has locked up processing lots of concurrent connections.
0
 
sudhakar_koundinyaAuthor Commented:
objects I am able to solve the problem.

Actually problem is with Slide API.

WebDavResource class uses SimpleConnectionManager for creating the HttpClient instance. Under multithreaded environment this will not be helpful.

I have inherited the WebDavResource class and created the MultiThreadedHttpConnectionManager  instance for creating the HttpClient instance

the code will be some thing like this

      if (manager == null) {
        manager = new MultiThreadedHttpConnectionManager();
             manager.setMaxTotalConnections(30);
        manager.setMaxConnectionsPerHost(10);
      }

I got this answer from apache slide mailing group

FYI
http://www.mail-archive.com/slide-user%40jakarta.apache.org/msg07541.html
http://www.mail-archive.com/slide-user%40jakarta.apache.org/msg07546.html

Thanks
Sudhakar
0
 
sudhakar_koundinyaAuthor Commented:
The actual code to create HttpClient instance
      if (manager == null) {
        manager = new MultiThreadedHttpConnectionManager();
             manager.setMaxTotalConnections(30);
        manager.setMaxConnectionsPerHost(10);
      }
      client = new HttpClient(manager);
//   client = new HttpClient(); ---> this is actual in WebDavResouce class
0
 
objectsCommented:
> objects I am able to solve the problem.

good work :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 13
  • 9
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now