Hi,

The socket receive error still persists. Here is what I am doing.

I am integrating a 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, 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 installer to increase any socket timeout 
or keep alive timeout. Please help me as to where I can find these settings.

The code is working fine in Eclipse and the file takes almost 4-5 mins to 
decode completely, but in MarkLogic before 1 minute its throwing Socket timeout 
error.



FYI



I tried testing the Apache connection by  executing my marklogic code before 
starting the Apache Server.  I received a



SVC-SOCCONN: xdmp:http-post("http://10.76.81.81:8080/mljam/mljam/local/eval";, 
<options 
xmlns="xdmp:http"><authentication><username>admin</username><password>admin</passw...</options>)
 -- Socket connect error: wait 0.0.0.0:60587: Timeout



This error vanishes when I start my Apache server. The error I am receiving on 
file processing indicates some SOCRECV error and hence I am deducting that the 
java code is getting timed out at the server.

Also the Marklogic database is not used anywhere. I am picking up a file from 
my local directory.



Apache tomcat is running on my machine while the ML is hosted on a server. 
Please guide as to how to resolve this timeout error .



My ML code is as below

********************************************************************************************************************



import module namespace jam = "http://xqdev.com/jam";

at "jam.xqy";

jam:start-in("http://10.76.81.81:8080/mljam/mljam";, "admin", "admin", "local"), 
jam:eval-in('{



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/CharTest1.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] &amp; UNSIGNED_BYTE;

                  int digitA = raw >> 4;

                                                                                
                        int digitB = raw &amp; 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();

}



       } ',"local"),

jam:get-stdout-in("local"),

jam:end-in ("local")



*************************************************************************************************************************





Thanks,

Vipitha


**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are 
not
to copy, disclose, or distribute this e-mail or its contents to any other 
person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has 
taken
every reasonable precaution to minimize this risk, but is not liable for any 
damage
you may sustain as a result of any virus in this e-mail. You should carry out 
your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this 
e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to