Forums Register Login

Socket Receive error

+Pie Number of slices to send: Send
Hi,
I am integrating java code inside MarkLogic to convert an EBCDIC file to ASCII using MLJAM. Apache Tomcat 7.0 is being used as the server. The code is running fine for small files, but for huge file processing, MarkLogic is throwing an error saying
SVC-SOCRECV: xdmp:http-post("http://10.76.81.81:8080/mljam/mljam/local/eval", adminadmin) -- Socket receive error: wait 10.78.14.16:63085-10.76.81.81:8080: Timeout (decodeResponseLine1)

1. I have tried increasing request timeout , keep alive timeout and session timeout in Marklogic admin console, but that is not working.
2. I tried increasing the -<session-config>
<session-timeout>60</session-timeout>
</session-config> in my apache-tomcat-7.0.57/conf/web.xml
I am not finding any configuration settings in my downloaded Apache Tomcat 7.0.57 to increase any socket timeout or keep alive timeout. Please help me as to where I can find these settings.
Attaching my MarkLogic code and sample input file for reference.
The code inside jam:eval-in('') is pure java code to convert any EBCDIC file (with packed decimals) to ASCII. The code is working fine in Eclipse and the file takes almost 4-5 mins to decode completely, but in MarkLogic after1 min its throwing Socket timeout error.
******************************************************Java code*********************************************
import java.io.*;

int PlusSign = 0x0C;
int MinusSign = 0x0D;
int NoSign = 0x0F;
int DropHO = 0xFF;
int GetLONibble = 0x0F;
int UNSIGNED_BYTE = 0xff;
int BITS_RIGHT = 0xf;
//print("Hello");

String Format = "ebcdic-cp-us";
String FiletoRead="D:/EBCDIC/VipTest1.txt";

InputStreamReader rdr;
InputStreamReader xxr;
int ECBDICChar=0;
try
{
rdr = new InputStreamReader(new FileInputStream(FiletoRead), java.nio.charset.Charset.forName(Format));
xxr= new InputStreamReader(new FileInputStream(FiletoRead));
int i=1;
int mainrecord_size=54;
int record_control_variable_size=4;
int loop_Record_size=25;
int j=1;
int Value_Creator=0;
int x=1;
long comp3_values=0;
String com3posList="";
int comp3_Pos=67;
boolean istranNumber=false;
byte[] byArray = new byte[10];
boolean Comp3LoopStared=false;
while((ECBDICChar = rdr.read()) != -1)
{
int zz=xxr.read();
if ((i>mainrecord_size))
{
if(i<=mainrecord_size+record_control_variable_size)
{
print(zz);
Value_Creator=Value_Creator * 10 + zz;
if(Value_Creator>0)
{
istranNumber=true;
for (int iterator=0;iterator<Value_Creator;iterator++)
{
int value =comp3_Pos+iterator*loop_Record_size;
com3posList+=","+value+",";
}

}
}
}
int vCheck=0;
if((com3posList.contains(","+Integer.toString(i)+",")))
{
if(istranNumber)
{
vCheck=1;
}
}
if((vCheck==1)||Comp3LoopStared)
{
byArray[x-1]= (byte)ECBDICChar;
x++;
Comp3LoopStared=true;
if(x==10)
{
{
long val = 0L;
boolean negative = false;
for (int iter = 0; iter < byArray.length; iter++)
{
int raw = byArray[iter] & UNSIGNED_BYTE;
int digitA = raw >> 4;
int digitB = raw & BITS_RIGHT;
if (digitA < 10) {
val *= 10L;
val += (long) digitA;

} else if (digitA == 11 || digitA == 13) {
negative = true;
}
if (digitB < 10) {
val *= 10L;
val += (long) digitB;

} else if (digitB == 11 || digitB == 13) {
negative = true;
}
}
if (negative)
val = -val;
comp3_values= val;
}
x=1;
print(comp3_values);
Comp3LoopStared=false;
}
}
if((i<mainrecord_size+1)||(i>mainrecord_size+record_control_variable_size))
{
if(!Comp3LoopStared)
{
print((char)ECBDICChar);
}
}
if (j>=mainrecord_size+(Value_Creator*loop_Record_size)+record_control_variable_size)
{
Value_Creator=0;
i=1;
j=1;
istranNumber=false;
//print("''\n");
}

else{
i++;
j++;
}



}
}
catch(Exception EXP)
{
EXP.printStackTrace();
}
Create symphonies in seed and soil. For this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1171 times.
Similar Threads
Alphabet Pyramid (this one!)
Why are finals allowed for method-local classes??
AOOB exception in my CODE-PLEASE HELP!
about ==
Exception -- java.lang.StackOverflowError
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 05:30:38.