Multiple reads from DataInputStream through Socket

Ok I got a small prob, and well, here it is:
I have a server and a client.
The client needs to send a file to the server.
I'm using Data(Input/Output)Stream.
I use writeLong() and readLong(), to send the size and after that read the size of the file.
And after that I send the file.
But the file is always corrupted, but if I leave the size sending part out and enter the size hardcoded it works fine!
Here's a small snippet from the server-code.
// Read the filesize.
long fileSize = in.readLong();
// Receive and save the file.
int bytesRead = 0;
int bytesToRead = 1024;
byte[] input = new byte[bytesToRead];
while(bytesRead < fileSize) {
     int result = in.read(input,0,bytesToRead);
     if(result == -1) break;                              
     bytesRead += result;
     out.write(input,0,bytesToRead);
     System.out.println(bytesRead + "/" + fileSize);
in.close();
out.flush();
out.close();Any help is very appriciated...
Thnkx in advance...
Robert.

I'm assuming out is a file. I think you are writing too much. You want to write what was read in, not the full array. The default values of the byte array bytes is 0 (or since not being reset, the last value read). So say you read in a lot of bytes in one read call, then a few in the 2nd, and then more in the 3rd, you are writing some old data (from 1st read) in the 2nd write, which will corrupt the file. Somehow I doubt that it's always the case that withouth the readLong part that it doesn't work. Just a fluke thing that happens any particular time.
// Read the filesize.
long fileSize = in.readLong();
// Receive and save the file.
long bytesRead = 0;
int bytesToRead = 1024;
byte[] input = new byte[bytesToRead];
while(bytesRead < fileSize) {
     int result = in.read(input,0,bytesToRead);
     if(result == -1) break;                              
     bytesRead += result;
     out.write(input,0,result);
     System.out.println(bytesRead + "/" + fileSize);
in.close();
out.flush();
out.close();

Similar Messages

  • Reading from DataInputStream.

    Hi,
    I am writing a client-server application (communicating through TCP sockets) and I am reading the input streams on both ends (at the client and at the server) with a java.io.DataInputStream. My problem is that I want to get the number of available bytes (I am calling the available() method) prior to reading them, but the DataInputStream always returns 0.
    Does anybody know a way to get the number of available bytes from DataInputStream?
    TIA
    Regards,
    Stefan

    I am sure you wanted to help and I thank you, but what you said is not true.
    First of all, java.io.DataInputStream is a wrapper for other input streams - it requires an InputStream in it's constructor. It is true that DataInputStream does not override the available() method, but it's super class FilterInputStream does. The available() method of FilterInputStream calls the available() method of the underlying input stream. In my case the wrapped input stream is of type java.net.SocketInputStream, but unfortunately this class is not public and is not very well documented.
    Thanks anyway for your concern.
    Regards,
    Stefan

  • Passing multiple paremeters from report through WESubmitLink or WEOpenInTargetLink

    <p>Hello,</p><p>I am trying to pass multiple parameters from one report to another through the WEOpenInTargetLink and WESubmitLink formulas without having the user prompted.</p><p>I can do this using conventional CR methods with change subreport links by simply passing a static value with the same name as the parameter. This passes the parameters to the subreport without prompting. I would like to do the same with the aforementioned formulas.</p><p>is this possible? if so, how? I cannot find any method for doing this in the docs or online.</p><p>Thanks. </p><p>&#160;</p>

    <p>hello, this is indeed possible and one of the main uses of webelements.</p><p>in your case you do not want to use WEOpenInTargetLink as this function is specifically designed for a named browser window or iframe. </p><p>when you are targeting another report, use the WETargetPath function that is in the main webelements folder...placed there as it is a key function to pass values back and forth.</p><p>have a look at the Simple Example report that is in the webelements download. the one thing you would change is the target report though so that the formula containing the submit button would look something like</p><p>stringvar path:= WETargetPath ("rpt", "Name", "insert your target report name", "");<br />WESubmitButton ("Update", path, "");</p><p>jamie</p>

  • Bytes not read from DataInputStream

    I want to read a binary file and translate the data to ascii. In order to do so, I've decided to let one method take care of the opening and reading the data and this is where the problem is; no data is read from the binary file. When the for-loop is executed, the index is printed on the screen and since the number is increasing, it cannot be the for-loop that is malfunctioning. However, the data that should be read, should also be displayed, but that does not happen. Can someone tell me what is wrong with my code?
    Thanks
    Simon
    public void readFromBinary() throws FileNotFoundException,IOException
         //open stream
         FileInputStream fInputStream = new FileInputStream(inFile);
         int lengthInFile = fInputStream.available();
         inStream = new DataInputStream(fInputStream);
         byte[] values = new byte[lengthInFile];
         //read data
         for(int i=0;i<lengthInFile;i++)
    System.out.println("i = "+i);
         values[i] = inStream.readByte();
         String str = new String(values);
         System.out.println(str);
         System.out.println("readFromBinary: Data read, length is "+values.length);
         //close stream
         fInputStream.close();

    values[ i ] = inStream.readByte();You've only read one (more) of the bytes, the other
    values in the array are still zeros
    String str = new String(values);
    System.out.println(str);This doesn't make sense creating a string out of the
    array which just keeps adding one more byte every time
    thru the loop.
    Why not just read the thing as one operation?
    inStream.read(values);Actually meant:
    fInputStream.read(values);
    You shouldn't be using DataInputStream on a stream that wasn't created by a DataOutputStream. But then I don't know what this file is you're messing with.

  • Need help : Reading from DAQ through TCP/IP ?!!

    Hello
    I have two machines running labview connected to a network. Basically,
    I want to read data from a temperature sensor through a DAQ card
    from one machine, and be able to plot the data in a chart in the
    other machine. I'm trying to use TCP/IP feature to do that but it's not
    working.
    There is a VI in the tcp.lib "simple data client.vi " and
    "simple data server.vi" that does the same thing except that
    the data are of type double generated from a sine function and
    a random number generator. So i tried to do the same but since
    the data read from the DAQ has a thick brown line (not sure what
    type) the task was not easy. In the server part i tried to broadcast
    3 things through (tcp write.vi): The type of the data, the l
    ength of the
    string, and the data itself. On the client side i read (tcp read.vi)
    these things and plot the data. But i'm not getting any output on the chart.
    I had to use (Type Cast), (flatten to string) and (unfatten from string)
    in order to get the right wiring. Both VIs run but there is no output
    on the chart.
    I know it's hard to explain in words, but if anyone is interested i can
    give more detai or send the vis to him to look at them. They seem very simple and
    straight forward but i don't know why they don't work.
    Appreciate any help.
    Thanks
    Sami

    Try running the "Remote Device Access Server" (RDA) on hte machine that has the DAQ card in it. You'll find it in NI-DAQ folder under National Instruments in your Start Menu. (guessing you're running Windows here?)
    With this running, you can start MAX on any machine on the network and access and configure the DAQ cards in the remote machine and program an applicaiton just as if the DAQ cards were local. You'll need to know either the remote machines IP address or network name.
    I've used it quite a bit and have never had a problem. The Help inside MAX gives good details on how to set it up and use it.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • Teststand - multiple reads from DAQ (34970A) at one time

    Hi All,
    I'm using teststand 3.5 to test 8 UUT's at one time. I need to take some measurements from the UUT's in parallel to make the test time more efficient. Is it possible to take multiple readings from theDAQ (34970A) at the same instant??
    Thanks
    Paul

    You can set up a scan list to take as many reads as you want. Each channel is read sequentially. Of course, if you are using the parallel model, you can't do this. If you are using the batch model, then you can have a single read.
    The 34970 is a very, very slow instrument so you may or may not see much improvement. Be sure you have auto-range turned off.

  • 100% CPU Utilisation while reading from socket

    I have writted a ServerSocket program to read data from ethernet client bridge. client-bridge is a system which converts serial data to TCP packet and vice versa. I can read from the client bridge only through creating a server socket and waiting for the client bridge to make a client socket connection (ServerSocket.accept() method.
    The problem that I m facing is that, the client bridge is creating connection only once. I have created an infinite loop which keeps on reading from the socket. The performance of the application goes down drastically (100% CPU utilisation through task manager) when this application is run. Is there a better way of reading data from the client bridge. The client bridge is not in our control and the server can only wait for the client to make connection.
    Please help. Thanking you all in anticipation.
    Regards,
    Amitabha

    If I close the client socket will the client create a new socket to
    transmit data or it depends on the client application.
    I have also tried creating a new socket connection for
    reading each frame of the protocol. but the client
    creates only one socket. What might be the problem?I bet it depends on the client app because your server app only waits for a connection from the client. So it's the client that initiates the connection. When you disconnect the client socket then you will have to wait for another client request. what you can do is to stay connected (unless of course client disconnects itself) and just keep on reading from the client socket.

  • J2ME: Can't read from input stream?

    I'm trying to create a simple message service between a server and J2ME client. But everytime I try to read from DataInputStream (dis) i get Exceptioons. How come? It works just fine to send messages to OutputStream.
    I've tried several different methods... This is my latest try (client). You'll find the server below.
    import java.io.*;
    import javax.microedition.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class clientMIDlet extends MIDlet implements CommandListener {
    private Command exitCommand;
    private Command sendCommand;
    private Command receiveCommand;
    private Command clearCommand;
    protected Display display; // The display for this MIDlet
    protected TextBox textBox;
    final int MAX_LENGTH = 2048;
    private ContentConnection connection = null;
    private OutputStream os = null;
    private DataInputStream dis = null;
    StringBuffer buffer = new StringBuffer("");
    public clientMIDlet() {
    // Max lenght of received messages
    display = Display.getDisplay(this);
    exitCommand = new Command("Exit", Command.EXIT, 1);
    sendCommand = new Command("Send", Command.SCREEN, 1);
    receiveCommand = new Command("Receive", Command.SCREEN, 1);
    clearCommand = new Command("Clear", Command.SCREEN, 1);
    private void sendMess (final String message) {
    String msg = message + "\n";
    try {
    os.write(msg.getBytes());
    os.flush();
    } catch (IOException e) {
    System.err.println("Error in sendMess while sending " + msg);
    private String getMess() throws IOException {
         int c;
         try {
         System.out.println("encoding: "+ connection.getEncoding());
         System.out.println("lenght: "+ connection.getLength());
         System.out.println("type: "+ connection.getType());
    System.out.println("Using buffer.. This row never prints..");
         try {
              for (int ccnt=0; ccnt < connection.getLength(); ccnt++) {
              c = dis.read();
              buffer.append((char)c);
    } finally {
              dis.close();
    } catch (IOException x) {
    System.out.println("Problems with data connection");
    return buffer.toString();
    * Start up the Hello MIDlet by creating the TextBox and associating
    * the exit command and listener.
    public void startApp() {
    // Start a socket to comminicate with the server.
    // Server variables.. Should be submited by the user
    String host = "192.168.1.20";
    String port = "7080";
         String serverName = "socket://" + host + ":" + port;
    // Connect to server in order to receive response string
    try {
         connection = (ContentConnection)
              Connector.open(serverName,Connector.READ);
    } catch (Exception e) {
    System.out.println("Failed to connect to server!!!");
    try {
         System.out.println("encoding: "+ connection.getEncoding());
         System.out.println("lenght: "+ connection.getLength());
         System.out.println("type: "+ connection.getType());
    dis = connection.openDataInputStream();
    } catch (Exception e) {
    System.out.println("Can not read from connection");
    textBox = new TextBox("Hello MIDlet", "Hello!", 50, TextField.ANY);
    textBox.addCommand(exitCommand);
    textBox.addCommand(receiveCommand);
    textBox.addCommand(sendCommand);
    textBox.addCommand(clearCommand);
    textBox.setCommandListener(this);
    display.setCurrent(textBox);
    * Pause is a no-op since there are no background activities or
    * record stores that need to be closed.
    public void pauseApp() {
    * Destroy must cleanup everything not handled by the garbage collector.
    * In this case there is nothing to cleanup.
    public void destroyApp(boolean unconditional) {
    * Respond to commands, including exit
    * On the exit command, cleanup and notify that the MIDlet has been destroyed.
    public void commandAction(Command c, Displayable s) {
    if (c == exitCommand) {
    destroyApp(false);
    notifyDestroyed();
    } else if (c == receiveCommand) {
    try {
    System.out.println(getMess());
    //textBox.setString(getMess().toString());
    } catch (Exception e) {
    System.err.println("Could not write message to display");
    } else if (c == sendCommand) {
    sendMess(textBox.getString());
    textBox.setString("Message sent");
    Server:
    import java.net.Socket;
    import java.net.ServerSocket;
    import java.io.IOException;
    import java.io.BufferedReader;
    import java.io.PrintWriter;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    class User {
         private Socket socket;
         private BufferedReader in = null;
         private PrintWriter out = null;
         public User(final Socket mySocket) {
              this.socket = mySocket;
              try {
                   in = new BufferedReader(
                   new InputStreamReader(
                        this.socket.getInputStream(), Server.CS));
                   out = new PrintWriter(
                   new OutputStreamWriter(
                        this.socket.getOutputStream(),Server.CS));
              } catch(IOException e) {
    System.out.println("Server could not create user sockets");
         public String get() {
              String response = null;
              try {
                   response = in.readLine();
              } catch(IOException e) {
    System.out.println("Server could not read response");}
              return response;
         public void put(final String response) {
              out.print(response);
    out.flush();
         public void finalize() {
              try {
                   in.close(); out.close(); socket.close();
              } catch (IOException e) {;}
    class ConnectionHandler implements Runnable {
         private final User[] users;
    private String chatString;
         public ConnectionHandler(final Socket socket_user1, final Socket socket_user2) {
              users = new User[] {new User(socket_user1), new User(socket_user2)};
              //:Send users their initial state:
         public void run() {
    boolean master = true;
    users[0].put("OK");
              users[1].put("wait");
    System.out.println("ConnectionHandler started.");
              while(true) {
    chatString = users[(master ? 0 : 1)].get();
    System.out.println("User" + (master ? 1 : 2) + ":" + chatString);
                   users[(master ? 1 : 0)].put(chatString);
                   master = !master;
    public class Server {
         public final static String CS = "ISO-8859-1";
    public static void main(String[] args) throws IOException {
              int port = 7070;
    if (args.length == 1) {
    port = Integer.parseInt(args[0]);
         System.out.println("Server started on port " + port + "...");
    final ServerSocket serverSocket = new ServerSocket(port);
              while(true) {
    final Runnable task = new ConnectionHandler(serverSocket.accept(),
    serverSocket.accept());
              final Thread thread = new Thread(task);
              thread.start();
    }

    You've got to be kidding me...
    I'm trying to create a simple message service between
    a server and J2ME client. But everytime I try to read
    from DataInputStream (dis) i get Exceptioons. How
    come? It works just fine to send messages to
    OutputStream.What exceptions get thrown? What line numbers do they get thrown from? Do they always get thrown, or only in certain situations? Put your code in [code ] blocks (http://forum.java.sun.com/faq.jsp#messageformat, for Christ's sake, how many times do people need told to do that... it should just be written write on top of the page that you type your posts in... oh wait... IT IS!)

  • How to iterate through multiple records read from a file adapter?

    I am reading multiple records from a file using SyncRead file adapter.
    I want to iterate through the records to perform some action on every record. How to do this?
    I found few threads related to this..but did not get the solution.
    Please note that I am using Jdev 10.1.3.4
    Thanks

    For count expression, I am getting following error:
    <Faulthttp://schemas.oracle.com/bpel/extensionhttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>null:subLanguageExecutionFault</faultcode>
    <faultstring>business exception</faultstring>
    <faultactor>cx-fault-actor</faultactor>
    <detail>
    <code>XPathExecutionError</code>
    <summary>XPath expression failed to execute. Error while processing xpath expression, the expression is "ora:countNodes(bpws:getVariableData('Invoke_3_SynchRead_OutputVariable','EmpCollection','/ns4:EmpCollection'))", the reason is FOTY0001: type error. Please verify the xpath query. </summary>
    </detail>
    </Fault>
    I hard-coded count, in order to proceed. Then I got following error
    <Faulthttp://schemas.oracle.com/bpel/extensionhttp://schemas.xmlsoap.org/soap/envelope/>
    <faultcode>null:bindingFault</faultcode>
    <faultstring>business exception</faultstring>
    <faultactor>cx-fault-actor</faultactor>
    <detail>
    <code>null</code>
    <summary>file:/C:/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_BPELProcess4_1.0_dc4a703c46a242f69d6cea305b2df3a3.tmp/WriteDA.wsdl [ WriteDA_ptt::insert(VbEmpCollection) ] - WSIF JCA Execute of operation 'insert' failed due to: Mapping Not Found Exception. The mapping [C1] for descriptor [class bpel___localhost_default_BPELProcess4_1_0__MD5_ad2539e1386433a9e059bcc969732f11_.WriteDA.VbEmp] could not be found. The input xml record had an element [VbEmp/C1]. ; nested exception is: ORABPEL-11627 Mapping Not Found Exception. The mapping [C1] for descriptor [class bpel___localhost_default_BPELProcess4_1_0__MD5_ad2539e1386433a9e059bcc969732f11_.WriteDA.VbEmp] could not be found. The input xml record had an element [VbEmp/C1]. Make sure that the input xml is valid relative to the xsd and that the mapping exists in the Mappings.xml. If an old version of the descriptor without this mapping has been loaded by the database adapter, you may need to bounce the app server. If the same descriptor is described in two separate Mappings.xml files, make sure both versions include this attribute/mapping. </summary>
    <detail>null</detail>
    </detail>
    </Fault>
    The bpel code is as follows (I can share entire BPEL project..But not sure how to attach to the thread :( )
    <?xml version = "1.0" encoding = "UTF-8" ?>
    <!--
    Oracle JDeveloper BPEL Designer
    Created: Wed Feb 03 18:00:26 IST 2010
    Author: administrator
    Purpose: Synchronous BPEL Process
    -->
    <process name="BPELProcess4"
    targetNamespace="http://xmlns.oracle.com/BPELProcess4"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:ns4="http://TargetNamespace.com/InboundService"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:client="http://xmlns.oracle.com/BPELProcess4"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/file/ReadFA/"
    xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
    xmlns:ns3="http://xmlns.oracle.com/pcbpel/adapter/db/top/WriteDA"
    xmlns:ns2="http://xmlns.oracle.com/pcbpel/adapter/db/WriteDA/"
    xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
    xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
    <!--
    PARTNERLINKS
    List of services participating in this BPEL process
    -->
    <partnerLinks>
    <!--
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="client" partnerLinkType="client:BPELProcess4"
    myRole="BPELProcess4Provider"/>
    <partnerLink name="WriteDA" partnerRole="WriteDA_role"
    partnerLinkType="ns2:WriteDA_plt"/>
    <partnerLink name="ReadFA" partnerRole="SynchRead_role"
    partnerLinkType="ns1:SynchRead_plt"/>
    </partnerLinks>
    <!--
    VARIABLES
    List of messages and XML documents used within this BPEL process
    -->
    <variables>
    <!-- Reference to the message passed as input during initiation -->
    <!-- Reference to the message that will be returned to the requester-->
    <variable name="inputVariable"
    messageType="client:BPELProcess4RequestMessage"/>
    <variable name="outputVariable"
    messageType="client:BPELProcess4ResponseMessage"/>
    <variable name="Invoke_2_insert_InputVariable"
    messageType="ns2:VbEmpCollection_msg"/>
    <variable name="Invoke_3_SynchRead_InputVariable"
    messageType="ns1:Empty_msg"/>
    <variable name="Invoke_3_SynchRead_OutputVariable"
    messageType="ns1:EmpCollection_msg"/>
    <variable name="Invoke_3_SynchRead_InputVariable_1"
    messageType="ns1:Empty_msg"/>
    <variable name="Count" type="xsd:integer"/>
    <variable name="iterater" type="xsd:integer"/>
    </variables>
    <!--
    ORCHESTRATION LOGIC
    Set of activities coordinating the flow of messages across the
    services integrated within this business process
    -->
    <sequence name="main">
    <!-- Receive input from requestor. (Note: This maps to operation defined in BPELProcess4.wsdl) -->
    <receive name="receiveInput" partnerLink="client"
    portType="client:BPELProcess4" operation="process"
    variable="inputVariable" createInstance="yes"/>
    <!-- Generate reply to synchronous request -->
    <invoke name="Invoke_3" partnerLink="ReadFA" portType="ns1:SynchRead_ptt"
    operation="SynchRead"
    outputVariable="Invoke_3_SynchRead_OutputVariable"
    inputVariable="Invoke_3_SynchRead_InputVariable_1"/>
    <assign name="Assign_1">
    <copy>
    <from expression="1"/>
    <to variable="iterater"/>
    </copy>
    <copy>
    <from expression="1"/>
    <to variable="Count"/>
    </copy>
    </assign>
    <while name="While_1"
    condition="bpws:getVariableData('iterater') &lt;= bpws:getVariableData('Count')">
    <sequence name="Sequence_2">
    <switch name="Switch_1">
    <case condition="bpws:getVariableData('Invoke_3_SynchRead_OutputVariable','EmpCollection','/ns4:EmpCollection/ns4:Emp/ns4:C4') = &quot;Pune&quot;">
    <sequence name="Sequence_1">
    <assign name="Assign_3">
    <copy>
    <from expression="bpws:getVariableData('Invoke_3_SynchRead_OutputVariable','EmpCollection','/ns4:EmpCollection/ns4:Emp')[bpws:getVariableData('iterater')]"/>
    <to variable="Invoke_2_insert_InputVariable"
    part="VbEmpCollection"
    query="/ns3:VbEmpCollection/ns3:VbEmp"/>
    </copy>
    </assign>
    <invoke name="Invoke_2" partnerLink="WriteDA"
    portType="ns2:WriteDA_ptt" operation="insert"
    inputVariable="Invoke_2_insert_InputVariable"/>
    </sequence>
    </case>
    <otherwise>
    <sequence name="Sequence_3">
    <empty name="Empty_1"/>
    <assign name="Transform_1">
    <bpelx:annotation>
    <bpelx:pattern>transformation</bpelx:pattern>
    </bpelx:annotation>
    <copy>
    <from expression="ora:processXSLT('Transformation_3.xsl',bpws:getVariableData('Invoke_3_SynchRead_OutputVariable','EmpCollection'))"/>
    <to variable="Invoke_2_insert_InputVariable"
    part="VbEmpCollection"/>
    </copy>
    </assign>
    </sequence>
    </otherwise>
    </switch>
    <assign name="Assign_2">
    <copy>
    <from expression="bpws:getVariableData('iterater') + 1"/>
    <to variable="iterater"/>
    </copy>
    </assign>
    </sequence>
    </while>
    <reply name="replyOutput" partnerLink="client"
    portType="client:BPELProcess4" operation="process"
    variable="outputVariable"/>
    </sequence>
    </process>
    From the process flow, I can see that the array element expression works and the first employee record is correctly assigned to the Invoke_2_Input_Variable.
    However Invoke_2 is erroring out.
    Thanks
    Edited by: user8645981 on Feb 5, 2010 2:44 AM

  • Reading/Writing Multiple Files From/To Socket

    I'm have a problem in recognizing end of file in socket.
    when I write files one after another using object input stream wrapped on the socket's input stream.
    on one side:
    while((n = send_file_input_stream[ i ].read(buff)!=-1)
    socket_output_stream.write(buff,0,n)
    on the other side:
    while((n = socket_input_stream.read(buff)!=-1)
    recv_file_output_stream[ i ].write(buff,0,n)
    this process happens for i=1..N files
    1) how can i signal the socket That EOF occures ?
    2) how can the recieving socket stream recognize it?
    3) Is there a simple mechnism for transffering files in java
    from dir to dir from disk to socket ?
    like copy(InputStream from,OutputStram to)
    Thanks
    Joseph

    one way is to write something as an end of file marker after each file, say character 255, just make sure you escape any 255's in the file (say by sending two 255's)
    The other end then needs to look for the 255's, if it gets one on its own its the end of the file. If it get's two together its a single 255 thats part of the file.
    If that seems a bit complicated you could send a header with the count of bytes before each file, the receiving end then just has to count bytes.
    Another way is to use a new connection for each file (probably also the easiest)

  • Facing error when trying to read message from MQ through B2B

    Hi,
    I'm trying to read the messages from MQ through B2B.
    I have created a listening channel in B2B console.
    Also place the required jar files in the Domain_Dir/lib folder.For your reference the jar files are given below,
    a. com.ibm.mqjms.jar
    b. dhbcore.jar
    c. com.ibm.mq.jar
    d. com.ibm.mq.jmqi.jar
    e. mqcontext.jar
    g. com.ibm.mq.commonservices.jar
    h. com.ibm.mq.headers.jar
    i. com.ibm.mq.pcf.jar
    But i'm encounter the below error while reading the MQ. Pls let me know if i'm missing something.
    ####<Oct 9, 2014 4:00:03 PM IST> <Error> <oracle.soa.b2b.engine> <ULCAKESBTD1P> <b2b-server> <Workmanager: , Version: 0, Scheduled=false, Started=false, Wait time: 0 ms
    > <<anonymous>> <> <0000KZoSn1y5YbWzLwyGOA1KDaCI000002> <1412850603388> <BEA-000000> <oracle.tip.b2b.transport.TransportException: [JMS_CONN_INVALID] JMS connection error.
      at oracle.tip.b2b.transport.TransportException.create(TransportException.java:93)
      at oracle.tip.b2b.transport.basic.jms.JMSMonitor.init(JMSMonitor.java:199)
      at oracle.tip.b2b.transport.basic.jms.JMSMonitor.<init>(JMSMonitor.java:181)
      at oracle.tip.b2b.transport.basic.JMSReceiver.init(JMSReceiver.java:266)
      at oracle.tip.b2b.transport.b2b.B2BTransport.init(B2BTransport.java:577)
      at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:240)
      at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
      at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184)
      at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
    Caused by: oracle.tip.b2b.transport.TransportException: [JMS_CONN_FAC_NOT_FOUND] JMS_CONN_FAC_NOT_FOUND
      at oracle.tip.b2b.transport.TransportException.create(TransportException.java:78)
      at oracle.tip.b2b.transport.basic.jms.JMSConnectionFactoryFactory.getConnectionFactory(JMSConnectionFactoryFactory.java:208)
      at oracle.tip.b2b.transport.basic.jms.JMSConnectionFactoryFactory.getQueueConnectionFactory(JMSConnectionFactoryFactory.java:85)
      at oracle.tip.b2b.transport.basic.jms.JMSConnection.<init>(JMSConnection.java:136)
      at oracle.tip.b2b.transport.basic.jms.JMSMonitor.init(JMSMonitor.java:195)
      ... 7 more
    Caused by: java.lang.ClassNotFoundException: QMUL.PDT
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:190)
      at oracle.tip.b2b.transport.basic.jms.JMSConnectionFactoryFactory.getConnectionFactory(JMSConnectionFactoryFactory.java:162)
      ... 10 more
    oracle.tip.b2b.transport.TransportException: [JMS_CONN_INVALID] JMS connection error.
      at oracle.tip.b2b.transport.TransportException.create(TransportException.java:93)
      at oracle.tip.b2b.transport.basic.jms.JMSMonitor.init(JMSMonitor.java:199)
      at oracle.tip.b2b.transport.basic.jms.JMSMonitor.<init>(JMSMonitor.java:181)
      at oracle.tip.b2b.transport.basic.JMSReceiver.init(JMSReceiver.java:266)
      at oracle.tip.b2b.transport.b2b.B2BTransport.init(B2BTransport.java:577)
      at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:240)
      at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
      at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184)
      at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
    Caused By: oracle.tip.b2b.transport.TransportException: [JMS_CONN_FAC_NOT_FOUND] JMS_CONN_FAC_NOT_FOUND
      at oracle.tip.b2b.transport.TransportException.create(TransportException.java:78)
      at oracle.tip.b2b.transport.basic.jms.JMSConnectionFactoryFactory.getConnectionFactory(JMSConnectionFactoryFactory.java:208)
      at oracle.tip.b2b.transport.basic.jms.JMSConnectionFactoryFactory.getQueueConnectionFactory(JMSConnectionFactoryFactory.java:85)
      at oracle.tip.b2b.transport.basic.jms.JMSConnection.<init>(JMSConnection.java:136)
      at oracle.tip.b2b.transport.basic.jms.JMSMonitor.init(JMSMonitor.java:195)
      at oracle.tip.b2b.transport.basic.jms.JMSMonitor.<init>(JMSMonitor.java:181)
      at oracle.tip.b2b.transport.basic.JMSReceiver.init(JMSReceiver.java:266)
      at oracle.tip.b2b.transport.b2b.B2BTransport.init(B2BTransport.java:577)
      at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:240)
      at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
      at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184)
      at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
    Caused By: java.lang.ClassNotFoundException: QMUL.PDT
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:190)
      at oracle.tip.b2b.transport.basic.jms.JMSConnectionFactoryFactory.getConnectionFactory(JMSConnectionFactoryFactory.java:162)
      at oracle.tip.b2b.transport.basic.jms.JMSConnectionFactoryFactory.getQueueConnectionFactory(JMSConnectionFactoryFactory.java:85)
      at oracle.tip.b2b.transport.basic.jms.JMSConnection.<init>(JMSConnection.java:136)
      at oracle.tip.b2b.transport.basic.jms.JMSMonitor.init(JMSMonitor.java:195)
      at oracle.tip.b2b.transport.basic.jms.JMSMonitor.<init>(JMSMonitor.java:181)
      at oracle.tip.b2b.transport.basic.JMSReceiver.init(JMSReceiver.java:266)
      at oracle.tip.b2b.transport.b2b.B2BTransport.init(B2BTransport.java:577)
      at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:240)
      at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
      at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184)
      at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
    >
    ####<Oct 9, 2014 4:00:20 PM IST> <Warning> <oracle.adfinternal.view.faces.partition.FeatureUtils> <ULCAKESBTD1P> <b2b-server> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0000KZoSn1y5YbWzLwyGOA1KDaCI000002> <1412850620868> <ADF_FACES-30130> <Ignoring feature-dependency on feature "AdfDvtCommon".  No such feature exists.>
    ####<Oct 9, 2014 4:00:21 PM IST> <Warning> <org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl> <ULCAKESBTD1P> <b2b-server> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <0000KZoSn1y5YbWzLwyGOA1KDaCI000002> <1412850621197> <BEA-000000> <Configurator services already initialized.>
    ####<Oct 9, 2014 4:00:30 PM IST> <Notice> <Log Management> <ULCAKESBTD1P> <b2b-server> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1412850630361> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.>
    ####<Oct 9, 2014 4:00:30 PM IST> <Notice> <WebLogicServer> <ULCAKESBTD1P> <b2b-server> <main> <<WLS Kernel>> <> <308025e28c55d051:50252314:148f4730231:-8000-0000000000007ac6> <1412850630614> <BEA-000365> <Server state changed to ADMIN>
    ####<Oct 9, 2014 4:00:30 PM IST> <Notice> <WebLogicServer> <ULCAKESBTD1P> <b2b-server> <main> <<WLS Kernel>> <> <308025e28c55d051:50252314:148f4730231:-8000-0000000000007ac6> <1412850630698> <BEA-000365> <Server state changed to RESUMING>
    ####<Oct 9, 2014 4:00:31 PM IST> <Notice> <Server> <ULCAKESBTD1P> <b2b-server> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <308025e28c55d051:50252314:148f4730231:-8000-0000000000007ac8> <1412850631051> <BEA-002613> <Channel "Default[2]" is now listening on fe80:0:0:0:214:4fff:feeb:478d:7003 for protocols iiop, t3, ldap, snmp, http.>
    ####<Oct 9, 2014 4:00:31 PM IST> <Notice> <Server> <ULCAKESBTD1P> <b2b-server> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <308025e28c55d051:50252314:148f4730231:-8000-0000000000007ac8> <1412850631051> <BEA-002613> <Channel "Default[1]" is now listening on 10.236.77.12:7003 for protocols iiop, t3, ldap, snmp, http.>
    ####<Oct 9, 2014 4:00:31 PM IST> <Notice> <Server> <ULCAKESBTD1P> <b2b-server> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <308025e28c55d051:50252314:148f4730231:-8000-0000000000007ac8> <1412850631052> <BEA-002613> <Channel "Default[3]" is now listening on fe80:0:0:0:214:4fff:feeb:478c:7003 for protocols iiop, t3, ldap, snmp, http.>
    ####<Oct 9, 2014 4:00:31 PM IST> <Notice> <Server> <ULCAKESBTD1P> <b2b-server> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <308025e28c55d051:50252314:148f4730231:-8000-0000000000007ac8> <1412850631053> <BEA-002613> <Channel "Default[4]" is now listening on 127.0.0.1:7003 for protocols iiop, t3, ldap, snmp, http.>
    ####<Oct 9, 2014 4:00:31 PM IST> <Notice> <Server> <ULCAKESBTD1P> <b2b-server> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <308025e28c55d051:50252314:148f4730231:-8000-0000000000007ac8> <1412850631053> <BEA-002613> <Channel "Default" is now listening on 192.168.107.97:7003 for protocols iiop, t3, ldap, snmp, http.>
    ####<Oct 9, 2014 4:00:31 PM IST> <Notice> <Server> <ULCAKESBTD1P> <b2b-server> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <308025e28c55d051:50252314:148f4730231:-8000-0000000000007ac8> <1412850631054> <BEA-002613> <Channel "Default[5]" is now listening on 0:0:0:0:0:0:0:1:7003 for protocols iiop, t3, ldap, snmp, http.>
    ####<Oct 9, 2014 4:00:31 PM IST> <Notice> <WebLogicServer> <ULCAKESBTD1P> <b2b-server> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <308025e28c55d051:50252314:148f4730231:-8000-0000000000007ac8> <1412850631055> <BEA-000332> <Started WebLogic Managed Server "b2b-server" for domain "b2b-domain" running in Development Mode>
    ####<Oct 9, 2014 4:00:32 PM IST> <Notice> <WebLogicServer> <ULCAKESBTD1P> <b2b-server> <main> <<WLS Kernel>> <> <308025e28c55d051:50252314:148f4730231:-8000-0000000000007ac6> <1412850632557> <BEA-000365> <Server state changed to RUNNING>
    ####<Oct 9, 2014 4:00:32 PM IST> <Notice> <WebLogicServer> <ULCAKESBTD1P> <b2b-server> <main> <<WLS Kernel>> <> <308025e28c55d051:50252314:148f4730231:-8000-0000000000007ac6> <1412850632559> <BEA-000360> <Server started in RUNNING mode>
    ####<Oct 9, 2014 4:00:38 PM IST> <Warning> <oracle.soa.services.notification> <ULCAKESBTD1P> <b2b-server> <TimerFactory> <<anonymous>> <> <0000KZoSn1y5YbWzLwyGOA1KDaCI000002> <1412850638612> <BEA-000000> <<.> Notification via email, voice, SMS or IM will not be sent. If you would like to enable them, please configure corresponding sdpmessaging driver. Then modify the accounts and set NotificationMode attribute to either NONE, EMAIL or ALL in workflow-notification-config.xml>
    ####<Oct 9, 2014 4:02:41 PM IST> <Warning> <Socket> <ULCAKESBTD1P> <AdminServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <a2e657fa9e6b5d11:789eb8cc:148f4403946:-8000-00000000000029c4> <1412850761335> <BEA-000449> <Closing socket as no data read from it on 192.168.96.66:29,963 during the configured idle timeout of 5 secs>
    ####<Oct 9, 2014 4:02:51 PM IST> <Warning> <Socket> <ULCAKESBTD1P> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <a2e657fa9e6b5d11:789eb8cc:148f4403946:-8000-00000000000029d2> <1412850771337> <BEA-000449> <Closing socket as no data read from it on 192.168.96.66:29,970 during the configured idle timeout of 5 secs>
    ####<Oct 9, 2014 4:03:16 PM IST> <Warning> <Socket> <ULCAKESBTD1P> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <a2e657fa9e6b5d11:789eb8cc:148f4403946:-8000-00000000000029f4> <1412850796335> <BEA-000449> <Closing socket as no data read from it on 192.168.96.66:29,984 during the configured idle timeout of 5 secs>
    Thanks,
    Ravindra.

    Hi Ravindra,
    Which mode of connectivity are you trying (credential based / .bindings based)
    MQ connectivity  support is provided via JMS offering of Oracle B2B. This blog post will provide you the steps for the same - https://blogs.oracle.com/oracleb2bgurus/entry/b2b_communication_using_ibm_mq
    Please ensure to provide the proper values for connection factory and other details in JMS configuration in B2B
    HTH

  • "No more data to read from socket."?

    Hi everybody,
    We recently migrated from Oracle 10g Database Enterprise Edtion to Oracle 11g R2 Database Enterprise Edition
    with Data Guard and a dedicated standy-by database. The database is a data source for multiple applications.
    Among others, we are using two JBoss 4.2.3 GA application servers which run together in a clustered configuration.
    During our migration of our database, we also updated our OJDBC thin drivers from Oracle within our JBosses. We
    replaced the ojdbc14.jar with ojbc6.jar (Oracle 11g 11.1.0.7.0) and updated or added referenced libraries as well.
    Since our migration we experience an unfamiliar problem from time to time. Suddenly our deployed EJBs crash with
    the exception "SQLException: No more data to read from socket." The occurence is rather random than bound to
    a specific bean. The only noticeable thing is that it appears more often when there is more work load on our
    JBosses.
    Our only solution up to now is to shutdown our JBosses, restart the database and restart our JBosses again.
    Depending on our work load we do this from every two days to every 4 hours.
    I googled the message and even found several hundred hits that mentioned the exception above, but none of
    them got really solved, instead people found some case of work around for them. But none of them worked for us,
    since this exception seems more general and can have multiple causes.
    We did not have this problems when we were using the Oracle 10g database. Currently I am not sure if this problem
    is related to the new Oracle 11g R2 database, the new OJDBC thin driver or JBoss.
    Anybody experienced the same problem? And maybe even got it properly solved?
    If you need further information, just ask. I will happily offer as much information as possible to solve this.
    Greetings,
    CB
    Edited by: Crazy Bytes on 08.06.2010 03:10

    Hi,
    I remember that we received similar error after upgrading the database from 9.2.0.7 to 10.2.0.4 in one of our application using JDBC 10.1.0.5. We worked with Oracle support, and they provided us with patch Patch 5851267, that resolved our problem.
    So I would recommend you to do the same.
    regards

  • Reading from a socket that requires an EOF.

    I'm trying to send a request and get a response from a socket.
    The server only seems to send the response once it gets an EOF. The only way I can seem to get an EOF is to close my output stream. However, when I close my output stream before reading from the input stream I get a "java.net.SocketException: Socket closed" exception.
    Is there a way to send an EOF signal in the output stream? Am I doing something wrong?
            Socket sock = new Socket(this.getHost(), this.getPort());
            DataOutputStream os = new DataOutputStream(sock.getOutputStream());       
            DataInputStream is = new DataInputStream(sock.getInputStream());
            BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
            String responseString = new String();
            if (sock != null && os != null && is != null) {
                os.writeBytes(request);
                String responseLine;
                while ((responseLine = reader.readLine()) != null) {
                    responseString += responseLine;
            } //endif
            os.close();
            is.close();
            sock.close();

    Thanks for the reply. Is there no way around that? I don't have direct control over the server.
    I don't understand why I can't close the socket's input stream and still read from its output stream.
    Edited by: philgmo on Feb 18, 2008 3:20 PM

  • SocketException thrown when reading from socket.

    I got a thread that listen on a socket for data with: while (LISTENING)
    new AAAcknowledgeThread(serverSocket.accept()).start();
    When the thread mentioned executes and tries to read from the socket with:
    BufferedReader in = new BufferedReader(
    new InputStreamReader(socket.getInputStream()));
    A SocketException is thrown with the following stacktrace:
    java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream read
    at java.net.SocketInputStream.socketRead(Native Method)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.io.InputStreamReader.fill(Unknown Source)
    at java.io.InputStreamReader.read(Unknown Source)
    at java.io.BufferedReader.fill(Unknown Source)
    at java.io.BufferedReader.readLine(Unknown Source)
    at java.io.BufferedReader.readLine(Unknown Source)
    at se.ericsson.era.psem.jms.plugins.AAServerSimulatorThread.run(AAServerSimulatorThread.java:67)
    Does anybody know what could cause my problem?

    If you are creating the Socket in another Thread then I don't think the thread you create can read from that InputStream/OutputStream. I remember doing something like this while transfering files through RMI. I was openning a File and passing the FileOutputStream to another thread that pulled the file through RMI. That thread couldn't write to the outputstream, and would throw an exception. When I let the thread open it up. It worked.
    charlie

  • "No more data to read from socket" exception when testing connections

    Hi,
    I will appriciate your help with the following problem.
    We have the follwoing errors in the weblogic.log (We are using weblogic 8.1.0.2 and Oracle 9.2.0.3)
    ####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep> <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001128> <Connection for pool "oraclePool" closed.>
    ####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001067> <Connection for pool "oraclePool" refreshed.>
    ####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001112> <Test "select count(*) from DUAL" set up for pool "oraclePool" failed with exception: "java.sql.SQLException: No more data to read from socket".>
    ####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>> <> <BEA-001131> <Received an exception when closing a cached statement for the pool "oraclePool": java.sql.SQLException: Io exception: Broken pipe.>
    These exception occures every hour after the connection pool is being closed and refreshed.
    Also there are a lot of the follwoing warnning in the log :
    <BEA-001074><A JDBC pool connection leak was detected.
    Does these two problems connected? What can we do in order to solve it?
    Thanks
    Edited by RF123 at 01/28/2007 3:41 AM

    R F wrote:
    Hi,
    I will appriciate your help with the following problem.
    We have the follwoing errors in the weblogic.log (We are using weblogic 8.1.0.2 and Oracle 9.2.0.3)
    ####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep> <mfserver> <Thread-14> <<WLS Kernel>
    <> <BEA-001128> <Connection for pool "oraclePool" closed.>
    ####<Dec 20, 2006 10:47:49 AM EET> <Info> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>
    <> <BEA-001067> <Connection for pool "oraclePool" refreshed.>
    ####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>
    <> <BEA-001112> <Test "select count(*) from DUAL" set up for pool "oraclePool" failed with exception:
    "java.sql.SQLException: No more data to read from socket".>
    ####<Dec 20, 2006 10:47:51 AM EET> <Error> <JDBC> <ep > <mfserver> <Thread-14> <<WLS Kernel>
    <> <BEA-001131> <Received an exception when closing a cached statement for the pool "oraclePool":
    java.sql.SQLException: Io exception: Broken pipe.>
    These exception occures every hour after the connection pool is being closed and refreshed.
    Also there are a lot of the follwoing warnning in the log :
    <BEA-001074><A JDBC pool connection leak was detected.
    Does these two problems connected? What can we do in order to solve it?Hi. The problems are not directly related, but may have the same cause.
    Something is killing your DBMS connections out from under the driver.
    Do you have a firewall between WLS and the DBMS, or a flakey network?
    Contact BEA support to get the 8.1sp2 patch for getting meaningful
    connection leak traces (CR209251_81sp2.jar). When that patch is installed
    the leak messages should show a full stack trace of the application code
    where the connection was obtained. It is that application code that
    somehow failed to close the pool connection, causing a pool leak. I
    suspect that the application code got an unexpected exception, such as
    when/if the DBMS/network/firewall killed a connection. In this case I
    believe the application went through an exception-handling path that
    forgot to close the connection.
    Joe

Maybe you are looking for