Why can't my Java web service work with my Perl backend?

In our project, a Java web service interacts with a program written in C and Perl for processing. We are using ProcessBuilder to execute the backend (UNIX) job FrameworkHandler.

ProcessBuilder process;
process.Start(FrameworkHandler -a ACTION)

      

FrameworkHandler calls Perl script to do some action. The Perl script internally runs a diff command between the two XML files and uses the print function to print the error:

sub print_error
{
    $err_msg = shift;
    print STDERR "$err_msg\n";
}

      

Whenever there is a difference between files, the Perl program hangs in the print_error function. If we run a Perl program in a UNIX shell, it works without any problems. But if we execute Perl via webservice, it won't return after diff command. Therefore, the web service does not return a response either. Are large (>) characters in XML tags problematic?

Any help is greatly appreciated.

Part of the error:


< diff -udr --new-file --label=postProcess1 --label=postProcess2 postProcess1 postProcess2
< --- postProcess1
< +++ postProcess2
< @@ -124,6 +124,36 @@
<               <LOCATION></LOCATION>
<               <ADDRESS_PART1>Test Address ^D</ADDRESS_PART1 >
<         </address_details>
< +       <address_details>
< +             <CITY></CITY>
< +             <STATE>12</STATE>

      


Thanks, Matthew Liju

0


source to share


1 answer


The API docs say:

"Because some proprietary platforms provide limited buffer sizes for standard input and output streams, not being able to quickly write an input stream or read a subprocess output stream can cause the subprocess to block and even deadlock."



Are you performing?

+3


source







All Articles