Closing socket connection from 2nd thread

I did some research on different operating systems to find a unique solution how to timeout a blocking recv call in one thread.
Closing the connection from another thread helps but I found that there are two different methods how to close the connection:
- either just calling close with the correct linger options
- call shutdown first and then close
Unfortunately most platforms work fine with only one of these methods and fail more or less severe with the other method.
While I think to fully understand the behavior of Windows and Linux, Solaris is still a big question mark for me.
I have some machines (running Solaris 8, 7 and 2.6) which work well with just closing and crash the system when using shutdown (while having bad luck in the timing of the other peer). And I have another 2.6 machine that behaves the other way around.
I created a detailed description about the whole problem and my findings in a PDF if you are interested: http://www.webwasher.com/download/notes/timeoutblockingsocketcall.pdf
Is anybody able to explain how the Solaris implementation works here?
And does anybody know why I see the differences with the two 2.6 boxes? (I changed patch level and exchanged clib without success.
Martin

I have a main program which creates a thread.Why not create a thread once the object has been read.
The thread would take some time to process this
object before it accepts another object to be passed
in from the main program.Threads are used for concurrent execution. If you don't want concurrent execution, don't use additional threads. Have the main program do the reading and execution and then it cannot read another object until it has finished executing the previous one.
>
However, I realise that my main program:
s = new Socket("localhost", 2001);
will produce a socket connection
socket connection even if the thread is still
processing the object. Why is this possible?This is what threads do. It is call multi-threading.
Initially I thought the thread would lock the socketIt will lock the sockect when you lock it with synchronized. Howver you are creating a new socket each time so even this would not do what you suggest.
and my main program would not be able to get a socket
connection until my thread releases the socket.Everytime you call new Socket() it creates a NEW socket. You can open as many socket as the server can handle. (10000+)
Code in my thread to accept a socket connection:
server = new ServerSocket(2001);
ois = new ObjectInputStream(server.accept().getInputStream());I would suggest putting the Socket created by server.accept() into a variable. Otherwise you will not be able to reply to the request, nor will you be able to close() the connection.
How can I workaround this issue. Hope somebody can help. Thanks.You don't need a workaround, you need to fix the logic of your application.

Similar Messages

  • Initiating a Socket Connection from the Applet in the html

    Hi
    i have a applet code as follows that listens for multicast messages. ...
    this works fine when i start it in the applet viewer (multicating server is in the same system)
    when i access the same through the html pages /// it gives an exception java.security.exception.Accessdenied ..................
    any idea to solve this is most appriciated ......
    Regards
    Venkat
    public class MyApplet extends Applet implements Runnable  {
         private static String group = "224.5.6.7"; 
         private static int port = 5000;
         private static MulticastSocket s;
         private static DatagramPacket pack;
         private static String msg = "Applet Started";
         public MyApplet() {
              super();
         public void destroy() {
         public String getAppletInfo() {
              return "This is my default applet created by Eclipse";
         public void init() {
              try{
              s = new MulticastSocket(port);
              catch(Exception e)
         public void start() {
                        try {
                             s.joinGroup(InetAddress.getByName(group));
                             Thread t  = new Thread((Runnable) this);
                             t.start();
                        } catch (UnknownHostException e) {
                             e.printStackTrace();
                        } catch (IOException e) {
                             e.printStackTrace();
         public void stop() {
         public void run()
              try{
                   byte buf[] = new byte[1024];
                   pack = new DatagramPacket(buf, buf.length);
                   while(true){
                   Thread.sleep(100);
                   s.receive(pack);
                   msg = ("Received data from: " + pack.getAddress().toString() +
                                                ":" + pack.getPort() + " with length: " + pack.getLength());
                   msg = msg +  new String(pack.getData(),0,pack.getLength());
                   repaint();
              catch(Exception e)
                   System.out.println(e.toString() + "from run");
         public void paint(Graphics g) {
             g.drawString(msg,0,10);
    [/code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I agree, when you run it in the applet viewer you use a special policy.
    http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
    second post and last post for the java class file
    If that didn't solve your problem than a full trace would be nice:
    To turn the full trace on (windows) you can start the java console, to be found here:
    C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
    In the advanced tab you can fill in something for runtime parameters fill in this:
    -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
    if you cannot start the java console check here:
    C:\Documents and Settings\userName\Application Data\Sun\Java\Deployment\deployment.properties
    I think for linux this is somewhere in youruserdir/java (hidden directory)
    add or change the following line:
    javaplugin.jre.params=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    for 1.5:
    deployment.javapi.jre.1.5.0.args=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    The trace is here:
    C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log
    I think for linux this is somewhere in youruserdir/java (hidden directory)
    Print out the full trace of the exception:
    try{...}catch(Exception e){e.printStackTrace();}

  • Too many open socket connections causing ColdFusion to crash?

    I’m currently working on an e-commerce site which sends and receives information to/from the client’s order management system via XML over a TCP/IP socket.  It uses a very old java-based custom tag called CFX_JSOCKET (which appears to have been written in 2002) to open the socket, send the data, and get the response.  The code that calls the custom tag and sends/receives data from the OMS pre-dates my working on the site, but its always worked, so I haven’t paid it much attention.
    Back in the summer of 2009 we started experiencing issues with ColdFusion (v.7 on Window 2003 at the time) locking up on a more and more frequent basis, until it ultimately became a daily issue.  After extensive research we narrowed the issue down to the communication between the web server and our client’s order management server.  It seemed the issue with ColdFusion hanging was either related to there being too many connections open, or to these connections hanging and resulting in dead threads.  This an educated guess based on a blog post I’d seen online, not actual monitoring of either CF or the TCP/IP connections.  As soon as we dialed back the timeout on the CFX_JSOCKET tag from 20 seconds to 10, the issue disappeared, so we left it at that and moved on.
    Fast forward to this January. The site is hosted at a new location, on a 64-bit Windows 2008 box running ColdFusion 9.  Over the years traffic on the site has continued to grow.  The nature of the clients business means that August and January are their business times of the year (back to school for college kids) and in January ColdFusion once again started locking up on an almost-daily basis.  
    One significant difference is that the address cleansing software that previously ran on the box and was used to verify shipping addresses is not available for 64-bit, so when we moved to the new server last summer, that task was moved to the client’s order management software and handled via XML like all other interaction with that system. However, while most XML calls to that server (order input, inventory check, etc) take under a second to complete, the address cleansing call regularly takes over 5 seconds to return data, and frequently times out. 
    Once we eliminated the address cleansing call from the checkout process, ColdFusion once again stopped locking up regularly.  So it appears that once again it’s the communication between the web server and the order management server that’s causing problems. We currently have that address cleansing call disabled on the web site in order to keep ColdFusion from crashing, but that’s not a long term solution.
    We don’t have, nor can I find online, the source code for the CFX_JSOCKET custom tag, so I decided I’d write some CF code utilizing the java methods to open the socket, send the data, get the response, and close the connection.  My test code is working fine (under no load).  However, in trying to troubleshoot an issue I had with it, I started monitoring the TCP/IP connections using TCPView.  And I noticed that all the connections to the order management server, whether opened via the custom tag or my new code, remain open in either a TIME_WAIT or FIN_WAIT2 status for well over 2 minutes, even though I know for a fact that my new code is definitely closing the connection from the web server side. 
    They do all close eventually, but I’m wondering 1. Why they’re remaining open that long; 2. Is that normal; and 3. If all these connections remaining open could be what’s causing ColdFusion to choke. 
    Does this sound plausible?  If so, does anyone have any suggestions/recommendations about how to fix it?  My research seems to indicate this might be a matter of the order management system not closing the connection on its end, but I’m in way over my head, and before I go to client and tell them it’s their OMS causing the issue, I need to feel a little more confident that I’m on the right track. 
    Any help or advice would be very greatly appreciated.  And thanks for taking the time to read through my long-winded explanation of the problem.
    Set-up details:
    ColdFusion Version: 9,0,0,251028  Standard 
    Operating System: Windows Server 2008 
    Java Version: 1.6.0_14 
    Java VM Name: Java HotSpot(TM) 64-Bit Server VM 
    Java VM Version: 14.0-b16 
    Thanks,
    Laurie

    Hi Laurie,
    Not aware of custom tag called CFX_JSOCKET. I guess the process you described very well is consuming a resource then you are getting a problem. Trick is what parameter to adjust. Perhaps you are running out of one the threads in CFadmin > Server Settings > Request Tuning.
    I expect if you enable CF Metrics logging where you can log the threads and other resources then you can find out which parameter needs adjusting. Let me know if you want some details on enabling CF Metrics. Perhaps others will have much better idea than me and help without the overhead of logging.
    The other interesting thing is you are using CF9.0.0. Do you have some reasons for not being on updater1 CF9.0.1?
    HTH, Carl.
    PS I posted before however seems to have gone, just hope does not come back and then I have posted twice.

  • How to retain socket connection for multiple requests in java 1.3

    Hi All,
    My problem is to retain client socket connection without opening and closing socket connection for every request.I want to open the socket connection once and send multiple requests one after the other based upon the response over the same socket.Finally I want to close the socket only after completing all my requests and receiving respective responses.I don't want to open and close the socket for each request and response.While at the same time I expect the socket to send each request only after receiving the response for the previous request.
    I am using java 1.3 and I am looking for the solution in same version.
    Please help me .
    Thanx in advance.

    Look at my response to "Telnet to Unix box from Java"
    http://forum.java.sun.com/thread.jsp?forum=31&thread=437231
    on "Java Programming" forum. It does exactly that to run the signon and a command. It would be easy to extend it to do multiple commands.

  • Multiple socket connections with MIDP

    dear experts,
    I have a simple problem and I hope someone can help me to solve it.
    I need to open a socket connection from multiple MIDlets on the same port.
    This error occours when I try to make a socket push registration from the second (or third, or fourth...) midlet (I'm able to connect to the socket correctly from the first midlet that makes a push registration):
    PushProcessor.run Exceptionjava.io.IOException: ServerSocket Open
    java.io.IOException: ServerSocket Open
         at com.sun.midp.io.j2me.serversocket.Socket.open(+39)
         at com.sun.midp.io.j2me.socket.Protocol.openPrim(+127)
         at javax.microedition.io.Connector.openPrim(+121)
         at javax.microedition.io.Connector.open(+15)
         at javax.microedition.io.Connector.open(+6)
         at javax.microedition.io.Connector.open(+5)
         at it.myprj.midp.BasicPushMIDlet$PushProcessor.run(+16)
    I would know if push registry API allows to have multiple connection on the same socket port.
    any help is appreciated!
    giovanni

    in my opinion,
    due to the fact when an app binds one port and a second app tries to bind the same (@same time) there will ever be a exception (from my point of view)!
    an no i think that push registry cant register two apps on same port (eg datagram://5060)
    hope this helps
    chris

  • Studio Creator, Socket Connection to External Device

    I am porting an existing & successful project from Netbeans 3.6 into Studio Creator to take advantage of some of the tools in the IDE for this application. The project requires opening a socket connection from the Server PC to an external Device (PLC) that is a Client on a static IP & a dedicated fixed port.
    I am struggling to get past some security settings specific to AccessControlExceptions. Here is the code method being used to test:
    public String button1_action() {
    // Call methods to open connection, init streams, send command, and close connection.
    try {
    // Open Socket up and accept client connection
    ipSocketObject = new ServerSocket(port);
    bfSocket = ipSocketObject.accept();
    // Establish Streams
    is = new BufferedReader(new InputStreamReader(bfSocket.getInputStream()));
    os = new PrintWriter(bfSocket.getOutputStream(), true);
    System.out.println("Got to here...");
    // Clear the msCounter #13002
    os.println("r13002=0");
    pattern = "13002";
    do{ret=is.readLine();} while ((ret.indexOf(pattern)) ==-1);
    is.close();
    os.close();
    bfSocket.close();
    ipSocketObject.close();
    } catch (IOException e) {
    e.printStackTrace();
    return null;
    The Socket Connection is established, but the command string is not processed before Studio Creator generates a AccessControlException Fault. I have experiemented putting in a SocketPermission statement with out success.
    Is anyone aware of some sample code I might be able to review for opening socket connections to clients in a Studio Creator Application? Please excuse this request if too rudimentary- I am an Industrial Controls guy by trade... :)

    Sorry I know of no such application at this time, and unfortunately have not done socket work myself for many moons....
    What JDK was your previous application written under? I googled for AccessControlException and socket and seems that sometimes accounts for some issues... you can also search for that combination in the forum advanced search and might find something there.... one more long shot suggestion based upon your statement "the command string is not processed".... could it be that you need to flush the stream...?
    Sorry I don't have more to offer...
    v

  • Java Socket Connectivity

    Hello,
    i have created a server application that accepts socket connection from clients. Is there any way to determine from the server application if a client socket is still connected?
    Thanks in advance
    prasanna

    Inside your reading of the data from the client, you should at least set some sort of var to isAlive, if you read -1 bytes from the client. That's the disconnect response from the client. I've also noticed that if you check if socket == null, that will work. When the client disconnects it sets it back to null.
    -fetichico

  • TCP Socket connection in CLOSE_WAIT status and not getting closed

    I am facing an issue with the TCP socket connections not getting closed and they are in CLOSE_WAIT status for ever.
    As a part of batch process in our application, emails are sent with 4 embedded images. These images are downloaded from 3rd party site with IP say "UUU.XXX.YYY.ZZZ"
    The images are embedded to email as follows
    1. An URL object is created with the site url.
    URL urlPhoto = new
    URL("http://UUU.XXX.YYY.ZZZ/email/photos.jpg");
    2.     The image cid is created with the URL object and the image name
    HtmlEmail htmlEmail = new HtmlEmail();
    String cid1 = htmlEmail.embed(urlPhoto,
    "photo.jpg");
    3.     The image cid is added to the email template by replacing the ${cid1} and the email is sent.
    <td valign="top">
                   <img src="cid:${cid1}" width="279" height="274">
              </td>
    When a mail is sent, 4 new TCP connections are opened and are put in CLOSE_WAIT status for ever. For every mail sent 4 new connections are opened. In UNIX there is an upper limit on the number of open file handles (defaults to 1024) at any point of time. The open TCP connection has the underlying socket in CLOSE_WAIT status and is not getting closed at all. When the upper limit (1024) is reached the batch process is throwing the following exception and terminates.
    Caused by: com.inet.tds.ap: java.net.SocketExceptionjava.net.SocketException: Too many open files
    at com.inet.tds.am.a(Unknown Source)
    at com.inet.tds.TdsDriver.a(Unknown Source)
    at com.inet.tds.TdsDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at com.hcomemea.batchprocess.dataaccess.database.BaseJdbcDao.openConnection(BaseJdbcDao.java:106)
    ... 12 more
    When I run the command lsof in UNIX which list the open file handles in the system
    $ /usr/sbin/lsof -p 22933 -i | grep CLOSE_WAIT
    java 22933 build_master 297u IPv6 129841943 TCP integration.com:47929->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 298u IPv6 129841947 TCP integration.com:47933->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 299u IPv6 129841950 TCP integration.com:47936->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 300u IPv6 129841970 TCP integration.com:47952->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    ���list of 935 connections similarly�
    I tried 2 solutions
    1. Got the HttpURLConnection from the URL object and invoked disconnect method on the same. But it doesn�t work.
    2. Ran the batch process java program with the parameter �Dhttp.keepAlive=false to close the underlying connection but didn�t help.
    I need the underlying sockets to be closed and not put in CLOSE_WAIT status after sending the mail.
    Is it the problem with the embed method of HtmlEmail object not closing the underlying socket connection.
    If anyone has faced this issue before, kindly let me know the possible solutions for the same ASAP.
    Thank you,
    Ramesh G

    This sounds more like a problem due to connection pooling at middle tier/application server.
    If that has been ruled out, then you might to enable DCD or set expiry time on the server.

  • NIO issue - writing to sockets from 2 threads

    Hi All,
    I have some questions regarding a NIO-server i'm developing. I have read many posts relating this issue, but still...
    I have one thread that does the Selector.select() and read & write to the sockets
    I have another thread that uses the same Selector and changes the interestOp to OP_WRITE (then wakes up the Selector).
    I have a Connection (attachment) that i use to hold the inputBuffer and outputBuffer to handle remainings.
    I've read a post in which some ppl wrote the stages of using th OP_WRITE and it was suggested that only when i wanna write i'll add the OP_WRITE and exclude it in the isWritable() - so i'm doing that.
    My questions are:
    1. Is it safe to change the interestOp on a key from another thread?
    2. What happens if the select() is in process?
    3. Are there any other problems with my implementation?
    4. What other way i have to write to a socket from 2 different threads (withough putting a lock on the socket)?
    Thanks.

    Reset your thinking a bit. You should only register for OP_WRITE when you have just executed a 'short write', i.e. a return value > 0 but < the length you asked to write, and you should deregister OP_WRITE any time you execute a 'complete write', i.e. a write which writes everything you asked for. At all other times you should just write and handle your own syncrhonization. The reason is that socket channels are almost always writable except under the condition described so you will just be returning early from select() for nothing.

  • MDEX intermittantly not returning response, getting com.endeca.navigation.ENEConnectionException: Error reading from socket connection buffer.Connection reset

    Intermittant issue where certain portlets have the spinning wheel and error getting thrown in the log, and resulting in stuck threads, has anyone seen this?
    Caused by: com.endeca.navigation.ENEConnectionException: Error reading from socket connection buffer.Connection reset
            at com.endeca.navigation.OptiInputBuffer.read(Unknown Source)
            at com.endeca.navigation.OptiInputBuffer.readFully(Unknown Source)
            at com.endeca.navigation.OptiInputBuffer.readUInt(Unknown Source)
            at com.endeca.navigation.OptiInputBuffer.readLine(Unknown Source)
            at com.endeca.navigation.OptiBinaryInterp.FormatCat(Unknown Source)
            at com.endeca.navigation.OptiBinaryInterp.FormatCatsWithAncs(Unknown Source)
            at com.endeca.navigation.OptiBinaryInterp.FormatCatGroup(Unknown Source)
            at com.endeca.navigation.OptiBinaryInterp.FormatBin(Unknown Source)
            at com.endeca.navigation.OptiBinaryInterp.FormatBinList(Unknown Source)
            at com.endeca.navigation.OptiBinaryInterp.ParseBinaryNode(Unknown Source)
            at com.endeca.navigation.OptiBackend.getNavigation(Unknown Source)
            at com.endeca.navigation.HttpENEConnection.query(Unknown Source)
            at com.endeca.portal.mdex.MDEXUtil.execute(MDEXUtil.java:433)
            at com.endeca.portal.data.DataSource.execute(DataSource.java:546)

    Message appears in logs internmittantly during page rendering which has Breadcrumbs, Results Table, Guided Navigation portlets.  There are Agraphs in front of several Dgraphs.

  • Using thread and socket connection with other machines

    Hi all!
    we are using weblgoic 5.1 SP9 JDK1.2.2
    we already using java.net.Socket and java.lang.Thread
    to communication TANDEM Machine on the weblogic.
    the reason why we use to socket and thread even though it is not
    recommanded is that below
    1. once we connect Socket, then we using until server shutdown or
    connection may has the problem, so we're using thread to wait
    java.io.Inputstream to read from socket.(if I using EJB, It can't
    wait socket inputstream indefinetly, because it has timeout)
    2. we're logging Database date sent or received with TANDEM Machine.
    so we need Database Access. so we using Database Access
    thru Weblogic.
    3. EJB Application using (other EJB Application - send Module)
    to send data to TANDEM Machine. So "Send Module" should
    be implemented EJB.
    but. Now I see there might be problem this framework.
    so, is there some way by just using J2EE spec, to implement this kind of
    framework.
    wait for your great help !!
    regards.

    Yes i've tried interrupt method and it doesn't have any effects on the thread... it stay in connect() method...
    And for the timeouts, in fact i use an API : J2SSH, to connect with SSH protocol, and the setting of connection timeouts is not implemented yet... and the default timeout is about 4 minutes...
    so i don't know how to solve this problem...

  • Problem: Socket connection is not creating in machine, through utility program (MFC Dll), on ListDisplay service port - 3334 (on separate machine), while we are able to telnet on same ListDisplay service port - 3334 from same issue machine on same time

    Problem: Socket
    connection is not creating in machine, through utility program (MFC Dll), on ListDisplay service port - 3334 (on separate machine), while we are able to telnet on same ListDisplay service port - 3334 from same issue machine on same time
    Environment: -
    OS:
    Windows XP SP2/7
    Code:
    VC 6.0
    Dll: MFC
    Problem Description: -
    We have written a utility program which create socket (Using windows standard method [MFC]), and then make connection with another service (List Display) running
    on port 3334 in different machine and retrieve the required list data. This program was working fine in almost all the machines.
    But, we have received a severe intermittent issue on two machines. Client is facing issue in displaying the list data from port 3334.
    Attempt: -
    First we tried to debug code, and we come to know that socket is not creating in utility program. So we tried to telnet on ListDisplay service port 3334 and we were surprised that we were able to telnet, then we opened some more
    telnet window on same port 3334 around (6 to 8) window, and each cmd connected properly. But we were not able to create socket from utility program.
    Problem is severe because issue is intermittent.
    We have tried all the way, but we are not able to figure it out, that what can be the exact problem and what are the conditions, when utility program will not
    connect with ListDisplay service on port 3334.
    Kindly assist to resolve this issue. For any help, we would be really thankful.

    Hi,
    According to your description, it seems that you have created an utility program which is making connection with another service port 3334, however, two clients are facing issue in display the data list from port 3334.
    Port: 3334/TCP
    3334/TCP - Known port assignments (1 record found)
    Service
    Details
    Source
    directv-web
    Direct TV Webcasting
    IANA
    Since the port 3334 is used by directv-web service, I'd like to suggest check this service it is working well on the problematic clients.
    1. The client can be resolved in DNS well? Please run "nslookup" in the prompt command.
    2. Is there any 3rd party application interrupting? Do test in clean boot.
    2. Strongly suggest you run process monitor tool to analysis it.
    I am looking forward to your reply if you have any updated on your side.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Weblogic 11G error = BEA-000449  Closing socket as no data read from it

    In My Weblogic 11G, i am getting Warning msg in my log file saying Closing socket as no data read from it
    ####<Nov 2, 2010 12:10:53 AM IST> <Warning> <Socket> <TradeServer> <TradeServer> <[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <1288636853607> <BEA-000449> <Closing socket as no data read from it on 95.66.7.15:58,089 during the configured idle timeout of 25 secs>
    ####<Nov 2, 2010 12:10:53 AM IST> <Warning> <Socket> <TradeServer> <TradeServer> <[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <1288636853607> <BEA-000449> <Closing socket as no data read from it on 95.66.7.15:58,088 during the configured idle timeout of 25 secs>
    ####<Nov 2, 2010 12:21:37 AM IST> <Info> <JDBC> <TradeServer> <TradeServer> <[ACTIVE] ExecuteThread: '23' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <1288637497701> <BEA-001128> <Connection for pool "IB_JDBC_Data_Source" closed.>
    I have follow the following step
    If you want to follow this solution. Go to Admin console -> Click on Domain->Configuration->Log Filters->create new Log filter.
    I added this line in expression "(MESSAGE !='Closing socket as no data read from it during the configured idle timeout of 5 secs')"
    Go to your server-(for each server you have to set it individually)->Logging->Advanced->Select this log filter for Standard Out or log file.
    My Filter is "(MESSAGE !=Closing socket as no data read from it ')"
    this is not working in weblogic 11G, any one have the solution to stop this msg.
    Edited by: Amar_Shaw on Nov 3, 2010 1:40 PM

    Hi Amar,
    I think you have given the wrong string in the filter, you are getting "*Closing socket as no data read from it on 95.66.7.15:58,089 during the configured idle timeout of 25 secs*" and you have given in the filter "*Closing socket as no data read from it during the configured idle timeout of 5 secs*".
    You can change it and see if that works for you.
    Also the above option is just to suppress the issue which are getting which in this case is fine as its just a warning message, however you can even try to tune few of the follwoing parameters that too would help you to remove this warning message.
    1. Set the parameter -Dweblogic.client.socket.ConnectTimeout=XXX, in the start-up script of the server which you are seeing this issue under JAVA_OPTIONS
    Note: Where "XXX" is the value in ms.
    Example:
    -Dweblogic.client.socket.ConnectTimeout=500
    2. Try tuning the duration time to a higher value from the below Console path
    Server -> Protocols (tab) -> HTTP (sub-tab) -> Duration
    Regards,
    Ravish Mody
    http://middlewaremagic.com/weblogic/
    Middleware Magic | Come, Join Us and Experience The Magic…

  • A Thread manages a connection from the outside--help me to finish it

    **RUN THIS CODE AND HELP ME--- THANKS A LOT**
    EchoClient is thread which manage a connection from the outside.
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.ServerSocket;
    import java.net.Socket;
    import java.util.Random;
    public class EchoClient extends Thread {
         private ServerSocket listenSocket = null;
         private Socket manageSocket = null;
         private int[] port = new int[9999];
         private BufferedReader in;
         private PrintWriter out;
         private int line;
         private int count;
         // No needed to mention
                //private ClientNode[] clientArray = new ClientNode[9999];
         private ManageClient[] manageClient;
         private final int CONNECTED = 1;
         private final int CONNECTING = 11;
         private final int DISCONECTED = 2;
         public void run() {
              try {
                   manageClient = new ManageClient[9999];
                   listenSocket = new ServerSocket(903);
                   manageSocket = listenSocket.accept();
                   while (true) {
                        in = new BufferedReader(new InputStreamReader(manageSocket
                                  .getInputStream()));
                        out = new PrintWriter(manageSocket.getOutputStream());
                        line = in.read();
         // if Client send a variable(CONNECTING)
                // Server will send to Client a variable(CONNECTED) and port
                //to open a ChatFrame with that port
                        if (line == CONNECTING) {
                             System.out.print("have recieved");
              out.print(CONNECTED);
                         //randomize a port to send to client
              port[count] = (int) Math.ceil(Math.random() * 9999)
                        //creat a manageClient(Thread) to manage a seperate
                       // connection with a seperate Client
                             manageClient[count] = new ManageClient(port[count]);
                             manageClient[count].start();
                             out.print(port[count]);
                             count++;
              } catch (Exception e) {
                   e.printStackTrace();
         public static void main(String[] args) {
              EchoClient e = new EchoClient();
              e.start();
    }And a Login Frame which will send to server a varialble (CONNECTING) which requires to connect and keep waiting for a variable to Open a ChatFrame with a new port
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.Socket;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTextArea;
    public class Login extends JFrame {
         public ChatFrame chatFrame;
         private final int CONNECTED = 1;
         private final int CONNECTING = 11;
          * @param args
         public Login() {
              // TODO Auto-generated method stub
              setSize(50, 150);
              JButton loginButton = new JButton("Login");
              JPanel p = new JPanel();
              p.setLayout(new FlowLayout());
              p.add(loginButton);
              add(p);
              loginButton.addActionListener(new ActionListener() {
                   @Override
                   public void actionPerformed(ActionEvent e) {
                        loginServer();
         public void loginServer() {
              try {
                   Socket connectSocket = new Socket("127.0.0.1", 903);
                   while (true) {
                        BufferedReader in = new BufferedReader(new InputStreamReader(
                                  connectSocket.getInputStream()));
                        PrintWriter out = new PrintWriter(connectSocket
                                  .getOutputStream());
                        out.print(CONNECTING);
                        System.out.println("At here");
    //(***position***)
                        int line = in.read();
                        System.out.println("At here1");
                        if (line == CONNECTED) {
                             int port = in.read();
                             chatFrame = new ChatFrame(port);
                             chatFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                             chatFrame.show();
                             connectSocket.close();
              } catch (Exception exp) {
                   exp.printStackTrace();
         public static void main(String[] args) {
              Login login = new Login();
              login.show();
              login.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }and this is ManageClient Thread...
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class ManageClient extends Thread {
         private ServerSocket ssClient;
         private Socket sClient;
         private int port;
         public ManageClient(int port) {
              this.port = port;
         public int getPort() {
              return port;
         public void run() {
              try {
                   ssClient = new ServerSocket(getPort());
                   sClient = ssClient.accept();
                   while (true) {
                        BufferedReader in = new BufferedReader(new InputStreamReader(
                                  sClient.getInputStream()));
                        PrintWriter out = new PrintWriter(sClient.getOutputStream());
                        String s = in.readLine();
                        if (s != null)
                             out.print("have recieved");
              } catch (Exception e) {
                   e.printStackTrace();
    }my problem...
    At firts EchoClient will run.. and then Login but when I click to the Login button it has just only did before int line = in.readLine();(*** postion ***)
    I don't know why it doesn't continue. It stops here and the login button is still visible(cause code has not finish)..
    That's my problem...
    Somebody help me
    Edited by: rockfanskid on Oct 17, 2007 4:25 AM

    Somebody helps me to finish this project...
    thanks for racing this thread

  • BEA-000449  Closing socket as no data read from it

    This error message is filling up the server log files. It looks like some network problem. How can I find the cause ? This does not create a functional problem, but I am sure there will be a performance problem. Also, since this message is filling up the logs rapidly, I cannot see my regular application debug statements.
    <Warning> <Socket> <myserver.mydomain.net> <my_managedserver_01> <[ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1218554019557> <BEA-000449> <Closing socket as no data read from it during the configured idle timeout of 30 secs>
    The timeout of 30 seconds is the value set in Login Timeout in server tuning tab.
    Environment:
    WebLogic Portal 10.0 MP1 (The domain is a server domain, not portal domain)
    Red Hat linux 4
    Intel Xeon
    Message was edited by:
    prakashp

    In My Weblogic 11G, i am getting Warning msg in my log file saying Closing socket as no data read from it
    ####<Nov 2, 2010 12:10:53 AM IST> <Warning> <Socket> <TradeServer> <TradeServer> <[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1288636853607> <BEA-000449> <Closing socket as no data read from it on 95.66.7.15:58,089 during the configured idle timeout of 25 secs>
    ####<Nov 2, 2010 12:10:53 AM IST> <Warning> <Socket> <TradeServer> <TradeServer> <[ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1288636853607> <BEA-000449> <Closing socket as no data read from it on 95.66.7.15:58,088 during the configured idle timeout of 25 secs>
    ####<Nov 2, 2010 12:21:37 AM IST> <Info> <JDBC> <TradeServer> <TradeServer> <[ACTIVE] ExecuteThread: '23' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1288637497701> <BEA-001128> <Connection for pool "IB_JDBC_Data_Source" closed.>
    I have follow the following step
    If you want to follow this solution. Go to Admin console -> Click on Domain->Configuration->Log Filters->create new Log filter.
    I added this line in expression "(MESSAGE !='Closing socket as no data read from it during the configured idle timeout of 5 secs')"
    Go to your server-(for each server you have to set it individually)->Logging->Advanced->Select this log filter for Standard Out or log file.
    this is not working in weblogic 11G, any one have the solution to stop this msg.

Maybe you are looking for

  • Got a new iPod touch and now i want it to be the iPod i can use on my iTune

    So i got an itouch to replace an older ipod of mine. But now my itunes only recognizes my old ipod and the only way i can get new stuff onto my new ipod is by syncing it which is fine but i can't create playlists or organize my music at all. So what

  • Enhancement for changinf header of Workorder (IW31)

    Hello Gurus, I am looking out for an exit/BADI for changing the header of work order (IW31) during creation of the same. I could find some of the exits but they doesn't change the header. Could anyone of you suggest some enhancemnet for the same. My

  • Refresh rate problem on sunstudio 8

    Dear gurus, I telnet to a sun server running solaris 9 from my desktop and whenever I run studio 8 and click/drag my mouse over the debug window which displays my source file, I get a gibberish display. The gibberish display takes a while to go away

  • Downsizing a fat ODS to optimaze the processing time!

    Hello all, Working with SAP NetWeaver BI 7.0, a customizing FI_CO OPC ODS with 300.000.000 records extracted from Sap R/3, was enhanced with 2 new fields and since then it has generated big processing time – about 20 hrs and same times basis team nee

  • INTERNET stopped working

    Hi, I've tried all the fixes I can find for this and nothing has worked. Safari, Firefox and Software Update have all stopped functioning, anything involving the internet won't load up. But when I check the network connection it says it's working pro