SerialPort: inputStream.read blocks, never return -1

I use javax.comm package to transfer files between two virtual com ports (looped)
Send a file from com3, and receive file from com4, but at reciever side, inputStream.read(buffer) never return eveb though I close the outputstream at the sender.
Here is code:
is: serialPort.getInputStream();
os: serialPort.getOutputStream();
//sender:
//fis: FileInputStream
try {
     int i =0;
     while ((counter=fis.read(buffer)) > 0 ){
          fileSize += counter;
          debugInfo(i + ": "+counter + "bytes read");
          os.write(buffer,0,counter);
          i++;
     debugInfo(fileSize + " bytes read totally");
     os.flush();
     fis.close();
     //close os when no file need transfering
     os.close();
} catch(IOException e) {
     e.printStackTrace();
}file receiver
fos: FileOutStream
try {
     int i =0;
     while ((counter=is.read(buffer)) >0){ //blocks and never return
          counter=is.read(buffer);
           fileSize += counter;
           debugInfo(i + ": "+ counter + " bytes read");
           fos.write(buffer,0, counter);
           i++;
debugInfo(fileSize + " bytes write totally");
fos.flush();
fos.close();
debugInfo("fos closed");
is.close();
} catch(IOException error) {
     error.printStackTrace();
}Anything I have done wrong? or anything better solution? Thanks

oops, sorry for copied wrong codes. Thanks for your remind. The second read was used with while (is.availble()), when I post, I forgot to remove it. You are right, if I have read twice, I will not even get the right file, since I only write every second buffer in.
Here I update the receiver, I can get the whole file correctly, but can't get EOF.
//file receiver
//fos: FileOutStream
try {
     while ((counter=is.read(buffer)) >0){ //blocks and never return
          fileSize += counter;
           fos.write(buffer,0, counter);
fos.flush();
fos.close();
is.close();
} catch(IOException error) {
     error.printStackTrace();
}

Similar Messages

  • Bug in the ServerSocket InputStream.read()

    I believe there is a bug in the ServerSocket InputStream.read() method.
    This is demonstrated under Windows XP, running 1.4.0_01-b03
    I am looking for confirmation and an examination of my assumptions for this.
    There is nothing that suggests the InputStream.read() method should block on a EOL, yet it does.
    This is demonstrated with the following code.
    To reproduce uncomment one of the 'Case' sections in the MyServer code. Compile both classes. Run the MyServer then MyClient code.
    The expected result for ALL cases should be
    ***socket start
    text1
    text2
    But for the first case the last line is not printed. Note that for case 3 it does work, and the only exception is that available() is called.
    The InputStream of the server resolves to java.net.SocketInputStream. The read() method calls the read(byte, int, int) method (which how I guessed that calling available would produce different results.)
    //-----------------Client
        import java.io.*;
        import java.net.*;
        public class MyClient
            private MyClient() {}
            static public void main(String argv[])
                try
                    Socket s = new Socket("127.0.0.1", 50080);
                    OutputStream os = s.getOutputStream();
                    String text = "text1\r\ntext2";
                    os.write(text.getBytes());
                    os.flush();  // We know it was sent.
                    // Important!  The socket remains open!
                    while(true)
                        Thread.currentThread().sleep(60 * 1000);
                catch(Throwable e)
                    e.printStackTrace();
    //----------- Server
        import java.net.*;
        public class MyServer implements Runnable
            Socket s;
            public MyServer(Socket s)
                this.s = s;
            static public void main(String argv[])
                try
                    ServerSocket ss=new ServerSocket(50080);
                    while(true)
                        Socket s=ss.accept();
                        Thread t = new Thread(new MyServer(s));
                        t.start();
                catch(Throwable e)
                    e.printStackTrace();
            public void run()
                try
                    System.out.println("***socket start");
                    java.io.InputStream ins=s.getInputStream();
                    // Case 1: Does NOT work
                    int j;
                    while((j=ins.read())!=-1)
                        System.out.write(j);
                    // Case 3: Does work
                    while (true)
                        int len = ins.available();
                        if ((len < 0) || s.isClosed()) break;
                        byte b[] = new byte[len];
                        ins.read(b);
                        for (int i=0; i < len; i++)
                            System.out.print((char)b);
    // Case 3: Does work
    while (true)
    int len = ins.available();
    if ((len < 0) || s.isClosed()) break;
    for (int i=0; i < len; i++)
    int b = ins.read();
    System.out.print((char)b);
    System.out.println("***socket end");
    catch(Throwable e)
    e.printStackTrace();

    System.out is line buffered. (I can only hope that I might have noticed this myself if I had been smart enough to use the same output method.)
    Ok so it isn't a socket problem. But I still don't see anything that documents the behavior.
    System.out is documented as a java.io.PrintStream. And that is actually the class that implements it.
    Nothing in the documentation for PrintStream, the methods, the FilterOutputStream or even OutputStream would suggest the different behavior.
    C works the same way; this never prints "world" on most systems:C works that way because of the way file descriptors work and the way that the buffers for those are handled. And how it works is undefined, a C implementation is allowed to handle it anyway it wants.
    But this Java and not C. That means at a minimum that the behavior must be the same on all OSs. But given that the behavior is not documented then it could be that it is left to the implementation of the C library that the java io library is built upon. And that is not a good thing (in terms of normal java.)
    The following demonstrates the behavior using the two output methods...
          String text = "text1\r\ntext2";
          byte[] b = text.getBytes();
          System.out.println("--- print using print() sleep for 10 secs after");
          for (int i=0; i < b.length; i++)
             System.out.print((char)b);
    Thread.currentThread().sleep(10 *1000);
    System.out.println();
    System.out.println("--- print using write() sleep for 10 secs after");
    for (int i=0; i < b.length; i++)
    System.out.write((int)b[i]);
    Thread.currentThread().sleep(10 *1000);
    System.out.println();
    System.out.println("--- done");

  • Runtime,waitFor and exitValue() methods:child programm never return

    Sorry,my english is really bad!
    i do a programm with tests all the night different java programms.
    I have to compile and after run it.
    My problem is that even if the output and error streams are displayed,each time i have a big programm,the child process always stay blocked.
    I decided to use the dos command ....>>Results.txt to store the datas.
    But the problem is that the wait for and exitvalue methods never returns.

    Hi,
    you must provide a way to read not only the error stream (>>) but also the output stream (>). You can make it from java too. Something like this:
    Runtime rt = java.lang.Runtime.getRuntime();
    Process proc = rt.exec(cmd, null, workdir);
    int inp;
    while ((inp = proc.getInputStream().read()) != -1) {
      System.out.write(inp);
    int err;
    while ((err = proc.getErrorStream().read()) != -1) {
      System.out.write(err);
    proc.waitFor();Best regards,
    Martin

  • BufferedReader.read blocks when wrapping InflaterInputStream

    Hello,
    I'm currently doing client - server communication using http chunked transfer encoding. Furthermore chunks sent are compressed using zlib in sync_flush mode. The client code reads data from an InputStream using the following code snippet:
    URLConnection conn = new URL(anUrl).openConnection();
    BufferedReader reader = new BufferedReader(new InputStreamReader(new InflaterInputStream(conn.getInputStream())));
    int read = 0;
    while ((read = reader.read()) != -1)
      System.out.println((char)read);When running the above code snippet, the client will not read on a per chunk basis, but will block until receiving EOF from server. When using BufferedInputStream instead everything works fine.
    Does anybody know how to overcome this problem?
    Thanks!

    Yes you are right!
    But as i said, using BufferInputStream instead gives an important different behaviour. In this case read doesn't block until the underlying stream receives EOF. The call to read will immediately return bytes when on the server side a chunk of data has been send to the output stream.
    When investigating why BufferedReader blocks, i found that StreamDecoder, a class member of InputStreamReader uses the following code to implement reading from the underlying InflaterInputStream.
      301       int implRead(char[] cbuf, int off, int end) throws IOException {
      315           for (;;) {
      316           CoderResult cr = decoder.decode(bb, cb, eof);
      317           if (cr.isUnderflow()) {
      318               if (eof)
      319                   break;
      320               if (!cb.hasRemaining())
      321                   break;
      322               if ((cb.position() > 0) && !inReady())
      323                   break;          // Block at most once
      324               int n = readBytes();
      325               if (n < 0) {
      326                   eof = true;
      327                   if ((cb.position() == 0) && (!bb.hasRemaining()))
      328                       break;
      329                   decoder.reset();
      330               }
      331               continue;
      332           }
      ...The part that will prevent BufferedReader from not blocking is "!inReady()" at line 322. This method calls, among other things, available on the underlying InflaterInputStream. But as stated there, InflaterInputStream will always return 1 until EOF and "Programs should not count on this method to return the actual number of bytes that could be read without blocking".
    So in my opinion StreamDecoder's implementation won't be able to handle chunked encoding "out of the box".

  • Select count(Key_Field) from table_name never returns

    I am doing some scalability tests and am building a db w/table that will contain 400Million records. I am trying to see how far along I am in the process, and am experiencing this problem.
    The select count(ID) never returns.
    Does anyone have any suggestions for me as to how i might make it perform better? I am not too familiar with such large scale implementations, so any advice would be appreciated, and you can feel free to tell me the most basic info... (I do read docs, etc, but there might be a place I have not yet searched..)
    The hardware is not an issue, at least for my testing, as it is as follows, and I see the IO on the arrays is busy, but not too busy, and that is to be expected, and we are neither CPU or RAM bound.
    SUN E4800
    12 CPUs
    48GB RAM
    2 T3 Arrays (fiber cards on different IO boards)
    4 internal drives (2 on each IO board), not mirrored or RAIDed

    This is always a troublesome type of query.
    Are you trying to count the number of all rows in a table? You can try to ANALYZE the table, then from user_tables select the NUM_ROWS
    I am doing some scalability tests and am building a db w/table that will contain 400Million records. I am trying to see how far along I am in the process, and am experiencing this problem.
    The select count(ID) never returns.
    Does anyone have any suggestions for me as to how i might make it perform better? I am not too familiar with such large scale implementations, so any advice would be appreciated, and you can feel free to tell me the most basic info... (I do read docs, etc, but there might be a place I have not yet searched..)
    The hardware is not an issue, at least for my testing, as it is as follows, and I see the IO on the arrays is busy, but not too busy, and that is to be expected, and we are neither CPU or RAM bound.
    SUN E4800
    12 CPUs
    48GB RAM
    2 T3 Arrays (fiber cards on different IO boards)
    4 internal drives (2 on each IO board), not mirrored or RAIDed

  • SAXParser.parse never returns!

    I'm using sockets to transfer xml data. When I feed my InputSource (containing the xml document) into the SAXPaser.parse method I can see the events being fired correctly (ie: startDocument, characters, startElement,etc) apart from the endDocument event. The parse method is executing all my code but it never returns! What should cause it to return? Do I need to close the socket connection or should it recognise when it has reached the final closing element?

    I couldn't find that exact implementation but I looked into the crimson version and it reads until it hits an EOF. It's a reasonable guess that the xerces version does the same. I think it has to read in the whole file becasue it cannot tell whether the document is well-formed otherwise.

  • MobileService.SyncContext.PushAsync never returns in Release build

    I am currently trying to create a windows phone app with azure mobile services but somehow offline sync is not working. When I create a release build and call await SyncContext.PushAsync() it never returns back to the context.
    I dont really know what is happening,
    Code:
     await App.MobileService.SyncContext.PushAsync();
     return true;
    When I run a debug build everything works fine.
    I can't understand, whats happening in Release mode?
    Its a very urgent. Please provide a quick solution or setup a call with me.
    Thanks,
    Hema
    hema

    Thank you for the answer, I added HttpMessageHandler to check which operation was causing the problem and a IMobileServiceSyncHandler, as I mentioned earlier when there is nothing to Push the syncing work fine and the pull can be made, but when the push
    needs to send data the request passes by OnPushCompleteAsync and does not get to the LoggingHandler.SendAsync or to the ExecuteTableOperationAsync and on the Output console I can see the following exceptions are thrown but the PushAsync does not fail and never
    ends.
    A first chance exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.ni.dll
    A first chance exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.ni.dll
    A first chance exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.ni.dll
    A first chance exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.ni.dll
    A first chance exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.ni.dll
    A first chance exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.ni.dll
    A first chance exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.ni.dll
    The thread 0x1080 has exited with code 259 (0x103).
    About the UI, this operation is triggered by the user (button) and is handle in an ICommand in a way that can only be triggered once and locked from other processes with a SemaphoreSlim, I add a little part of the sync code.
    await this.MobileServiceClient.SyncContext.PushAsync(cancellationToken);
    var query = SyncItemTable.CreateQuery().Where(syncItem => syncItem.UserId == userId);
    await SyncItemTable.PullAsync("PullSyncItem", query, true, cancellationToken);
    I am using the nugets WindowsAzure.MobileServices, 1.3.1 and WindowsAzure.MobileServices.SQLiteStore, 1.0.1
    I appreciate a quick response this is a stopper bug for the next release of our application.

  • Message: "Adobe Reader blocked for this website"

    When I try to open a pdf file a message appears "Adobe Reader blocked for this website". i then click the little arrow and another window pops up and it reads: "Do you want to trus the website www.........com to use the Adobe Reader plug in? And when I click "Trust" I can then move on to my PDF Download. This was never an issue before and wonder how I can rectify this? Does it have something to do with a 'plug in'?

    What browser?  On what OS?

  • ReadLine() never returns even if SOTimeout is used

    Hi,
    I've run into a strange and (for me) hard to solve problem in my multi-threaded app which is IO intensive. After calling bufferedReader.readLine(), the tthread never returns from the call. I took a few thread dumps with a few seconds interval and the thread seems to be "popping around". Below are 6 dumps of the failing thread. I have socket.setSoTimeout(10000), but seems to have no effect in this situation. Any help would be much appreciated.
    I'm running jdk1.4.2_05 on Windows XP
    Bye,
    Dag.
    "runner4" prio=5 tid=0x02ddb500 nid=0xfc8 runnable [39df000..39dfd8c]
            at java.nio.HeapByteBuffer.compact(Unknown Source)
            at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source)
            at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
            at sun.nio.cs.StreamDecoder.read(Unknown Source)
            - locked <0x10666590> (a java.io.InputStreamReader)
            at java.io.InputStreamReader.read(Unknown Source)
            at java.io.BufferedReader.fill(Unknown Source)
            at java.io.BufferedReader.readLine(Unknown Source)
            - locked <0x10666590> (a java.io.InputStreamReader)
            at java.io.BufferedReader.readLine(Unknown Source)
            at MyClass.someMethod(MyClass.java:100)
    "runner4" prio=5 tid=0x02ddb500 nid=0xfc8 runnable [39df000..39dfd8c]
            at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
            at sun.nio.cs.StreamDecoder.read(Unknown Source)
            - locked <0x10666590> (a java.io.InputStreamReader)
            at java.io.InputStreamReader.read(Unknown Source)
            at java.io.BufferedReader.fill(Unknown Source)
            at java.io.BufferedReader.readLine(Unknown Source)
            - locked <0x10666590> (a java.io.InputStreamReader)
            at java.io.BufferedReader.readLine(Unknown Source)
            at MyClass.someMethod(MyClass.java:100)
    "runner4" prio=5 tid=0x02ddb500 nid=0xfc8 runnable [39df000..39dfd8c]
            at sun.nio.cs.SingleByteDecoder.decodeArrayLoop(Unknown Source)
            at sun.nio.cs.SingleByteDecoder.decodeLoop(Unknown Source)
            at java.nio.charset.CharsetDecoder.decode(Unknown Source)
            at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
            at sun.nio.cs.StreamDecoder.read(Unknown Source)
            - locked <0x10666590> (a java.io.InputStreamReader)
            at java.io.InputStreamReader.read(Unknown Source)
            at java.io.BufferedReader.fill(Unknown Source)
            at java.io.BufferedReader.readLine(Unknown Source)
            - locked <0x10666590> (a java.io.InputStreamReader)
            at java.io.BufferedReader.readLine(Unknown Source)
            at MyClass.someMethod(MyClass.java:100)
    "runner4" prio=5 tid=0x02ddb500 nid=0xfc8 runnable [39df000..39dfd8c]
            at java.nio.CharBuffer.<init>(Unknown Source)
            at java.nio.HeapCharBuffer.<init>(Unknown Source)
            at java.nio.CharBuffer.wrap(Unknown Source)
            at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
            at sun.nio.cs.StreamDecoder.read(Unknown Source)
            - locked <0x10666590> (a java.io.InputStreamReader)
            at java.io.InputStreamReader.read(Unknown Source)
            at java.io.BufferedReader.fill(Unknown Source)
            at java.io.BufferedReader.readLine(Unknown Source)
            - locked <0x10666590> (a java.io.InputStreamReader)
            at java.io.BufferedReader.readLine(Unknown Source)
            at MyClass.someMethod(MyClass.java:100)
    "runner4" prio=5 tid=0x02ddb500 nid=0xfc8 runnable [39df000..39dfd8c]
            at java.nio.CharBuffer.wrap(Unknown Source)
            at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
            at sun.nio.cs.StreamDecoder.read(Unknown Source)
            - locked <0x10666590> (a java.io.InputStreamReader)
            at java.io.InputStreamReader.read(Unknown Source)
            at java.io.BufferedReader.fill(Unknown Source)
            at java.io.BufferedReader.readLine(Unknown Source)
            - locked <0x10666590> (a java.io.InputStreamReader)
            at java.io.BufferedReader.readLine(Unknown Source)
            at MyClass.someMethod(MyClass.java:100)
    "runner4" prio=5 tid=0x02ddb500 nid=0xfc8 runnable [39df000..39dfd8c]
            at sun.nio.cs.StreamDecoder.read(Unknown Source)
            - waiting to lock <0x10666590> (a java.io.InputStreamReader)
            at java.io.InputStreamReader.read(Unknown Source)
            at java.io.BufferedReader.fill(Unknown Source)
            at java.io.BufferedReader.readLine(Unknown Source)
            - locked <0x10666590> (a java.io.InputStreamReader)
            at java.io.BufferedReader.readLine(Unknown Source)
            at MyClass.someMethod(MyClass.java:100)

    The SoTimeout times out the connect if the connect to
    the other end is lost.No it doesn't, it has no effect on the connect timeout.
    This does not mean it is triggered just because you
    have recieved no data.Yes it does, this is exactly what it does.
    The following program works for me, i.e. it throws an InterruptedIOException:
    import java.io.*;
    import java.net.*;
    public class SocketReadLineTest
         ServerSocket     ss;
        public SocketReadLineTest() throws IOException
              this.ss = new ServerSocket(0);
        public static void main (String args[]) throws Exception
              SocketReadLineTest t = new SocketReadLineTest();
              Socket     s = new Socket("localhost",t.ss.getLocalPort());
              s.setSoTimeout(1000);
              BufferedReader     r = new BufferedReader(new InputStreamReader(s.getInputStream()));
              String     l = r.readLine();
              s.close();
    }It also works as expected (i.e. reads null) if the server closes the accepted socket immediately without sending anything.

  • I add a timeout for InputStream read().

    I am looking for a timeout for InputStream read() since Java doesn't support it. I use a Timer class to handle the timeout value and put the InputStream.read() into another thread. When the time is up, the Timer object will stop the thread of reading. What do you think about this solution? Do you have any other better solution?
    thanks

    and any ideas on how to stop this blocking read() method from an InputStream (Java 5)???? When googling on this topic I find an incredible amount of questions on this subject BUT no solutions. What to do?? I'm a little bit affraid it comes down to hacking the JVM finding the Thread in some memory block and removing it with brute force.
    hmmm when I think of it, it's really driving my crazy.... the only thing I can think of is throwing my PC out of the window and buy a new one. Unfortunately there's no budget for that it will cost to many PCs :-)
    Edited by: R_e_n_s on Jun 3, 2008 6:45 AM

  • Closing InputStream / InputStream Reader

    Hello,
    I need suggestion regarding closing InputStream / InputStream Reader.
    If I have these two lines of code below:
    InputStream inStream = ...;
    InputStreamReader inStreamReader = new InputStreamReader (inStream );Is it necessary to do both:
    inStream.close();
    inStreamReader.close();I can't confirm but some people say that it is necessary only to do inStreamReader.close() and inStreamReader#close will do inStream#close as well.
    Could somebody please advise?
    Thanks.

    read the close method on inputStream
    [url=http://java.sun.com/j2se/1.5.0/docs/api/java/io/I
    nputStream.html#close()]here. its kind offunny.
    Interesting,
    I've never noticed that before.
    So, InputStream#close method is not necessary at all, isn't it?
    Thanks for the lead Brigand,

  • Iscsiadm never returns after upgrading to Solaris10 U4

    After upgrading to Solaris10 U4, iscsiadm stopped working.
    Even calling iscsiadm without any parameter, the help message is displayed but the command never returns.
    I cannot list my discovery address, neither add new ones.
    I tried to reinstall SUNWiscsir and SUNWiscsiu without changes.
    Does anybody else experienced this problem?
    Thanks
    Marco

    We had the same problem but in X86 server with Solaris 10 Update 3. Sun support provided a library file libima.so.1 and replaced the old library with the one that Sun provided and everything went fine.
    If you have support contract from Sun you could ask for a copy of it.

  • ExecuteUpdat methode never returns

    I m using OCI Driver with Connection Poolig..Weblogic 11g,Oracle 11g . I found that the executeUpdate method never returns, every 1 out of 100 times, approximately.
    I m calling a procedur from Java,which only inser the insert data,in procedure for tracking I m inserting in one table and that procedure is "PRAGMA AUTONOMOUS_TRANSACTION".Please help me.
    And the thead stack is below
    "[STUCK] ExecuteThread: '81' for queue: 'weblogic.kernel.Default (self-tuning)'" RUNNABLE native
         oracle.jdbc.driver.T2CStatement.t2cParseExecuteDescribe(Native Method)
         oracle.jdbc.driver.T2CCallableStatement.executeForDescribe(T2CCallableStatement.java:482)
         oracle.jdbc.driver.T2CCallableStatement.executeForRows(T2CCallableStatement.java:727)
         oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
         oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
         oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3657)
         oracle.jdbc.driver.OracleCallableStatement.executeUpdate(OracleCallableStatement.java:4739)
         oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1350)
         weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:172)
         com.infotech.kastle.lending.interfaces.core.databaseUtils.InterfaceDAO.saveForLogging(InterfaceDAO.java:460)
         com.infotech.kastle.lending.interfaces.handlers.externalSystems.Simah_CommonResponseHandler.processCommonResponse(Simah_CommonResponseHandler.java:93)
         com.infotech.kastle.lending.interfaces.handlers.externalSystems.Simah_CreditReportHandler.mainProcessing(Simah_CreditReportHandler.java:1188)
         com.infotech.kastle.lending.interfaces.handlers.externalSystems.Simah_CreditReportHandler.processRequest(Simah_CreditReportHandler.java:92)
         com.infotech.kastle.lending.interfaces.handlers.externalSystems.Simah_CreditReportHandler.startHandler(Simah_CreditReportHandler.java:74)
         com.infotech.kastle.lending.interfaces.core.InterfaceManager.executeServices(InterfaceManager.java:314)
         com.infotech.kastle.lending.interfaces.core.InterfaceManager.executeServices(InterfaceManager.java:288)
         com.infotech.kastle.lending.interfaces.core.databaseUtils.DBUtils.callingSimahCreditReport(DBUtils.java:1367)
         com.infotech.kastle.lending.interfaces.core.databaseUtils.DBUtils.InterfaceTrigger(DBUtils.java:2004)
         com.infotech.kastle.lending.interfaces.core.databaseUtils.DBUtils.checkInterfaceFiringForCust(DBUtils.java:1823)
         com.infotech.kastle.lending.action.corporate.BasicInfoISAction.execute(BasicInfoISAction.java:581)
         org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         com.infotech.kastle.lending.filter.UTF8EncodingFilter.doFilter(UTF8EncodingFilter.java:70)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         weblogic.work.ExecuteThread.run(ExecuteThread.java:176)

    I m using OCI Driver with Connection Poolig..Weblogic 11g,Oracle 11g . I found that the executeUpdate method never returns, every 1 out of 100 times, approximately.
    I m calling a procedur from Java,which only inser the insert data,in procedure for tracking I m inserting in one table and that procedure is "PRAGMA AUTONOMOUS_TRANSACTION".Please help me.
    And the thead stack is below
    "[STUCK] ExecuteThread: '81' for queue: 'weblogic.kernel.Default (self-tuning)'" RUNNABLE native
         oracle.jdbc.driver.T2CStatement.t2cParseExecuteDescribe(Native Method)
         oracle.jdbc.driver.T2CCallableStatement.executeForDescribe(T2CCallableStatement.java:482)
         oracle.jdbc.driver.T2CCallableStatement.executeForRows(T2CCallableStatement.java:727)
         oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1315)
         oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
         oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3657)
         oracle.jdbc.driver.OracleCallableStatement.executeUpdate(OracleCallableStatement.java:4739)
         oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1350)
         weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:172)
         com.infotech.kastle.lending.interfaces.core.databaseUtils.InterfaceDAO.saveForLogging(InterfaceDAO.java:460)
         com.infotech.kastle.lending.interfaces.handlers.externalSystems.Simah_CommonResponseHandler.processCommonResponse(Simah_CommonResponseHandler.java:93)
         com.infotech.kastle.lending.interfaces.handlers.externalSystems.Simah_CreditReportHandler.mainProcessing(Simah_CreditReportHandler.java:1188)
         com.infotech.kastle.lending.interfaces.handlers.externalSystems.Simah_CreditReportHandler.processRequest(Simah_CreditReportHandler.java:92)
         com.infotech.kastle.lending.interfaces.handlers.externalSystems.Simah_CreditReportHandler.startHandler(Simah_CreditReportHandler.java:74)
         com.infotech.kastle.lending.interfaces.core.InterfaceManager.executeServices(InterfaceManager.java:314)
         com.infotech.kastle.lending.interfaces.core.InterfaceManager.executeServices(InterfaceManager.java:288)
         com.infotech.kastle.lending.interfaces.core.databaseUtils.DBUtils.callingSimahCreditReport(DBUtils.java:1367)
         com.infotech.kastle.lending.interfaces.core.databaseUtils.DBUtils.InterfaceTrigger(DBUtils.java:2004)
         com.infotech.kastle.lending.interfaces.core.databaseUtils.DBUtils.checkInterfaceFiringForCust(DBUtils.java:1823)
         com.infotech.kastle.lending.action.corporate.BasicInfoISAction.execute(BasicInfoISAction.java:581)
         org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         com.infotech.kastle.lending.filter.UTF8EncodingFilter.doFilter(UTF8EncodingFilter.java:70)
         weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         weblogic.work.ExecuteThread.run(ExecuteThread.java:176)

  • I use Safari as my browser. When on a site and I click on a PDF file I get a black screen and a notice that "Adobe Reader blocked for this website". However, this does not happen if I use Firefox.

    I use Safari as my browser. When on a site and I click on a PDF file I get a black screen and a notice that "Adobe Reader blocked for this website". However, this does not happen if I use Firefox.

    Back up all data before making any changes. Please take each of the following steps until the problem is resolved.
    Step 1
    If Adobe Reader or Acrobat is installed, and the problem is just that you can't print PDF's displayed in Safari, you may be able to print by moving the cursor to the the bottom edge of the page, somewhere near the middle. A black toolbar may appear under the cursor. Click the printer icon.
    Step 2
    There should be a setting in its preferences of the Adobe application such as Display PDF in Browser. I don't use those applications myself, so I can't be more precise. Deselect that setting, if it's selected.
    Step 3
    If you get a message such as ""Adobe Reader blocked for this website," then from the Safari menu bar, select
    Safari ▹ Preferences... ▹ Security
    and check the box marked
    Allow Plug-ins
    Then click
    Manage Website Settings...
    and make any required changes to the security settings for the Adobe PDF plugin.
    Step 4
    Triple-click anywhere in the line of text below on this page to select it, the copy the selected text to the Clipboard by pressing the key combination command-C:
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, move to the Trash any items that have "Adobe" or “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari.
    Step 5
    The "Silverlight" web plugin distributed by Microsoft can interfere with PDF display in Safari, so you may need to remove it, if it's present. The same goes for a plugin called "iGetter," and perhaps others — I don't have a complete list. Don't remove Silverlight if you use the "Netflix" video-streaming service.
    Step 6
    Do as in Step 3 with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari.

  • Why can't InputStream.read() be interrupted?

    I have a native application that launches a java application. To allow for the communication between the two applications, the native app launches the java app with stdin and stdout redirected to a file handles. The Java application creates a thread to read from System.in. Everything works great -- UNTIL . . .
    . . . the native app closes the communcation handles and exits, leaving the java application blocking on the InputStream.read().
    My question is why doesn't the blocking InputStream.read() get interrupted when the communcation handle in the native app closes? This appears to be a BUG in Java. I would expect to get an exception or error on the read when the handle on the other sides exits.
    My ideas to work around this would include changing the IPC communcation to a network protocol like sockets, or MMF. However, redirecting stdin and stdout seemed to be the simpliest IPC. Any other ideas or suggestions?
    Cheers,
    Kyley

    Thanks for all your replies. Hearing others express the same idea that it should work the way that I had thought made me revisit how the native application was launching the application and how the handles were redirected.
    After getting things working on UNIX (Sun Solaris), I looked again at the code (which I didn't write) that launched the java application on Windows. After rewriting the code, the original code wasn't duplicating stdin & stdout and closing one of the original handles. Once that was done properly, AMAZINGLY everything worked as I had intended it to work.
    Thanks again for the time to reply.
    Kyley

Maybe you are looking for

  • Help, my mini REFUSES to shut down/restart

    Hey guys. I'm looking for some help figuring out what is making my mini hang on shut down. My icons all dissappear and then I just see the osx backdrop. From there the system refuses to take any keyboard input, though I can move the mouse around. It

  • Need information on XPress & CPO Central

    Hi All, I have below doubts on the Xpress and CPO section of SAP Sourcing 7.0:- 1>CPO:- Is CPO Central functioanlity a part of Sourcing installable or I need to buy seprate business object to get the Xcelsius Template for the dashboard. In my SAP Sou

  • QM-inspection type

    Dear all i have assign 2 inspection types 05 and 08 for a raw material.now please guide me when lot 'll be triggered by 08 type and when with 05. because i have a con fusion that when we make stock transfer by a movement type then inspection lot 'll

  • Error - could not reserve record

    This is in oracle forms 10G/win xp I am getting this message: Could not reserve record (2 tries). Keep trying? The code that causing this error: select count(*) into :blk.recordcount from mytable where xid= :blk2.xid;The field is updateable. When I r

  • Trend Micro Internet Security Scan

    I keep getting messages from the Trend Micro Internet Security that came installed on my Dell Studio. Every other boot or so it says there has not been a scan for "days"...and shows the last scan as 1/29/09. The message is that "Trend Micro needs you