Passing info over a socket

lets say I read in a vector from a file on a server, and I want to read the vector into another vector on the client side. I know the clients objectinputstream is the servers objectoutputstream, but how to I send objects over a socket connection.
Thanks.

client:
public class Client implements Serializable
Socket socket;
// PrintWriter out;
Vector userPass, guestBooks;
BufferedReader inp;
public Client()
try
socket = new Socket("13", 60);
// out = new PrintWriter(socket.getOutputStream(), true);
        ObjectInputStream in = new ObjectInputStream(socket.getInputStream());
        Object o1 = in.read();
        Object o2 = in.read();
        in.close();
catch(IOException e)
e.printStackTrace();
Server:
public class Server implements Serializable
ServerSocket sock;
Socket clnt;
File file1, file2, file3;
FileInputStream fis1, fis2, fis3;
Vector userspass, guestbooks;
public Server()
try
sock = new ServerSocket(60);
System.out.println("Listening on: Port 60");
clnt = sock.accept();
file1 = new File("user.txt");
file2 = new File("guestb.txt");
fis1 = new FileInputStream(file1);
fis2 = new FileInputStream(file2);
ObjectInputStream in1 = new ObjectInputStream(fis1);
ObjectInputStream in2 = new ObjectInputStream(fis2);
userspass = new Vector();
guestbooks = new Vector();
try //read in the object from the file to the vectors
while(in1.readObject()!= null)
userspass.add(in1.readObject());
while(in2.readObject()!= null)
guestbooks.add(in2.readObject());
          // here you want to send the vectors to the client?
          ObjectOutputStream out = new ObjectOutputStream(clnt.getOutputStream());
          out.write(userspass);
          out.write(guestbooks);
          out.close();
catch(Exception ex)
ex.printStackTrace();
sock.close();
sock.close();
catch(IOException e)
e.printStackTrace();
}Something like that. I have never used Object streams myself, so there's probably more to it (like making sure that vectors are serializable, and/or the contents in them). Also I'm not sure if closing the Object stream will close the socket's I/O stream also.... something for you to test and see.
HTH,
Radish21

Similar Messages

  • Hod do I pass a socket variable over a socket connection

    Anyone know what syntax I could use to pass a socket variable over a socket connection? I can't imagine it'll go as a string, int, or double. --That's all I know how to pass.                                                                                                                                                                                                                                                                                                                                                               

    I was trying to get two programs accesing a server
    program through the same socket connection. Are you
    telling me this is impossible? If so, please go to
    this link and give me a hand with the other way I
    think I can get this to work...Sure ya can....
    ...something like this:
    Server:
    ServerSocket serverSock = new ServerSocket(8888); // 8888 = whatever port you want to listen on
    while (bWaitingConnections)
      Socket socket = serverSock.accept(); // WAIT until client connects to our port.
      Thread thread = new MySocketHandlingThread(socket);
      thread.start();
    }Client:
    Socket socket = new Socket(sServerHostName, 8888);
    // ... connected to Server on port 8888 ....

  • Parse streaming XML over a socket

    Is it possible to parse XML incrementally over a socket connection? I would like to parse and respond dyanamically to streaming XML and I am looking for some direction. Everything that I have read so far with respect to parsing XML from files. Thanks in advance

    You will want to look into a SAX parser, they are specifically intended for parsing xml over an input stream. They call callbacks to handle each element that arrives from the socket.
    However, there are a lot of posts about the sax parsers hanging, and I just posted last week trying to find the cause/solution. I've seen a number of solutions posted, but none have worked in my case. No replies to my post yet.
    Steve

  • Can php pass info to a java client-side program?

    hi!
    can a php script on a remote server (activated thru command line or whatever) pass data over the internet to a java client-side program? if so, how?
    thanks!

    if it is listening to a known port, how would the data be passed?
    thanks!
    Not unless the Java program is listening on a known
    port.
    Yours,
    Tom

  • Sending images over network socket

    I'm working on a java web server. So far i have managed to get it to send html documents sucessfully to the client web browser, using a BufferedReader, and a PrintWriter object.
    But how should i send images over the socket? using this method doesn't work. Any suggestions?
    Thanks in advance.
    hornetau

    I did it first. You may pay me $10 and get XM2 WebServer 1.2 from my company.
    Ok, I'll help ya out here...
    HTTP protocol in Internet Explorer is "juiced up" meaning that it does not require HTTP data to be correctly sent. To send an image to be deisplayed...
    <html>
    <img src="theImage.gif"></img>
    </html>
    Now, the server will see a GET request like this...
    GET /theImage.gif HTTP/1.1
    Accepts: Image/jpeg, Image/gif, ...
    Your web server (in the IE case just needs to send)...
    output.println(data);
    The data object is a string, that represents the contents of the image.
    To do that, just get the correct File object, connect reader to it, then loop it
    until the reader is no longer ready (reader.ready() != true), as it loops, just append
    the readLine() command to the end of the data string and it will be ok.
    Now this works on IE just fine, using vary small file sizes due to it being loaded directly into
    memory. Casing problem if your app has only 500K of memory and the file size is 700K, 500-700=-200K, so use only small file sizes with this method.
    There is also the URLConnection and HttpURLConnection classes to use that will do this better, but
    they dont have any real way of getting the file's data - that's still YOUR job.

  • HT201287 How do I share contact info over SMS while viewing a contact?

    I am using iPhone 5S. While viewing a contact information, I would like to send the contcat info over SMS.
    As per user guide, if I click on Share Contact and then select Message, New Message screen is popped up but without the contact info.
    Need some help here.

    When I share a Contact (named "Emergency" in my case), I see a screen like this:
    Note at the top is where I would address this message to the person with whom I am sharing.
    Are you sure you're set up for messaging?  This may be an MMS message.

  • How do I send an Image over a socket ?

    I'm trying to get the output from my webcam and send that data out to a socket. Now the output from the webcam is running I'm just not sure how to send it out over the socket.
    Server.java
    import java.io.*;
    import java.net.*;
    public class Server {
       public static void main(String args[]) {
         ServerSocket serverSocket = null;
         boolean listening = true;
         try {
         serverSocket = new ServerSocket(1354);
         System.out.println("Listening for Connections...");
         } catch (IOException drr) {
         System.out.println("Error Listening :" + drr);
         System.exit(-1);
         try {
         while(listening)
         new ServerThread(serverSocket.accept()).start();
         } catch (IOException er) {
         System.out.println("Error Creating connection:" + er);
         try {
           serverSocket.close();
         } catch (IOException err) {
         System.out.println("Error Closing:" + err);
    }When a connection is made it will start the webcam and send the image.
    ServerThread.java
    import java.net.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.image.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.*;
    import javax.media.*;
    import javax.media.format.*;
    import javax.media.util.*;
    import javax.media.control.*;
    import javax.media.protocol.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import com.sun.image.codec.jpeg.*;
    public class ServerThread extends Thread {
        public static Player player = null;
        public CaptureDeviceInfo di = null;
        public MediaLocator ml = null;
        public JButton capture = null;
        public Buffer buf = null;
        public Image img = null;
        public VideoFormat vf = null;
        public BufferToImage btoi = null;
        public ImagePanel imgpanel = null;
        private Socket socket = null;
        Image blah;
        PrintWriter out = null;
        public ServerThread(Socket socket) {
         super("ServerThread");
         this.socket = socket;
        public void run() {
         try {
             out = new PrintWriter(socket.getOutputStream(), true);        
             imgpanel = new ImagePanel();
                 String str1 = "vfw:CompUSA PC Camera:0";
                 String str2 = "vfw:Microsoft WDM Image Capture (Win32):0";
                 di = CaptureDeviceManager.getDevice(str2);
             ml = new MediaLocator("vfw://0");
                try {
               player = Manager.createRealizedPlayer(ml);
                 } catch (Exception npe) {
               System.out.println("Player Exception:" + npe);
                player.start();
             Component comp;
             if ((comp = player.getVisualComponent()) != null) {
               // Grab a frame
               FrameGrabbingControl fgc = (FrameGrabbingControl) player.getControl("javax.media.control.FrameGrabbingControl");
               buf = fgc.grabFrame();
               btoi = new BufferToImage((VideoFormat) buf.getFormat());
               //Send the image over the socket
               out.println(btoi);
         } catch (IOException e) {
             System.out.println("It bombed:" + e);
        public static void playerclose() {
           player.close();
           player.deallocate();
      class ImagePanel extends Panel {
        public Image myimg = null;
        public ImagePanel() {
        public void setImage(Image img) {
          this.myimg = img;
          repaint();
        public void paint(Graphics g) {
          if (myimg != null) {
            g.drawImage(myimg, 0, 0, this);
      }The output I get from running the server is this:
    BufferedImage@c9131c: type = 1 DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=0 IntegerInterleavedRaster: width = 320 height = 240 #Bands = 3 xOff = 0 yOff = 0 dataOffset[0] 0
    Now how can I turn this into an image If this output is correct?

    HUH?
    I got the one to send the images over the network. I'm now trying to get the exact feed of the webcam and sending that over the network. This is alot more difficult to accomplish but I did see where I messed up my process of sending the images was just having to save the file then open it up put it in a byte array then send that over the network to the client. Once it was at the client i was able to re-construct it and throw it up in the frame. The only problem was lag. So this tells me it would be much more faster if instead of saving the file to send the client and having to reconstruct the image I should just send the webcam feed i used to make the image.
    eh, I guess I didn't need any help.
    Hey no offense or anything but you really have to learn how to spell better.

  • Streaming sound over a socket

    Does anyone know how to capture sound on a microphone and streamed over a socket connection to a remote machine. When the remote machine receives this it plays it directly to speakers.
    I don't want to capture a bit of sound and send a sound file I would like to be able to stream it like an internet phone.
    Does anyone know what would be the best way to go about doing this?

    http://search.java.sun.com/search/java/index.jsp?col=javaforums&qp=&qt=%2Bvoice+%2Bover&x=13&y=2
    http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=%2Bvoice+%2Bover++%2Binternet

  • Audio over TCP Socket

    Hi,
    I need a sample code for transmit/receive a audio over TCP socket.. can anybody help me?

    You send and receive it in the same way as you handle any binary data.
    Kaj

  • Had a Ipad, just got an Ipad2.  how do i tranfer all my info over to ipad2?

    had a Ipad, just got an Ipad2.  how do i tranfer all my info over to ipad2?

    http://www.tipb.com/2011/03/11/daily-tip-transfer-data-ipad-2/

  • Detect "end of file" while send n numbers files over a socket?

    Hi!
    I�m trying to find a way to detect "end of file" while send n numbers files over a socket.
    What i'm looking for is how to detect on the client side when the file i�m sending is downloaded.
    Here is the example i�m working on.
    Client side.
    import java.io.*;
    import java.net.*;
    public class fileTransfer {
        private InputStream fromServer;
        public fileTransfer(String fileName) throws FileNotFoundException, IOException {
            Socket socket = new Socket("localhost", 2006);
            fromServer = socket.getInputStream();
            for(int i=0; i<10; i++)
                receive(new File(i+fileName));
        private void receive(File uploadedFile) throws FileNotFoundException, IOException {
            uploadedFile.createNewFile();
            FileOutputStream toFile = new FileOutputStream(uploadedFile);
            byte[] buffer = new byte[4096];
            int bytesRead = 0;
            while ((bytesRead = fromServer.read(buffer)) != -1) {
                toFile.write(buffer, 0, bytesRead);
        public static void main(String[] args) {
            try {
                new fileTransfer("testa.jpg");
            } catch (Exception ex) {ex.printStackTrace();}
    }Server side.
    import java.io.*;
    import java.net.*;
    public class fileTransferSend {
        Socket serv = null;
        OutputStream toClient;
        public fileTransferSend(String fileName) throws FileNotFoundException, IOException {
            StartServer();       
            for(int i =0; i<10; i++)
                send(new File(fileName));
        public void StartServer() throws IOException {
            ServerSocket ssocket = new ServerSocket(2006);
            System.out.println("Waiting for incomming");
            serv = ssocket.accept();
            System.out.println("incomming");
            toClient = serv.getOutputStream();
        private void send(File f) throws FileNotFoundException, IOException {
            if(f.exists() && f.canRead()) {
                FileInputStream fromFile = new FileInputStream(f);
                try {
                    byte[] buffer = new byte[4096]; // 4K
                    int bytesRead = 0;
                    System.out.println("sending: "+f.getName());
                    while ((bytesRead = fromFile.read(buffer)) != -1) {
                        toClient.flush();
                        toClient.write(buffer, 0, bytesRead);
                finally {
                    //toClient.close();
                    fromFile.close();
            } else {
                System.out.println("no files");
        public static void main(String[] args) {
            try {
                new fileTransferSend("test.jpg");
            }catch(Exception e) {e.printStackTrace();}
    I know that the client never reads -1 becuase i doesn�t close the stream.
    Is there anyway to tell the client that the file is downloaded?

    A common (and easy) TCP/IP protocol is to send length, followed by data.
    Because TCP/IP is a stream-oriented protocol, a receiver can never absolutely determine where the first packet ends and the second packet begins. So it is common to send the length of the packet, followed by the packet itself.
    In your case, you could send length of file, followed by file data. It should be fairly easy to obtain file length and send that as a 32-bit (or 64-bit value). Here is an idea (not code) for the receiver:
    receive (4) // where 4 = number bytes to receive
    unsigned length = convert 4 bytes to unsigned integer
    while (length != 0)
    n = receive ( length ) // where n = number bytes actually received, and length = number bytes desired
    Or, you can use the concept of an "Escape" character in the stream. Arbitrarily choose an ESCAPE character of 0x1B (although it could be any 8-bit value). When the receiver detects an ESCAPE char, the next character can be either control or data. So for end of file you might send 0x1B 0x00. If the byte to be sent is 0x1B, then send 0x1B 0x1B. The receiver would look something like this:
    b = read one byte from stream
    if (b == 0x1B)
    b = read one byte from stream
    if (b == 0x00) then end of file
    else place b in buffer
    else
    place b in buffer
    Later.

  • Passing X509Certificate over network as a String

    Hello, I want to convert a X509Certificate into a String and pass it over the network to the server or client. Is there any API or method calls that can help?

    Convert it to Base-64.

  • Write updated Object with ObjectOutput Stream over a socket

    Hello,
    i would like to use an ObjectOutput Stream ot write over a socket between 2 process. But each time the object is modified on a given process i would like to resend it to the other in order to get the object updated.
    My porblem is that the object is never retrieved in its modified state on the second process.
    here is the class that i'm using to send and receive objects.
    On the server it is instanciated with serverMode=true and false on the client
    public class GameClient extends Thread
         private String m_servername="";
         private int m_serverport=0;
         private ObjectOutputStream m_oos = null;
         private ObjectInputStream m_ois = null;
         private Socket m_socket = null;
         private ServerSocket m_serverSocket = null;
         private Vector<INetworkController> m_listeners = new Vector<INetworkController>();
         private static final Trace trace = new Trace("SimpleClient");
         private boolean m_serverMode=false;
         public GameClient(String serverName,int port,boolean serverMode) throws IOException, UnknownHostException
              try
                   m_serverMode = serverMode;
                   m_servername=serverName.trim();
                   m_serverport=port;
                   if (m_serverMode)
                        m_serverSocket = new ServerSocket( m_serverport);
                   else
                        m_socket = new Socket(m_servername, m_serverport);
                        m_oos = new ObjectOutputStream(m_socket.getOutputStream());
                        m_ois = new ObjectInputStream(m_socket.getInputStream());
                   start();
              catch (BindException e)
                   e.printStackTrace();
                   String message = "Impossible de lancer le serveur. Un autre process �coute d�j� sur ce port";
                   System.exit(0);
         public void run()
              try
                   if (m_serverMode)
                        Socket client = m_serverSocket.accept();
                        m_oos = new ObjectOutputStream(client.getOutputStream());
                        m_ois = new ObjectInputStream(client.getInputStream());
              catch(Exception e)
                   e.printStackTrace();
              trace.startMethod("run()");
              trace.println("Listening Client Thred started");
              while(true)
                   try
                        Event serverMessage = (Event) m_ois.readObject();
                        trace.println("Waiting for message");
                        dispatchEvent(serverMessage);
                        trace.println("Message Reveived");
                   catch(Exception e)
                        String message = "La connexion r�seau a �t� perdue";
                        e.printStackTrace();
                        trace.endMethod();
                        try
                             if(m_socket!=null)
                                  m_socket.close();
                             if (m_serverSocket!=null)
                                  m_serverSocket.close();
                             m_oos.close();
                             m_ois.close();
                        catch (Exception e2)
                             e2.printStackTrace();
                        return;
         private int m_counter=0;
         public void sendNetworkMessage(Event msg)throws IOException, UnknownHostException
              if (m_oos != null)
                   m_oos.writeObject(msg);     
                   m_oos.flush();
                   //m_oos.reset();
              time = System.currentTimeMillis()-time;
              trace.endMethod();
         }Each time an object can be read, the read object is dispatch with the method dsiaptchEvent() which is not described here...
    I do not inderstand what's wrong in here
    Edited by: Voldor on Oct 16, 2007 4:10 PM

    Thanks but if i uncomment m_oos.reset() each time i write something on the socket (on the client or on the server) it is more and more longer to retrieve the writeen object on the other side of the socket (more than 40 sec after 12 messages exchanged, 6 coming from the server and 6 form the client)
    and after all i got the following
    java.lang.ArrayIndexOutOfBoundsException
         at java.net.SocketInputStream.socketRead0(Native Method)
         at java.net.SocketInputStream.read(Unknown Source)
         at java.net.SocketInputStream.read(Unknown Source)
         at java.io.ObjectInputStream$PeekInputStream.peek(Unknown Source)
         at java.io.ObjectInputStream$BlockDataInputStream.peek(Unknown Source)
         at java.io.ObjectInputStream$BlockDataInputStream.peekByte(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readArray(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readArray(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readArray(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readArray(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readArray(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readArray(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readArray(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readArray(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readArray(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readArray(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readArray(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readArray(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
         at java.io.ObjectInputStream.readSerialData(Unknown Source)
         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
         at java.io.ObjectInputStream.readObject0(Unknown Source)
         at java.io.ObjectInputStream.readObject(Unknown Source)
         at dt.communication.GameClient.run(GameClient.java:78)Do you have any idea ? Any recommandation about when to call reset ?
    Edited by: Voldor on Oct 16, 2007 4:44 PM

  • Passing date over parameters

    Dear all,
    I have created a report which consists of 3 sub reports. All three sub reports uses different date fields from different tables (though the database is the same). The main report uses its own date field which is from another table.
    So, there are 4 reports in all
    Main Report takes date field from table A
    Sub Report 1 takes date field from table B
    Sub Report 2 takes date field from table C
    Sub Report 3 takes date field from table D
    Now when I run the main report, it asks me to input dates 4 places (total of 8 places where I have to replicate same date each time I run the report.
    Now to over come this I linked the Date parameters of the main report with the date fields of the sub reports.The problem occurs when the results are shown.
    All of the results are incorrect except the main report results.
    I am wondering how can I pass dates which I have entered into the main report parameter field to all sub report fields so that I don't have to enter dates 8 times each time I open a report.
    Here is the record selection formula for main report date field
    ({foccredsum.date_created} in {?Start Date} to {?End Date})
    Now for the sub reports the date fields are different.
    How can I integrate the date parameters?
    Regards
    Jehanzeb

    Hi J,
    Try the following :
    --Delete all Sub report parameters which you have created
    --Create From and To date parameters in Main report.
    --Place sub report and edit sub report links and select main report From parameter and link to sub report date field.
    Note : If you are not finding sub report date field while linking main report parameter then check the main / sub report date datatype.  (Both should have either Date or DateTime data type)
    --Please go in sub report and go in Record selection and check whether the parameter is filtering correct date or not.
    I think, in your case all date fields are not Date or DateTime.
    Hope this helps you
    Regards,
    Sastry

  • Write CLOB in stored procedure from a passed Long over 4k

    Hi,
    I have a requirement to write a CLOB into a table as part of a stored procedure. The data to be written is passed in as a long to avoid any maximum size issues. Previously I was able to simple insert the LONG into the column which was a CLOB with no problem however we had a patch applied to out 8.1.6 database which now does not let the procedure and complains of a bad type.
    To work around this I have attempted to instead convert the LONG into a temporary CLOB and write the CLOB (below is basically what it does):
    CREATE PROCEDURE WRITE CLOB (data IN long)
    IS
    v_lob_add CLOB;
    v_size integer;
    BEGIN
    dbms_lob.CREATETEMPORARY(v_lob_add,true,dbms_lob.call);
    select vsize(data) into v_size from dual;
    dbms_lob.WRITE(v_lob_add,v_size,1,pi_add);
    insert into tab1 values (v_lob_add);
    END ADD_LONG2LOB;
    This works fine unless the LONG is over 4001 as this causes the 'select vsize(..' to fail with an 'unreasonable conversion' error.
    My question is:
    1, How can you get the length of a long if its over 4000
    2, Can dbms_lob.WRITE be passed a length over 4000
    3, If none of the above how can a LONG be converted to a CLOB for insertion
    4, Is it a bug that I can't just insert the LONG into the CLOB column (which I could do before this patch was installed 2 days ago!).
    Many thanks for your time.
    John

    Worked out how to get LONG length so just for anyones interest the following works fine:
    PROCEDURE INSERT_INCOMING2(
    chr_MMS_REF IN CHAR,
    chr_NATIVE_MSG IN LONG,
    ) IS
    v_lob2 CLOB;
    v_size integer;
    y varchar2(100);
    BEGIN
    dbms_lob.CREATETEMPORARY(v_lob2,true,dbms_lob.call);
    v_size :=0;
    loop
    y := substr(chr_NATIVE_MSG,v_size,100);
    exit when y is null;
    v_size := v_size + length(y);
    end loop;
    v_size:=v_size-1;
    dbms_lob.WRITE(v_lob2, v_size,1, chr_NATIVE_MSG);
    INSERT INTO INCOMING (MMS_REF, NATIVE_MSG) VALUES(
    chr_MMS_REF,
    v_lob2,);
    END INSERT_INCOMING2;

Maybe you are looking for

  • Cannot sign in for three days! help~~

    Hi, I used webos doctor 2 days ago and when I restarted and try to activate touchpad with my old account, It said " we were unable to sign you in, please try again in few minutes or contact hp for help resolving this problem" I tried many times alrea

  • Benefits of embeded artwork over 'Get Album Artwork'?

    I have a large collection of music in iTunes, much of it with embeded artwork. I've yet to upgrade to iTunes 7, and i was wondering are there any advantages with embeded artwork over 'Get Album Artwork'? More to the point, other than disk space, does

  • Integrate java class with forms

    dear friends, i use forms9i under windows2000, i try to implement a java class for a bean area. i have some classes who oracle demo provide. I DO the following : save HTMLTextArea.class in <oracle_home>/forms90/java and property palette of bean i wri

  • Group Policy item for Security Center

    What's the easiest way to do this? I want to disable the security center popup.Windows XP Pro SP2, zen 3.2sp2 Roaming profiles (for students, a single volatile profile is in use). I've attempted a few things to get this screen from showing up. I run

  • 60W vs. 85W charger for MacBook (aluminum)

    Is there any reason why I can't use the 85W charging unit for a MacBook? I know it comes with the 60W version. Would the larger unit overheat the battery? I want to buy a second Magsafe charging unit to keep at the office and since they are both the