0

I inherited a rewritten Java project that was written for an ATM Switch. I've been working on this project for 3.5 months and trying to test the application for certification with Discover Card. I am not that familiar with Concurrency (threads and receive queuers) but I THINK I've run into a blocking problem and cannot find a way to correct the problem.

Here is the scenario of what occurs:

  1. I start the application on our development server (Windows 2003).
  2. I submit a ISO8583 message (0800) for a dynamic key exchange to my application via a WEB APP called RCT on the Discover web site and the message processes fine. The message stops and the receive queuer per Eclipse debugger and my log says that it is waiting on another message.
  3. The key is held in memory in the Discover web app.
  4. I submit the next ISO8583 mesage (0200) to my application BUT I never see the subsequent ISO8583 message even hit our application.
  5. I can see the subsequent message come across the wire on a specific port using Wireshark to confirm but it never makes it to the application entry point. I put a breakpoint on where I would see the subsequent message hit the application but I never reach the breakpoint. In the Eclipse debug session I see the DiscoverChannel thread running plus the 2 receive queuer threads running as well. They appear to be open and ready for a message but again it never reaches the application.

In the Eclipse DEBUG window I copied the STACK of the THREADS and if the problem with getting a subsequent request in DiscoverChannel-ReceiveQueuer-1 THREAD that is waiting is being blocked by the DiscoverChannel-ReceiveQueuer-0 THREAD? That is how I'm reading it but would like to get some confirmation or if wrong, how to find my problem.

Here is the stack:

Thread [DiscoverChannelThread ] (Suspended) 
    waiting for: Socket  (id=82)    
    Object.wait(long) line: not available [native method]   
    Socket(Object).wait() line: 485 
    DiscoverChannel(SwitchChannel).run() line: 1931 
    Thread.run() line: 662  
Thread [DiscoverChannel-ReceiveQueuer-1] (Suspended)    
    waiting for: DataInputStream  (id=36)   
    DiscoverChannel(SwitchChannel).blockUntilGetMessageBytes(Request, ProcessingTimer) line: 672    
    DiscoverChannel(SwitchChannel).blockUntilReceiveMessage(ProcessingTimer) line: 1330 
    ReceiveQueuer.run() line: 96    
    Thread.run() line: 662  
Thread [DiscoverChannel-ReceiveQueuer-0] (Suspended)    
    owns: BufferedInputStream  (id=60)  
    owns: DataInputStream  (id=36)  
    SocketInputStream.socketRead0(FileDescriptor, byte[], int, int, int) line: not available [native method]    
    SocketInputStream.read(byte[], int, int) line: 129  
    BufferedInputStream.fill() line: 218 [local variables unavailable]  
    BufferedInputStream.read1(byte[], int, int) line: 258   
    BufferedInputStream.read(byte[], int, int) line: 317    
    DataInputStream.readFully(byte[], int, int) line: 178   
    DiscoverChannel(SwitchChannel).blockUntilGetMessageLength() line: 801   
    DiscoverChannel(SwitchChannel).blockUntilGetMessageBytes(Request, ProcessingTimer) line: 673    
    DiscoverChannel(SwitchChannel).blockUntilReceiveMessage(ProcessingTimer) line: 1330 
    ReceiveQueuer.run() line: 96    
    Thread.run() line: 662 [local variables unavailable]

Any suggestions/direction on how to debug this type of problem would be appreciated. The previous developer at this company is no longer available to ask. I've been dealing with this specific issue for 2 weeks and cannot find a solution and could really use some help/direction.

Alexis Pigeon
  • 7,423
  • 11
  • 39
  • 44
Melinda
  • 1,501
  • 5
  • 25
  • 58
  • I edited my original message that was put on hold as indicated below. How does my message get modified? Thanks – Melinda Jul 12 '13 at 15:44

1 Answers1

1

It's hard to follow your architecture here, but in general Java web apps should not be spawning threads or working directly with multi-threaded stand-alone apps. I would recommend refactoring the web app so that all of the credit card processing is done within the Java servlets instead of having them go back and forth to a stand-alone app.

Mike Thomsen
  • 36,828
  • 10
  • 60
  • 83
  • Thanks for the reply Mike. Actually this is NOT a web app but a stand alone application that just runs in the background on a Windows 2003 box. I guess I may have confused the issue when I said that I am executing an ISO8583 message via the Discover web app. We are required to utilize their web app to certify on and the web app just has a direct connection to our DEV box via a defined port and it passes the info to our stand alone app. Hope that clarifies. I understand about it being difficult to understand the architecture. I'm trying to understand it myself as this point. Thanks. – Melinda Jul 11 '13 at 18:30