Hi,I'm Chinese.java.io.StreamCorruptedException: invalid type code: 6A?

Hello! please help me, thanks! I'm Chinese.first to the sun forums.My English is bad,so sorry!
你好!感谢你的帮助!第一次来到sun 论坛来提问,很激动啊,呵呵。
java.io.StreamCorruptedException: invalid type code: 6A
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at controller.NetController$Receiver.run(NetController.java:88)
at java.lang.Thread.run(Thread.java:619)
java.io.StreamCorruptedException: invalid type code: 6A
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at controller.NetController$Receiver.run(NetController.java:88)
at java.lang.Thread.run(Thread.java:619)
Exception in thread "Thread-3" java.lang.NullPointerException
at controller.DoubleModeController.updateYourCtrl(DoubleModeController.java:127)
at controller.DoubleModeController.receiveObj(DoubleModeController.java:123)
at controller.NetController$Receiver.run(NetController.java:92)
at java.lang.Thread.run(Thread.java:619)
下面是NetCotroller类的一个内部类,负责接收数据:
This is a inner class of NetCotroller class, it receive datas:
Java code
private class Receiver implements Runnable {
        @Override
        public void run() {
            while(isRunning) {
                ObjectInputStream ois = null;
                try {
                    byte[] receiveBytes = new byte[1024*2];
                    dp = new DatagramPacket(receiveBytes, receiveBytes.length);
                    ds.receive(dp);
                    System.out.println("receive ...@_@");
                    ByteArrayInputStream bais = new ByteArrayInputStream(receiveBytes);
                    ois = new ObjectInputStream(bais);
                   //到下面这句时,就抛出了那异常!
           // this sentence throw the Exception
                    receiveObj = ois.readObject();
                    ois.close();
                    ncl.receiveObj((Object[])receiveObj);
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (ClassNotFoundException e) {
                    e.printStackTrace();
    }

1.
I changed the code to this(when datagram was fragmented, just leave it alone,and back to "ds.receive(dp);" ):
Is it OK?
private class Receiver implements Runnable {
@Override
public void run() {
boolean isCorrupted = false;//changed
while(isRunning) {
isCorrupted = false;//changed
ObjectInputStream ois = null;
Object o = null;
try {
byte[] receiveBytes = new byte[1024*5];
dp = new DatagramPacket(receiveBytes, receiveBytes.length);
ds.receive(dp);
ByteArrayInputStream bais = new ByteArrayInputStream(receiveBytes);
ois = new ObjectInputStream(bais);
o = ois.readObject();
} catch (IOException e) {
isCorrupted = true;//changed
System.out.println(o);
System.out.println("IOException---NetController--receiver");
// e.printStackTrace();
} catch (ClassNotFoundException e) {
System.out.println("ClassNotFoundException---NetController--receiver");
if(!isCorrupted) {//changed
System.out.println("receive ...@_@..." + Arrays.toString((Object[])o));
ncl.receiveObj((Object[])o);
}2.Is there a src of "Russia Block of Net"?Please send it to my e-mail ([[email protected]|mailto:[email protected]]), thank you very much!
Edited by: HolleWorld on Jan 2, 2010 1:51 AM

Similar Messages

  • StreamCorruptedException: invalid type code: AC

    I get the following error in java 6 running with tomcat 5.5.17.
    Error while deserializing the wrapped object: java.io.StreamCorruptedException: invalid type code: AC
    This does not happen in java 5 and my colleague does not get it with 5 or 6. We have checked our setups and can't see anything different.

    am having the same problem
    Edited by: prabhakar.s87 on Oct 12, 2007 2:27 PM

  • StreamCorruptedException: invalid type code: 00

    I try to do an online game. For this i need send some information to the server at the client. The information is an object who has other object inside. These objects implements Serializable and i overwrite the methods readObject and writeObject but the client send me the following exception: StreamCorruptedException: invalid type code: 00. I send the object with ObjectOutputStream.
    Please i need some help

    public class Jugador implements Serializable{
    Coordenada posicion;At the moment you aren't serializing 'posicion'. Is that deliberate, or a bug? If it's deliberate, make this field transient.
    private void writeObject(java.io.ObjectOutputStream out) throws IOException{
    // Enviamos los atributos a y b en un orden cualquiera.
    out.writeDouble(beta);
    out.writeBoolean(visible);
    private void readObject(java.io.ObjectInputStream in) throws IOException {
    // Leemos los atributos a y b en el mismo orden que los enviamos en writeObject()
    beta = in.readDouble();
    visible= in.readBoolean();
    }Remove both these functions. Serialization already does all that for you. This is just noise, and incorrect noise at that.
    From your other posting your main problem is that you are reading and writing to both a DataInput/OutputStream and an ObjectInput/OutputStream on the same socket. That doesn't work, because of buffering issues. It is also pointless, because ObjectInputStream implements DataInput and ObjectOutputStream implements DataOutput, so all the methods you are calling on the DataInput/OutputStreams are already present in the ObjectInput/OutputStreams. Make this change and the changes suggested above (to both serializable classes) and your problems should disappear.

  • StreamCorruptedException : invalid Type Code AC .. In case of a network app

    Hi
    I am developing a peer-peer application here.
    What i have is a client and a server on each user, both running parallell.
    User A sends an object to User B through an ObjectOutputStream through the main thread.
    User B reads it using an ObjectInputStream and passes the object that it read, to a new ObjectOutputStream, to be passed to User C.
    User C just reads the incoming object using ObjectInputStream.
    This iteration runs successfully for the first run!
    The moment I go for the second iteration using User A, the method on User B throws a "invalid type code AC".
    class Main{
    Socket sock;
    psvm(String args[]){
    Client newCli = new Client();
    newCli.setSock(<Sets the sock after getting the port and IP address from the user>);
    sock = newCli.getSock();
    ObjectOutputStream oos = new ObjectOutputStream(sock.getOutputStream());
    oos.writeObject(new Client());
    Class Server extends thread{
    public void run(){
    while(true){
    ObjectInputStream ois = new ObjectInputStream(sock.getInputStream());
    ois.readObject();
    I read through this post on this forum and "EJP" asks that one OOS and one OIS be maintained per socket.
    So what i did was add a setter method to the Client class which stores the Socket, and called the setter method instead of creating a new ObjectOutputStream object everytime. This way one ObjectOutputStream object would be maintained per socket per client class's instance.
    class Client{
    Socket sock;
    ObjectOutputStream oos;
    //Getter and setter for sock.
    getSock()....
    setSock()....
    //Getter and setter for ObjectOutputStream
    getOos()....
    setOos(){
    oos = new ObjectOutputStream(getSock().getOutputStream());
    When i do this, the initial iteration itself fails.
    I am posting the outline of my code since it is a big file. But if writing out a smaller version of the app and posting it here will help better understand the scenario, then I'll do it.
    I am re-posting this, coz in the previous posts regarding this same issue, i found that people were writing and reading on the application. While mine is a case of a client-server send and receive.
    I am just writing multiple times at the client and reading multiple times at the server. And each time i'm creating a fresh ObjectOutputStream object, and Client object.
    I don't close the streams since that closes the sockets, but i need to keep the sockets open and send multiple objects on the same socket.
    The explanation is a bit lengthy, so let me know if something is not clear. :)
    Thanks
    Akshay

    I'd be grateful if someone can throw some light on this issue, i have to get beyond this ASAP, and i cannot find a workaround at all.. :/

  • StreamCorruptedException invalid type code: 01

    ok here's the deal. this is another one of those "help me, objectinput/outputstream sucks" anyways, i'm making a program which will play a board game between two computers over a ServerSocket network and I'm using a dataTransfer class to hold any chat messages (there's a chat box incorporated in the UI), and the matrices of the different players' pieces. It was working fine until I added in the matrices. It also works fine when I run two instances of the program on the localhost, but when it's on two seperate computers I get a StreamCorruptedException error on the receiving end at this line:
    input=(dataTransfer)in.readObject();
    here's what my dataTransfer class looks like:
    public class dataTransfer implements Serializable {
         private String s;
         private boolean chat;
         private int[][]hostPieces;
         private int[][]clientPieces;
         public dataTransfer(String s1, int[][]p1,int[][]p2, boolean c)
              chat=c;
              s=s1;
              hostPieces=p1;
              clientPieces=p2;
         public dataTransfer(int[][]p1,int[][]p2)
              chat=false;
              hostPieces=p1;
              clientPieces=p2;
         public String getString(){return s;}
         public boolean isChat(){return chat;}
         public int[][] getHostPieces()
              return hostPieces;
         public int[][] getClientPieces()
              return clientPieces;
    }I'm guessing that there's something about matrices that will not allow me to send them over the ObjectOutputStream and/or receive them on the ObjectInputStream. Any tips, suggestions, comments?

    ok, here's my connection method, which is only called once and which sets up my socket and in and out streams
    public void connect()
        if(isHost){
            while(!connected){
        try{
        srvr=new ServerSocket(1234);
        skt=srvr.accept();
        if(skt.isConnected())connected=true;}catch(Exception e){}}}
        else{
            while(!connected){
                try{
                    skt=new Socket(hostIP,1234);
                    if(skt.isConnected())connected=true;
                }catch(Exception e){e.printStackTrace();}
        xtext.append("Computer: Connected"+"\n");
        if(skt.isConnected()){
        try{
         out=new ObjectOutputStream(skt.getOutputStream());
        in=new ObjectInputStream(skt.getInputStream());
        }catch(Exception e){e.printStackTrace();}}
    }and here's my method which sends the text. while the actual dataTransfer class contains matrices, i've only gotten to the point of sending the text messages but even that's not working
    public void SendText(String s)
    data=new dataTransfer(s+"\n",myPieces,myPieces,true);
        try{
        out.writeObject(data);
        out.flush();
        out.reset();}catch(Exception e){e.printStackTrace();}
    }and here is the code that's giving me so much trouble
    while(!inGame)
             if(connected){
             try{
                    input=(dataTransfer)in.readObject();
                    System.out.println("hello");
                    }catch(Exception e){e.printStackTrace();}
                    if(input!=null)xtext.append("Opponent: "+input.getString());}
                repaint();
            }hope that's decently clear. any help is much appreciated

  • Getting "java.io.StreamCorruptedException: invalid stream header"

    When creating a self made Stream (MacInputStream) and then using an ObjectInputStream over it to read Objects from a socket, I get this error:
    java.io.StreamCorruptedException: invalid stream header
         at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:764)
         at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277)
         at TServidor.run(TServidor.java:32)
    Is there any special feature that the "self-made" streams have to implement to be possible to use ObjectInput streams over them :P ?
    Here is the MacInputStream.java code:
    import java.io.Closeable;
    import java.io.FilterInputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Arrays;
    import javax.crypto.Mac;
    public class MacInputStream extends FilterInputStream implements Closeable{
         private Mac mac; // algorithm
         private byte [] mmac; //message MAC
         private boolean FIRST_TIME;
         public MacInputStream(InputStream is,Mac mac) {
              super(is);
              this.mac=mac;
              FIRST_TIME=true;
    public int read() throws IOException{
              if(FIRST_TIME){
                   mmac = new byte [mac.getMacLength()];
                   super.read(mmac);
              if(super.in.available()==0){
                   FIRST_TIME=true;
                   return -1;
              int rbyte = super.in.read();
              FIRST_TIME=false;
              mac.update((byte)rbyte);
              System.out.println("available: "+super.in.available());          
              if(super.in.available()==0){
                   byte [] macres =mac.doFinal();
                   System.out.println("message MAC: "+new String(mmac));
                   System.out.println("calculated MAC: "+new String(macres));
                   if(!Arrays.equals(macres, mmac)){
                        throw new IOException("violated integrity");
              return rbyte;
    public int read(byte [] b) throws IOException{
         if(FIRST_TIME){
              mmac = new byte [mac.getMacLength()];
              super.in.read(mmac);          
         if(super.available()==0){
              FIRST_TIME=true;
              return -1;
         int rbytes = super.in.read(b);
         FIRST_TIME=false;
         mac.update(b);
         if(super.available()==0){
              byte [] macres =mac.doFinal();
              if(!Arrays.equals(macres, mmac)){
                   throw new IOException("violated integrity");
         return rbytes;
    }And here is the "main" function where the exception gets thrown:
    public void run() {
         try {
              ObjectOutputStream oos = new ObjectOutputStream(s.getOutputStream());
              Mac mac = Mac.getInstance("HmacMD5");
              Key key = KeyGenerator.getInstance("HmacMD5").generateKey();          
              oos.writeObject(key);
              oos.flush();
              mac.init(key);          
              ObjectInputStream cis = new ObjectInputStream(new MacInputStream(s.getInputStream(),mac));
             String test;
             try {
                   while (true) {
                        test = (String)cis.readObject();
                        System.out.println(ct + " : " + test);
              } catch (EOFException e) {
                   System.out.println("["+ct + "]");
              } finally {
              if (cis!=null) cis.close();
              if (oos!=null) oos.close();
         } catch (Exception e) {
             e.printStackTrace();
        }It's exactly in the line: ObjectInputStream cis = new ObjectInputStream(new MacInputStream(s.getInputStream(),mac));Any ideas?
    I'm starting to desperate :P

    (a) I still don't see where you are writing the MAC that you're reading. You're reading something, but it's all or part of the Object stream header I described above, which is why ObjectInputStream' constructor is throwing that exception.
    (b) You don't need to override read(byte[] b) when you extend FilterInputStream, but you do need to override read(byte[] b, int offset, int length), and you need to do it like this:
    public int read(byte[] buffer, int offset, int length) throws IOException
      int count = 0;
      do
        int c = read();
        if (c < 0)
            break;
        buffer[offset+count++] = (byte)c;
      } while (count < length && available() > 0);
      return count > 0 ? count : -1;
    }This way the read() method gets to see every byte that's read and to do its MAC thing or whatever it does. The above is one of only two correct uses of available() in existence: it ensures that you only block once while reading, which is the correct behaviour e.g. on a network.

  • Java.io.StreamCorruptedException: invalid stream header

    I am having a problem with sending two objects (over a socket). I have read in other posts that this could be due to trying to receive incompatible data types but my applications work fine if I send my objects synchronously rather than asynchronously.
    I will try my best to describe what my problem is as my code is very long.
    I have a server and a client application (2 apps). Multiple clients connect to the server and send their details (as an object) to the server. The server then amends the object (adds some more data) and sends it back to the clients. Both the SendObject and ReceiveObject class are threads and I have created a Listener (within the client) that activates when an object is received (asynchronous communication). The Listener method looks to see if the event is an instance of a particular class and casts is as appropriate (as per below).
    public void receivedObject(ReceivedObjectEvent e) {
         ReceiveObjectThread obj = (ReceiveObjectThread) e.getObject();
         if(obj.getObject() instanceof Player) {
              thePlayer = (Player) obj.getObject();
              theTable.setHandData(thePlayer.getHand());
         if(obj.getObject() instanceof GameData) {
              gameData = (GameData) obj.getObject();
              theTable.setPlayerList(gameData.getOpponents());
    }The objects that are passed between applications both implement Serializable.
    This all works fine synchronously object passing. However, if I try and spawn two sendObject threads within the server and the corresponding two receive threads within the client and wait for the Listener to activate (asynchronously) I get the following error:
    java.io.StreamCorruptedException: invalid stream header: 00057372
         at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783)
         at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
         at ReceiveObjectThread.run(ReceiveObjectThread.java:84)
    java.io.StreamCorruptedException: invalid stream header: ACED0006
         at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:783)
         at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)
         at ReceiveObjectThread.run(ReceiveObjectThread.java:84)
    I am sure that this problem is due to my limited knowledge on socket and data transfer. Therefore any help on this one will be gratefully received.

    Hello ejp, your reply is very much appreciated.
    If I explain how I have implemented my sockets you may be able to see where I wrong.
    When a player connects, the client sends the server a �player� object. The server receives the �player� object and passes the socket from which it connected (within the server) to a socket property within the �player� class. Whenever the server needs to send an object to that client (player), it sends the output stream from the socket property within that �player� object. ( player.getSocket().getOutputStream() ).
    Below is the code from the �SendObjectThread� class.
    * This class allows an object to be passed over a Socket
    * @author Harold Clements
    * @version 1.0.1 12-Jun-2007 (12-Jul-2007)
    //http://www.seasite.niu.edu/cs580java/Object_Serialization.html
    public class SendObjectThread extends Thread {
         private OutputStream out;
         private Object obj;
          * This constructor allows the user to passes the two parameters for transmitting.
          * @param out The data stream that the object is going to be sent to.
          * @param obj The object to be sent.
         public SendObjectThread(OutputStream out, Object obj) {
              this.out = out;
              this.obj = obj;
          * The main thread
         public void run() {
              try {
                   ObjectOutputStream objOut = new ObjectOutputStream(out);
                   objOut.writeObject(obj);
                   objOut.flush();
              } catch (IOException e) {
                   e.printStackTrace();
    }The client only has one socket which is defined when the client first makes a connection with the server. The �getOutputStream()� and �getInputStream()� are used for all communication from the client.
    Is this what you described in your first option?
    The funny thing about it all is if I create a new �receiveObjectTread� and wait for that to finish, then create another �receiveObjectTread� both objects in question (Player and GameData) are received correctly and the application works. I only have the problem when I set both threads off and leave it for the �ReceivedObjectEvent� listener to pick them up and cast them (as per my first post).
    Thanks again for your help,
    Harold Clements

  • Need Help With: java.io StreamCorruptedException invalid stream header

    All:
    1. For some time I have tried to correct an error: "java.io StreamCorruptedException invalid stream header" , reoccuring in Jasper Reports source code.
    2. Based upon requirements, The Program packages variables into a HashMap, and creates a "BLOB" object which is inserted into an Oracle database. At a later point, the BLOB object is retrieved, and the "BLOB" contents are read into a byte array. The next occurring task is to retrieve data from the receiving byte array and reconstitute the original HashMap object.
    THIS IS WHEN THE PROGRAM FAILS !!!!!
    3. I can verify the number of bytes going in/out of the "BLOB" object as being the same count. I have tried different approaches listed on diverse sites w/o success. My Source Code Follows:
    // I tried to include only germane source code.
    // THIS SECTION GETS THE BLOB OBJECT AND PUTS IT INTO A BYTE //ARRAY
    rs = ps.executeQuery();
    if (rs.next())
    BLOB myblob =((OracleResultSet)rs).getBLOB("JASPERDATA");
    int chunkSize = myblob.getChunkSize();
    System.out.println("Incomming DATA size is ........." + chunkSize);
    textbuffer = new byte[chunkSize];
    int bytesRead;
    InputStream myis = myblob.getBinaryStream();
    OutputStream myout = myblob.getBinaryOutputStream();
    while((bytesRead = myis.read(textbuffer) )!= -1)
    myout.write(textbuffer);
    myout.flush();
    "" //code not germane to Discussion
              return (textbuffer); //Returns Byte Array
    // I tried to include only germane source code.
    byte [] textbuffer = adb.getBLOBFromQueue(dataFile); // Get Byte Array from above.
    int textbufferLength = textbuffer.length;
              HashMap localParamValueMap = null;
              Object in = new ObjectInputStream(new ByteArrayInputStream(textbuffer ));
              localParamValueMap = (HashMap) ((ObjectInputStream) in).readObject(); // THIS IS THE PROBLEM AREA EXCEPTION OCCURS AT "readObject"
    // ERROR RECEIVED IN TOMCAT
    //ERROR CALLSTACK
    java.io.StreamCorruptedException: invalid stream header
         at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:737)
         at java.io.ObjectInputStream.<init>(ObjectInputStream.java:253)
         at com.entservlet.DisplayJasperReports.doGet(DisplayJasperReports.java:72)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)

    Be sure that you are not seeing a secondary problem.
    In my case, with serialized objects back to the client, the client will see this expection when any of the following occurs:
    1) The server has timed out the session and instead of sending back an object, the object stream is seeing the login page.
    2) An error is occured somewhere inside of the jsp code and instead of getting a the expected serailized object in the stream, I'm getting the 500 status page...
    So...
    In your case you are going from one server to tomcat but I wouldn't be surprised if something similar is going on.
    -Dennis

  • Getting "invalid type: 169" errors when using POF with Push Replication

    I'm trying to get Push Replication - latest version - running on Coherence 3.6.1. I can get it working fine if I don't use POF with my objects, but when trying to use POF format for my objects I get this:
    2011-02-11 13:06:00.993/2.297 Oracle Coherence GE 3.6.1.1 <D5> (thread=Invocation:Management, member=1): Service Management joined the cluster with senior service member 1
    2011-02-11 13:06:01.149/2.453 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded POF configuration from "file:/C:/wsgpc/GlobalPositionsCache/resource/coherence/pof-config.xml"
    2011-02-11 13:06:01.149/2.453 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6/coherence/lib/coherence.jar!/coherence-pof-config.xml"
    2011-02-11 13:06:01.149/2.453 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-common-1.7.3.20019.jar!/coherence-common-pof-config.xml"
    2011-02-11 13:06:01.165/2.469 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-messagingpattern-2.7.4.21016.jar!/coherence-messagingpattern-pof-config.xml"
    2011-02-11 13:06:01.165/2.469 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-pushreplicationpattern-3.0.3.20019.jar!/coherence-pushreplicationpattern-pof-config.xml"
    2011-02-11 13:06:01.243/2.547 Oracle Coherence GE 3.6.1.1 <D5> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Service DistributedCacheForSequenceGenerators joined the cluster with senior service member 1
    2011-02-11 13:06:01.258/2.562 Oracle Coherence GE 3.6.1.1 <D5> (thread=DistributedCache:DistributedCacheForLiveObjects, member=1): Service DistributedCacheForLiveObjects joined the cluster with senior service member 1
    2011-02-11 13:06:01.274/2.578 Oracle Coherence GE 3.6.1.1 <D5> (thread=DistributedCache:DistributedCacheForSubscriptions, member=1): Service DistributedCacheForSubscriptions joined the cluster with senior service member 1
    2011-02-11 13:06:01.290/2.594 Oracle Coherence GE 3.6.1.1 <D5> (thread=DistributedCache:DistributedCacheForMessages, member=1): Service DistributedCacheForMessages joined the cluster with senior service member 1
    2011-02-11 13:06:01.305/2.609 Oracle Coherence GE 3.6.1.1 <D5> (thread=DistributedCache:DistributedCacheForDestinations, member=1): Service DistributedCacheForDestinations joined the cluster with senior service member 1
    2011-02-11 13:06:01.305/2.609 Oracle Coherence GE 3.6.1.1 <D5> (thread=DistributedCache:DistributedCacheWithPublishingCacheStore, member=1): Service DistributedCacheWithPublishingCacheStore joined the cluster with senior service member 1
    2011-02-11 13:06:01.321/2.625 Oracle Coherence GE 3.6.1.1 <D5> (thread=DistributedCache, member=1): Service DistributedCache joined the cluster with senior service member 1
    2011-02-11 13:06:01.461/2.765 Oracle Coherence GE 3.6.1.1 <Info> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): TcpAcceptor now listening for connections on 166.15.224.91:20002
    2011-02-11 13:06:01.461/2.765 Oracle Coherence GE 3.6.1.1 <D5> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): Started: TcpAcceptor{Name=Proxy:ExtendTcpProxyService:TcpAcceptor, State=(SERVICE_STARTED), ThreadCount=0, Codec=Codec(Format=POF), Serializer=com.tangosol.io.DefaultSerializer, PingInterval=0, PingTimeout=0, RequestTimeout=0, SocketProvider=SystemSocketProvider, LocalAddress=[/166.15.224.91:20002], SocketOptions{LingerTimeout=0, KeepAliveEnabled=true, TcpDelayEnabled=false}, ListenBacklog=0, BufferPoolIn=BufferPool(BufferSize=2KB, BufferType=DIRECT, Capacity=Unlimited), BufferPoolOut=BufferPool(BufferSize=2KB, BufferType=DIRECT, Capacity=Unlimited)}
    2011-02-11 13:06:01.461/2.765 Oracle Coherence GE 3.6.1.1 <D5> (thread=Proxy:ExtendTcpProxyService, member=1): Service ExtendTcpProxyService joined the cluster with senior service member 1
    2011-02-11 13:06:01.461/2.765 Oracle Coherence GE 3.6.1.1 <Info> (thread=main, member=1):
    Services
    ClusterService{Name=Cluster, State=(SERVICE_STARTED, STATE_JOINED), Id=0, Version=3.6, OldestMemberId=1}
    InvocationService{Name=Management, State=(SERVICE_STARTED), Id=1, Version=3.1, OldestMemberId=1}
    PartitionedCache{Name=DistributedCacheForSequenceGenerators, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
    PartitionedCache{Name=DistributedCacheForLiveObjects, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
    PartitionedCache{Name=DistributedCacheForSubscriptions, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
    PartitionedCache{Name=DistributedCacheForMessages, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
    PartitionedCache{Name=DistributedCacheForDestinations, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
    PartitionedCache{Name=DistributedCacheWithPublishingCacheStore, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
    PartitionedCache{Name=DistributedCache, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=257, BackupPartitions=0}
    ProxyService{Name=ExtendTcpProxyService, State=(SERVICE_STARTED), Id=9, Version=3.2, OldestMemberId=1}
    Started DefaultCacheServer...
    2011-02-11 13:08:27.894/149.198 Oracle Coherence GE 3.6.1.1 <Error> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): Failed to publish EntryOperation{siteName=csfb.cs-group.com, clusterName=SPTestCluster, cacheName=source-cache, operation=Insert, publishableEntry=PublishableEntry{key=Binary(length=32, value=0x15A90F00004E07424F4F4B303038014E08494E535430393834024E0345535040), value=Binary(length=147, value=0x1281A30115AA0F0000A90F00004E07424F4F4B303038014E08494E535430393834024E03455350400248ADEEF99607060348858197BF22060448B4D8E9BE02060548A0D2CDC70E060648B0E9A2C4030607488DBCD6E50D060848B18FC1882006094E03303038402B155B014E0524737263244E1F637366622E63732D67726F75702E636F6D2D535054657374436C7573746572), originalValue=Binary(length=0, value=0x)}} to Cache passive-cache because of
    (Wrapped) java.io.StreamCorruptedException: invalid type: 169 Class:com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher
    2011-02-11 13:08:27.894/149.198 Oracle Coherence GE 3.6.1.1 <D5> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): An exception occurred while processing a InvocationRequest for Service=Proxy:ExtendTcpProxyService:TcpAcceptor: (Wrapped: Failed to publish a batch with the publisher [Active Publisher] on cache [source-cache]) java.lang.IllegalStateException: Attempted to publish to cache passive-cache
         at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
         at com.oracle.coherence.patterns.pushreplication.publishers.RemoteClusterPublisher$RemotePublishingAgent.run(RemoteClusterPublisher.java:348)
         at com.tangosol.coherence.component.net.extend.proxy.serviceProxy.InvocationServiceProxy.query(InvocationServiceProxy.CDB:6)
         at com.tangosol.coherence.component.net.extend.messageFactory.InvocationServiceFactory$InvocationRequest.onRun(InvocationServiceFactory.CDB:12)
         at com.tangosol.coherence.component.net.extend.message.Request.run(Request.CDB:4)
         at com.tangosol.coherence.component.net.extend.proxy.serviceProxy.InvocationServiceProxy.onMessage(InvocationServiceProxy.CDB:9)
         at com.tangosol.coherence.component.net.extend.Channel.execute(Channel.CDB:39)
         at com.tangosol.coherence.component.net.extend.Channel.receive(Channel.CDB:26)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.onNotify(Peer.CDB:103)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.IllegalStateException: Attempted to publish to cache passive-cache
         at com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher.publishBatch(AbstractCachePublisher.java:163)
         at com.oracle.coherence.patterns.pushreplication.publishers.RemoteClusterPublisher$RemotePublishingAgent.run(RemoteClusterPublisher.java:343)
         ... 9 more
    Caused by: (Wrapped) java.io.StreamCorruptedException: invalid type: 169
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:265)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService$ConverterKeyToBinary.convert(PartitionedService.CDB:16)
         at com.tangosol.util.ConverterCollections$ConverterInvocableMap.invoke(ConverterCollections.java:2156)
         at com.tangosol.util.ConverterCollections$ConverterNamedCache.invoke(ConverterCollections.java:2622)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap.invoke(PartitionedCache.CDB:11)
         at com.tangosol.coherence.component.util.SafeNamedCache.invoke(SafeNamedCache.CDB:1)
         at com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher.publishBatch(AbstractCachePublisher.java:142)
         ... 10 more
    Caused by: java.io.StreamCorruptedException: invalid type: 169
         at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2265)
         at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2253)
         at com.tangosol.io.DefaultSerializer.deserialize(DefaultSerializer.java:74)
         at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2703)
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:261)
         ... 16 more
    2011-02-11 13:08:37.925/159.229 Oracle Coherence GE 3.6.1.1 <Error> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): Failed to publish EntryOperation{siteName=csfb.cs-group.com, clusterName=SPTestCluster, cacheName=source-cache, operation=Insert, publishableEntry=PublishableEntry{key=Binary(length=32, value=0x15A90F00004E07424F4F4B303038014E08494E535430393834024E0345535040), value=Binary(length=147, value=0x1281A30115AA0F0000A90F00004E07424F4F4B303038014E08494E535430393834024E03455350400248ADEEF99607060348858197BF22060448B4D8E9BE02060548A0D2CDC70E060648B0E9A2C4030607488DBCD6E50D060848B18FC1882006094E03303038402B155B014E0524737263244E1F637366622E63732D67726F75702E636F6D2D535054657374436C7573746572), originalValue=Binary(length=0, value=0x)}} to Cache passive-cache because of
    (Wrapped) java.io.StreamCorruptedException: invalid type: 169 Class:com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher
    2011-02-11 13:08:37.925/159.229 Oracle Coherence GE 3.6.1.1 <D5> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): An exception occurred while processing a InvocationRequest for Service=Proxy:ExtendTcpProxyService:TcpAcceptor: (Wrapped: Failed to publish a batch with the publisher [Active Publisher] on cache [source-cache]) java.lang.IllegalStateException: Attempted to publish to cache passive-cache
         at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
         at com.oracle.coherence.patterns.pushreplication.publishers.RemoteClusterPublisher$RemotePublishingAgent.run(RemoteClusterPublisher.java:348)
         at com.tangosol.coherence.component.net.extend.proxy.serviceProxy.InvocationServiceProxy.query(InvocationServiceProxy.CDB:6)
         at com.tangosol.coherence.component.net.extend.messageFactory.InvocationServiceFactory$InvocationRequest.onRun(InvocationServiceFactory.CDB:12)
         at com.tangosol.coherence.component.net.extend.message.Request.run(Request.CDB:4)
         at com.tangosol.coherence.component.net.extend.proxy.serviceProxy.InvocationServiceProxy.onMessage(InvocationServiceProxy.CDB:9)
         at com.tangosol.coherence.component.net.extend.Channel.execute(Channel.CDB:39)
         at com.tangosol.coherence.component.net.extend.Channel.receive(Channel.CDB:26)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.onNotify(Peer.CDB:103)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.IllegalStateException: Attempted to publish to cache passive-cache
         at com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher.publishBatch(AbstractCachePublisher.java:163)
         at com.oracle.coherence.patterns.pushreplication.publishers.RemoteClusterPublisher$RemotePublishingAgent.run(RemoteClusterPublisher.java:343)
         ... 9 more
    Caused by: (Wrapped) java.io.StreamCorruptedException: invalid type: 169
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:265)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService$ConverterKeyToBinary.convert(PartitionedService.CDB:16)
         at com.tangosol.util.ConverterCollections$ConverterInvocableMap.invoke(ConverterCollections.java:2156)
         at com.tangosol.util.ConverterCollections$ConverterNamedCache.invoke(ConverterCollections.java:2622)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap.invoke(PartitionedCache.CDB:11)
         at com.tangosol.coherence.component.util.SafeNamedCache.invoke(SafeNamedCache.CDB:1)
         at com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher.publishBatch(AbstractCachePublisher.java:142)
         ... 10 more
    Caused by: java.io.StreamCorruptedException: invalid type: 169
         at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2265)
         at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2253)
         at com.tangosol.io.DefaultSerializer.deserialize(DefaultSerializer.java:74)
         at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2703)
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:261)
         ... 16 more
    2011-02-11 13:08:47.940/169.244 Oracle Coherence GE 3.6.1.1 <Error> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): Failed to publish EntryOperation{siteName=csfb.cs-group.com, clusterName=SPTestCluster, cacheName=source-cache, operation=Insert, publishableEntry=PublishableEntry{key=Binary(length=32, value=0x15A90F00004E07424F4F4B303038014E08494E535430393834024E0345535040), value=Binary(length=147, value=0x1281A30115AA0F0000A90F00004E07424F4F4B303038014E08494E535430393834024E03455350400248ADEEF99607060348858197BF22060448B4D8E9BE02060548A0D2CDC70E060648B0E9A2C4030607488DBCD6E50D060848B18FC1882006094E03303038402B155B014E0524737263244E1F637366622E63732D67726F75702E636F6D2D535054657374436C7573746572), originalValue=Binary(length=0, value=0x)}} to Cache passive-cache because of
    (Wrapped) java.io.StreamCorruptedException: invalid type: 169 Class:com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher
    2011-02-11 13:08:47.940/169.244 Oracle Coherence GE 3.6.1.1 <D5> (thread=Proxy:ExtendTcpProxyService:TcpAcceptor, member=1): An exception occurred while processing a InvocationRequest for Service=Proxy:ExtendTcpProxyService:TcpAcceptor: (Wrapped: Failed to publish a batch with the publisher [Active Publisher] on cache [source-cache]) java.lang.IllegalStateException: Attempted to publish to cache passive-cache
         at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
         at com.oracle.coherence.patterns.pushreplication.publishers.RemoteClusterPublisher$RemotePublishingAgent.run(RemoteClusterPublisher.java:348)
         at com.tangosol.coherence.component.net.extend.proxy.serviceProxy.InvocationServiceProxy.query(InvocationServiceProxy.CDB:6)
         at com.tangosol.coherence.component.net.extend.messageFactory.InvocationServiceFactory$InvocationRequest.onRun(InvocationServiceFactory.CDB:12)
         at com.tangosol.coherence.component.net.extend.message.Request.run(Request.CDB:4)
         at com.tangosol.coherence.component.net.extend.proxy.serviceProxy.InvocationServiceProxy.onMessage(InvocationServiceProxy.CDB:9)
         at com.tangosol.coherence.component.net.extend.Channel.execute(Channel.CDB:39)
         at com.tangosol.coherence.component.net.extend.Channel.receive(Channel.CDB:26)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.onNotify(Peer.CDB:103)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
         at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.IllegalStateException: Attempted to publish to cache passive-cache
         at com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher.publishBatch(AbstractCachePublisher.java:163)
         at com.oracle.coherence.patterns.pushreplication.publishers.RemoteClusterPublisher$RemotePublishingAgent.run(RemoteClusterPublisher.java:343)
         ... 9 more
    Caused by: (Wrapped) java.io.StreamCorruptedException: invalid type: 169
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:265)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService$ConverterKeyToBinary.convert(PartitionedService.CDB:16)
         at com.tangosol.util.ConverterCollections$ConverterInvocableMap.invoke(ConverterCollections.java:2156)
         at com.tangosol.util.ConverterCollections$ConverterNamedCache.invoke(ConverterCollections.java:2622)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap.invoke(PartitionedCache.CDB:11)
         at com.tangosol.coherence.component.util.SafeNamedCache.invoke(SafeNamedCache.CDB:1)
         at com.oracle.coherence.patterns.pushreplication.publishers.cache.AbstractCachePublisher.publishBatch(AbstractCachePublisher.java:142)
         ... 10 more
    Caused by: java.io.StreamCorruptedException: invalid type: 169
         at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2265)
         at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2253)
         at com.tangosol.io.DefaultSerializer.deserialize(DefaultSerializer.java:74)
         at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2703)
         at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:261)
         ... 16 more
    It seems to be loading my POF configuration file - which also includes the standard Coherence ones as well as those required for PR - just fine, as you can see at the top of the trace.
    Any ideas why POF format for my objects is giving this error (NB. I've tested the POF stuff outside of PR and it all works fine.)
    EDIT: I've tried switching the "publisher" to the "file" publisher in PR. And that works fine. I see my POF format cached data extracted and published to the directory I specify. So the "publish" part seems to work when I use a file-publisher.
    Cheers,
    Steve

    Hi Neville,
    I don't pass any POF config parameters on the command-line. My POF file is called "pof-config.xml" so seems to be picked up by default. The trace I showed in my post shows the file being picked up.
    My POF config file content is as follows:
    <pof-config>
         <user-type-list>
              <!-- Standard Coherence POF types -->
              <include>coherence-pof-config.xml</include>
              <!-- Coherence Push Replication Required POF types -->
    <include>coherence-common-pof-config.xml</include>
    <include>coherence-messagingpattern-pof-config.xml</include>
    <include>coherence-pushreplicationpattern-pof-config.xml</include>
              <!-- User POF types (must be above 1000) -->
              <user-type>
                   <type-id>1001</type-id>
                   <class-name>com.csg.gpc.domain.model.position.trading.TradingPositionKey</class-name>
                   <serializer>
                        <class-name>com.csg.gpc.coherence.pof.position.trading.TradingPositionKeySerializer</class-name>
                   </serializer>
              </user-type>
              <user-type>
                   <type-id>1002</type-id>
                   <class-name>com.csg.gpc.domain.model.position.trading.TradingPosition</class-name>
                   <serializer>
                        <class-name>com.csg.gpc.coherence.pof.position.trading.TradingPositionSerializer</class-name>
                   </serializer>
              </user-type>
              <user-type>
                   <type-id>1003</type-id>
                   <class-name>com.csg.gpc.domain.model.position.simple.SimplePosition</class-name>
                   <serializer>
                        <class-name>com.csg.gpc.coherence.pof.position.simple.SimplePositionSerializer</class-name>
                   </serializer>
              </user-type>
              <user-type>
                   <type-id>1004</type-id>
                   <class-name>com.csg.gpc.coherence.processor.TradingPositionUpdateProcessor</class-name>
              </user-type>
         </user-type-list>
    </pof-config>
    EDIT: I'm running both clusters here from within Eclipse. Here's the POF bits from the startup of the receiving cluster:
    2011-02-11 15:05:22.607/2.328 Oracle Coherence GE 3.6.1.1 <D5> (thread=Invocation:Management, member=1): Service Management joined the cluster with senior service member 1
    2011-02-11 15:05:22.779/2.500 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded POF configuration from "file:/C:/wsgpc/GlobalPositionsCache/resource/coherence/pof-config.xml"
    2011-02-11 15:05:22.779/2.500 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6/coherence/lib/coherence.jar!/coherence-pof-config.xml"
    2011-02-11 15:05:22.779/2.500 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-common-1.7.3.20019.jar!/coherence-common-pof-config.xml"
    2011-02-11 15:05:22.779/2.500 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-messagingpattern-2.7.4.21016.jar!/coherence-messagingpattern-pof-config.xml"
    2011-02-11 15:05:22.779/2.500 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-pushreplicationpattern-3.0.3.20019.jar!/coherence-pushreplicationpattern-pof-config.xml"
    And here's the start-up POF bits from the sending cluster:
    2011-02-11 15:07:09.744/2.343 Oracle Coherence GE 3.6.1.1 <D5> (thread=Invocation:Management, member=1): Service Management joined the cluster with senior service member 1
    2011-02-11 15:07:09.916/2.515 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded POF configuration from "file:/C:/wsgpc/GlobalPositionsCache/resource/coherence/pof-config.xml"
    2011-02-11 15:07:09.916/2.515 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6/coherence/lib/coherence.jar!/coherence-pof-config.xml"
    2011-02-11 15:07:09.916/2.515 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-common-1.7.3.20019.jar!/coherence-common-pof-config.xml"
    2011-02-11 15:07:09.916/2.515 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-messagingpattern-2.7.4.21016.jar!/coherence-messagingpattern-pof-config.xml"
    2011-02-11 15:07:09.916/2.515 Oracle Coherence GE 3.6.1.1 <Info> (thread=DistributedCache:DistributedCacheForSequenceGenerators, member=1): Loaded included POF configuration from "jar:file:/C:/coherence3.6-pushreplication/coherence-3.6-pushreplicationpattern-3.0.3.20019.jar!/coherence-pushreplicationpattern-pof-config.xml"
    They both seem to be reading my pof-config.xml file.
    I have the following in my sending cluster cache config:
              <sync:provider pof-enabled="true">
                   <sync:coherence-provider />
              </sync:provider>
    And this in the receiving cache config:
    <introduce:config
    file="coherence-pushreplicationpattern-pof-cache-config.xml" />
    Cheers,
    Steve
    Edited by: stevephe on 11-Feb-2011 07:05

  • [java.nio] StreamCorruptedException when deserializing objects

    Hello everybody!
    I made a messaging (chat) program using java.io where all the client-server communication is done by serializing small objects. Now I would like to covert the server side to the NIO concept and I'm already struck. I successfully pass objects to the client and the client deserializes them, but only the first one! When it try to read the second it fails with a StreamCorruptedException.
    Here�s a sample (testing) code. In the server run() method I first serialize a string, then get its byte array from ByteArrayOutputStream and in the loop periodically send this byte array through the channel. On the client side I just read the deserialized object.
    Server run():
    public void run() {
            try {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                ObjectOutputStream oos = new ObjectOutputStream(baos);
                oos.writeObject("abcdefgh");
                byte[] objectArr = baos.toByteArray();
                baos.close();
                oos.close();
                ByteBuffer buff = ByteBuffer.allocate(objectArr.length);
                buff.put(objectArr);
                buff.flip();
                while(true) {
                    selector.select();
                    Set keys = selector.selectedKeys();
                    for (Object o : keys) {
                        SelectionKey key = (SelectionKey)o;
                        if (key.isAcceptable()) {
                            ServerSocketChannel server = (ServerSocketChannel) key.channel();
                            clientChannel = server.accept();
                            if (clientChannel == null)
                                continue;
                            clientChannel.configureBlocking(false);
                            SelectionKey clientKey = clientChannel.register(selector, SelectionKey.OP_WRITE);
                        } else if (key.isWritable()) {
                            SocketChannel client = (SocketChannel) key.channel();
                            if (buff.hasRemaining()) {
                                client.write(buff);
                            } else {
                                buff.clear();
                                buff.put(objectArr);
                                buff.flip();
                    try {
                        Thread.currentThread().sleep(2000);
                    } catch (InterruptedException e) {
                        return;
            } catch (IOException e) {
                e.printStackTrace();
        }Client run():
    public void run() {
            try {
                soc = new Socket("localhost", 4000);
                ObjectInputStream ois = new ObjectInputStream(soc.getInputStream());
                while(true) {
                    Object d = ois.readObject();
                    System.out.println("data = " + d.toString());
            } catch (Exception ex) {
                ex.printStackTrace();
        }At the second read I get a StreamCorruptedException.
    Apart from this I would like some hints in how to implement the application with NIO. For example how can I tell the objects apart on the client side � should I send every time a byte array before the object, which tells the length of the next coming object? This is probably not a 100% bulletproof solution and presents additional data transfer?
    Than you in advance!

    OK, I found a solution but I don't like it, because I don't understand it.
    The ObjectOutputStream adds a header (4 bytes) to the stream - if I send the array with those four bytes I get an StreamCorruptedException. If I send the array without the header I also get a StreamCorruptedException: "invalid stream header".
    If I reconstruct the object, by calling ObjectOutputStream.writeObject() and get it's byte array from ByteArrayOutputStream.toByteArray(), every time I have to fill the ByteBuffer, then it works.
    Here's the modified sending block, for the above example:
    } else if (key.isWritable()) {
                            SocketChannel client = (SocketChannel) key.channel();
                            if (buff.hasRemaining()) {
                                client.write(buff);
                            } else {
                                //* ---- added code ---------
                                baos.reset();
                                oos.writeObject("abcdefgh");
                                objectArr = baos.toByteArray();
                                buff.clear();
                                buff.put(objectArr);
                                buff.flip();
                        }   I really don't understand why I have to write the object in the object stream every time. I used ObjectOS and ByteArrayOS, to get the object byte array and then I thought I could forget about those streams and use this array to fill the ByteBuffer. What changes if I send the object through this process with every iteration (and how this harms speed - it's like sending everything twice)? If someone would explain this to me I would appreciate it much.

  • Problem with StreamCorruptedException: invalid stream header: 3C68746D

    Hi
    I am attempting to code a project in Java which involves the user of object serialization to send a String via serialization from an applet embedded in a JSP tp a servlet all files are running on the same machine for testing purposes.
    However I seem to be getting StreamCorruptedException: invalid stream header: 3C68746D whenever I attempt to read the inputstream once I have written to it.
    My code is as follows below (I apologise for the lack of details I have attempted to comment and simplify my code as much as possible for improved readability)
    ////////////////////////APPLET CODE////////////////
    import java.io.*;
    import java.io.Serializable;
    import javax.servlet.http.*;
    import java.applet.*;
    import javax.swing.*;
    import java.net.*;
    *Compiled using netbeans 5.1
    *Uses Apache server embedded with netbeans
    *JSP address http://localhost:8084/TestServ
    *Applet is embedded within this page
    *Servlet address http://localhost:8084/TestServ/TServ
    public class Main extends javax.swing.JApplet {
    JFrame jf;//frame for the test applet
    JTextArea jt;//result text box
    public Main() {
    jt=new JTextArea();//set up applet
    this.add(jt);
    URL servletURL;
    HttpURLConnection servletConnection;
    InputStream iStream=null;
    try
    {   //this address as far as is known is correct
    servletURL = new URL( "http://localhost:8084/TestServ/TServ" );
    //open connection to servlet
    servletConnection = (HttpURLConnection)servletURL.openConnection();
    //set up connection
    servletConnection.setDoInput(true);
    servletConnection.setDoOutput(true);
    servletConnection.setUseCaches(false);
    servletConnection.setDefaultUseCaches(false);
    //have tried "GET" and "POST" and "PUT"(PUT not directly compatible with apache servers)
    servletConnection.setRequestMethod("POST");
    servletConnection.setRequestProperty("Content-type","application/octet-stream");
    /*Have also tried application/x-java-serialized-object*/
    //set object output stream
    ObjectOutputStream outStream =
    new ObjectOutputStream(servletConnection.getOutputStream());
    //write a string for test purposes (As far as I am aware String implements Serializable)
    outStream.writeObject("h");
    //flush and close connection
    //have tried a combination of flush and/or close
    outStream.flush();
    outStream.close();
    //get input stream rdy for objectinput stream
    iStream = servletConnection.getInputStream();
    catch(IOException e)
    jt.setText("Error in output "+e);
    ObjectInputStream oInStream=null;
    String str = iStream.toString();
    //iStream at this point equals ""sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@6754d6
    try
    //this is where the error occurs
    //upon even trying to create a objectinputstream using iStream IOException occurs
    oInStream = new ObjectInputStream(iStream);
    //program does not get any further
    oInStream.close();
    catch(IOException e)
    //this error has been driving me crazy :(
    jt.setText("Error in input "+e);
    Servlet code is below however it does not even reach this point
    (If reading input stream is removed from the applet the servlet provides the same error message)
    /////////////////////Servlet code (however does not reach this point)///////////////
    import java.io.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class TServ extends HttpServlet {
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();
    ObjectInputStream inputFromApplet = null;
    InputStream in = request.getInputStream();
    BufferedReader inTest = null;
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet TServ</title>");
    out.println("</head>");
    out.println("<body>");
    try
    inputFromApplet = new ObjectInputStream(in);
    out.println("<h2>Sucess </h1>");
    catch(EOFException e)
    out.println("<h3>ERROR: " e " Error</h3>");
    out.println("<h3>End Servlet</h3>");
    out.println("</body>");
    out.println("</html>");
    out.close();
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    public String getServletInfo() {
    return "Short description";
    Thank you for your time I have searched for an answer for some time now and how found people in similar situations however no solution has been found
    Any help is appreciated
    Az

    The servlet isn't writing any objects back in reply. It is writing text. Not the same thing. If you want to read using an ObjectInputStream you have to write using an ObjectOutputStream.

  • *URGENT HELP REQUIRED* java.sql.SQLException: Invalid Oracle URL specifed

    Hi all,
    In the middle of the last week for my final year project and having to convert to an Oracle database due to compatibility problems with university Tomcat Server and MS Access. I'm having trouble connecting to the Oracle database and would appreciate some help please.
    Running on Windows 98 in the lab here, and the Oracle 9i, release 9.2.0.2.0, J2SDK1.4.0, Classes12.zip installed OK.
    Code for connection looks like this inside the constructor of my class:
    Class.forName("oracle.jdbc.driver.OracleDriver");
    cardSaleConnexion = DriverManager.getConnection("jdbc:oracle:[email protected]:1521:sid","user_name","pwdt");
    System.out.println("Connection Successful ");
    And I'm getting the following error when calling the constructor in a driver program:
    java.sql.SQLException: Invalid Oracle URL specified
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:188)
         at java.sql.DriverManager.getConnection(DriverManager.java:512)
         at java.sql.DriverManager.getConnection(DriverManager.java:171)
         at CardSale.<init>(CardSale.java:30)
         at Driver.main(Driver.java:11)
    Exception in thread "main"
    Please reply on a very urgent basis.
    Kind regards,
    Peter

    Try ojdbc14.jar as the JDBC driver instead of classes12.zip.
    Refer:
    http://otn.oracle.com/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html
    http://docs.sun.com/source/817-5603-10/index.html
    Database Driver
    This section describes the known database driver issues and associated solutions.
    ID      Summary
    4700531      On Solaris, an ORACLE JDBC driver error occurs.
         This new Java Database Connectivity (JDBC) driver is for Oracle (R) working with JDK1.4. The problem is caused by a combination of the Oracle 9.1 database and ojdbc14.jar. Applying the patch will fix the problem on Solaris 32-bit machine, running an Oracle 9.0.1.3 database.
         Solution
         Obtain and apply the patch to your server from the Oracle Web site for Bug 2199718. Perform the following steps:
         1.��Go to the Oracle web site.
         2.��Click the 'patches' button.
         3.��Type 2199718 in the patch number field.
         4.��Click the 32-bit Solaris OS patch.Go to Metalink.oracle.com.
         5.��Click patches.
         6.��Under patch number, enter 2199718.
         7.��Click the 32 bit Solaris OS patch.
    4707531      On Solaris, accessing an Oracle 9.1 database with an Oracle 9.2 Client may cause data corruption.
         If you use an Oracle (R) 9.2 client to access an Oracle 9.1 database, data corruption might occur when a number column follows a timestamp column.
         The problem might be caused by using the ojdbc14.jar file with an Oracle 9.1 database. Applying the patch might assist in addressing the situation on Solaris 32-bit machines, running an Oracle 9.1 database. This JDBC driver is for Oracle working with JDK1.4.
         Solution
         Obtain the patch that Oracle might make available from the Oracle web site for Bug 2199718 and apply it to your server.
    Regards,
    Pankaj D.

  • Java.sql.SQLException: invalid number of in_out_binds in IOV

    We're upgrading our platform from WL 4.51 SP14 to WL 6.0 SP2., Sun Solaris 2.6
    and JDK 1.3.1.
    We use oracle thin driver 8.1.6 (Type 4) for connecting to ORACLE database. We're
    encountering the following error message while executing a stored procedure. This
    error occurs very intermittently. I've looked at one of the news group threads
    and I've noticed that someone referring to patch CR04274_60.jar which had addressed
    this kind of a problem. Pl let advise us if that is correct or not. If true, pl
    let's know how we can get hold of this patch.
    ===================================================
    java.sql.SQLException: invalid number of in_out_binds in IOV
    ====================================================
    Thanks
    Ravi Garikipati

    You are hitting a bug 11672797 (more detail: http://java.net/jira/browse/ADFEMG-83).
    As a workaround you have to change the data type to oracle.jbo.domain.Number in your EO or VO if they VO is not based on a EO.
    Timo

  • Java.sql.SQLException: Invalid cursor position on saving

    Dear all
    I'm having a problem with saving components on a JSF page. The page is plit in two parts:
    1. Save report details, which are being saved correctly. Here is the code
    public String btnSaveReport_action() {
            // TODO: Process the button click action. Return value is a navigation
            // case name where null will return to the same page.
            System.out.println("Saving the report ... forsi");
            int seqNumber = SequenceNumber.getNextSequenceNo("TB_REPORTS");
            getSessionBean1().setReportFK(seqNumber);
            String reportId = "REP_" + ((String)tfReportName.getText()).replace(' ', '_').trim();
            System.out.println("ReportFK in btnSaveReport: " + getSessionBean1().getReportFK());
            //SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
            System.out.println("Start Date: " + calRepStartDate.getSelectedDate());
            //error(calRepStartDate.getValue().toString());
            //System.out.println("getvalue" + calRepStartDate.getValue());
            try {
                rk = tb_reportsDataProvider.appendRow();
                tb_reportsDataProvider.setCursorRow(rk);
                System.out.println("Setting Values ...");
                tb_reportsDataProvider.setValue("REP_PK", new Integer(seqNumber));
                tb_reportsDataProvider.setValue("REP_ID", reportId);
                tb_reportsDataProvider.setValue("REP_ACTIVE", "Y");
                tb_reportsDataProvider.setValue("REP_SESSION_FK", new Integer(getSessionBean1().getSessionId()));
                tb_reportsDataProvider.setValue("REP_NAME", (String)tfReportName.getText());
                tb_reportsDataProvider.setValue("REP_START_DATE", new java.sql.Date(calRepStartDate.getSelectedDate().getTime()));
                tb_reportsDataProvider.setValue("REP_END_DATE", new java.sql.Date(calRepEndDate.getSelectedDate().getTime()));
                System.out.println("Committing Changes ...");
                tb_reportsDataProvider.commitChanges();
                System.out.println("Refreshing Row ...");
                tb_reportsDataProvider.getCachedRowSet().refreshRow();
                getSessionBean1().getTb_reportsRowSet().refreshRow();           
    //            tb_reportsDataProvider.refresh();
    //            System.out.println("Refreshing Row ...");
    //            tb_reportsDataProvider.setCursorRow(tb_reportsDataProvider.findFirst("REP_PK",new Integer(seqNumber)));
                info("Report Data Saved Successfully!");
            } catch (SQLException sqle) {
                /* error("Cannot update report (SQLException): " +
                        reportId +
                        " : " + sqle.getMessage()); */
                log("Cannot update report (SQLException): " +
                        reportId +
                        " : " + sqle);
                info("Could not save report: " + sqle.getMessage());
                sqle.printStackTrace();
            //tfReportName.setValueBinding("sourceData", getApplication().
            //    createValueBinding("#{newReport.tb_reportsDataProvider}"));
            //tfReportName.setValueBinding("text", getApplication().createValueBinding            ("#{newReport.tb_reportsDataProvider.value['REP_NAME']}"));
            // calRepStartDate.setValueBinding("sourceData", getApplication().
            //    createValueBinding("#{newReport.tb_reportsDataProvider}"));
            //calRepStartDate.setValueBinding("selectedDate", getApplication().createValueBinding            ("#{newReport.tb_reportsDataProvider.value['REP_START_DATE']}"));
            //calRepEndDate.setValueBinding("sourceData", getApplication().
            //    createValueBinding("#{newReport.tb_reportsDataProvider}"));
            //calRepEndDate.setValueBinding("selectedDate", getApplication().createValueBinding            ("#{newReport.tb_reportsDataProvider.value['REP_END_DATE']}"));
            info("Report Name: " + tb_reportsDataProvider.getValue("REP_NAME"));
            tfReportName.validate(this.getFacesContext());
            calRepStartDate.validate(this.getFacesContext());
            calRepEndDate.validate(this.getFacesContext());
            tfReportName.setDisabled(true);
            calRepStartDate.setDisabled(true);
            calRepEndDate.setDisabled(true);
            btnNewQuery.setDisabled(false);
            btnSaveReport.setDisabled(true);
            return null;
        }The problem is that the reportFK is losing its value when I submit the page the second time! I am trying to get the value from the provider or from the rowset, but none work. Here is the code I am trying ...
    public String btnSaveQuery_action() {
            // TODO: Process the button click action. Return value is a navigation
            // case name where null will return to the same page.
            int seqNumber  = 0;
            // Save the query header details to the database  
            try {
                // Start with the query - needed for the link table
                seqNumber = SequenceNumber.getNextSequenceNo("TB_QUERY");
                String queryId = "QRY_" + ((String)tfQueryName.getText()).replace(' ', '_').trim();
                tb_queryDataProvider.setCursorRow(queryRowKey);
                tb_queryDataProvider.setValue("QRY_PK", new BigDecimal(seqNumber));
                tb_queryDataProvider.setValue("QRY_CODE", queryId);
                tb_queryDataProvider.setValue("QRY_NAME", (String)tfQueryName.getText());
                tb_queryDataProvider.setValue("QRY_ACTIVE", "Y");
                tb_queryDataProvider.setValue("QRY_SESS_FK", new BigDecimal(getSessionBean1().getSessionId()));
                System.out.println("Committing Changes ...");
                tb_queryDataProvider.commitChanges();
                System.out.println("Refreshing Row ...");
                tb_queryDataProvider.setCursorRow(tb_queryDataProvider.findFirst("QRY_PK",new Integer(seqNumber)));
                getSessionBean1().getTb_queryRowSet().refreshRow();
                info("Query Data Saved Successfully!");
            } catch (Exception ex) {
                error("Error while saving query: " + ex.getMessage());
                log("Error while saving query" + ex);
                ex.printStackTrace();
            // Now save the link
            try {
                // Start with the query - needed for the link table
                String sql = "INSERT INTO TB_LINK_REPORT_QUERY ( " +
                   "LRQ_PK, LRQ_REP_FK, LRQ_QRY_FK, " +
                   "LRQ_TYPE, LRQ_START_DATE, LRQ_END_DATE, " +
                   "LRQ_ACTIVE, LRQ_SESS_FK) " +
                   "VALUES (?,?,?,?,?,?,?,?)";
                System.out.println("Trying to do the link");
                int linkSeqNumber = SequenceNumber.getNextSequenceNo("TB_LINK_REPORT_QUERY");           
                PreparedStatement pstmt = DBConnection.getConnection().prepareStatement(sql);
                if (getSessionBean1().getReportFK() == -1 || getSessionBean1().getReportFK() == 0)
                    System.out.println("reportFK = -1 or 0!!! Trying from provider.");
                    System.out.println("Report PK is: " + getSessionBean1().getTb_reportsRowSet().getBigDecimal("REP_PK"));
                    getSessionBean1().setReportFK(((Integer)tb_reportsDataProvider.getValue("REP_PK")).intValue());
                System.out.println("Report Foreign Key: " + getSessionBean1().getReportFK());
                System.out.println("Query Foreign Key: " + seqNumber);
                pstmt.setInt(1, linkSeqNumber);
                pstmt.setInt(2, getSessionBean1().getReportFK());
                pstmt.setInt(3, seqNumber);
                pstmt.setString(4, (String)dropDownQueryType.getSelected());
                pstmt.setDate(5, new java.sql.Date(calendarQueryStartDate.getSelectedDate().getTime()));
                pstmt.setDate(6, new java.sql.Date(calendarQueryEnd.getSelectedDate().getTime()));
                pstmt.setString(7, "Y");
                pstmt.setInt(8, getSessionBean1().getSessionId());
                System.out.println("Committing Changes for Link ...");
                pstmt.executeUpdate();
                DBConnection.getConnection().commit();
                System.out.println("Refreshing Row in link ...");
                getSessionBean1().getTb_link_report_queryRowSet().setObject(
                        1, new Integer(linkSeqNumber));
                getSessionBean1().getTb_link_report_queryRowSet().setObject(
                        2, new Integer(getSessionBean1().getReportFK()));
                getSessionBean1().getTb_link_report_queryRowSet().setObject(
                        3, calendarQueryStartDate.getSelectedDate());
                getSessionBean1().getTb_link_report_queryRowSet().setObject(
                        4, calendarQueryEnd.getSelectedDate());
                tb_link_report_queryDataProvider.refresh();
                info("Link Data Saved Successfully!");
            } catch (Exception ex) {
                error("Error while saving query: " + ex.getMessage());
                log("Error while saving link: " + ex);
                ex.printStackTrace();
            return null;
        }The part saving the query with the provider is working correctly. But the part with the link is not working at all (the part with the PreparedStatement). The fact is that the PreparedStatement cannot be executed because I am getting the error at the line
    System.out.println("Report PK is: " + getSessionBean1().getTb_reportsRowSet().getBigDecimal("REP_PK"));Can anyone help please?
    Thanks and Regards
    Joseph

    guys if any of you have an idea just post it. It would be of great help for me. I can't figure out my mistake and its been 2days already and still i am stuck with my problem.
    It displays the table but there is an error "java.sql.SQLException: Invalid cursor position" so i cannot put the counter to the session.

  • Java.io.StreamCorruptedException: InputStream does not contain a serialized object

              I have an applet which calls a JSP to write data object to the db and then the
              JSP sends back the updated data object. The writing part is ok but the response
              is giving the following error. The data object is in a separate class which implements
              Serialized.
              Here's the code in the applet calling the JSP and the response from the JSP
              URL server = null;
              String urlConnectionString = "http://localhost:7001/isLoginValid.jsp";
              try
              server = new URL(urlConnectionString);
              catch(MalformedURLException e)
              System.out.println("URL exception: " + e );
              // send request
              ObjectInputStream response = null;
              Object result = null;
              try
              URLConnection conn = server.openConnection();
              conn.setDoOutput(true);
              conn.setUseCaches(false);
              conn.setRequestProperty("Content-Type", "application/octet-stream");
              ObjectOutputStream request = new ObjectOutputStream(new
              BufferedOutputStream(conn.getOutputStream()));
              request.writeObject((Object)dvo);
              request.flush();
              request.close();
              // get the result input stream
              response = new ObjectInputStream(new BufferedInputStream
              (conn.getInputStream()));
              // read response back from the server
              result = response.readObject();
              if( result!=null && (result instanceof DataVO))
              dvo = (DataVO)result;
              String vo = dvo.printDataVO();
              System.out.println("*DataVO*\n"+vo);
              else
              System.out.println("not an instanceof DataVO");
              catch(IOException ignored)
              System.out.println("Error in DataVO response");
              ignored.printStackTrace();
              Here's the code in the JSP sending the response back to the applet. The 'dvo'
              object is the object which is serialized and has gets and sets for the diff. data
              elements. When I print the 'dvo' before writing the object to outputStream it
              prints the correct values for the data element.
              // send response
              response.setStatus(HttpServletResponse.SC_OK);
              ObjectOutputStream outputStream = new ObjectOutputStream (new BufferedOutputStream
              (response.getOutputStream()));
              outputStream.writeObject(dvo);
              outputStream.flush();
              ERROR is as follows:
              Error in DataVO response
              java.io.StreamCorruptedException: InputStream does not contain a serialized object
              at java/io/ObjectInputStream.readStreamHeader
              at java/io/ObjectInputStream.<init>
              What am I doing wrong?. Please respond soon. The applet is run on IIS and the
              JSP in on weblogic 6.1. I'm not sure if that makes any difference.
              

              I have an applet which calls a JSP to write data object to the db and then the
              JSP sends back the updated data object. The writing part is ok but the response
              is giving the following error. The data object is in a separate class which implements
              Serialized.
              Here's the code in the applet calling the JSP and the response from the JSP
              URL server = null;
              String urlConnectionString = "http://localhost:7001/isLoginValid.jsp";
              try
              server = new URL(urlConnectionString);
              catch(MalformedURLException e)
              System.out.println("URL exception: " + e );
              // send request
              ObjectInputStream response = null;
              Object result = null;
              try
              URLConnection conn = server.openConnection();
              conn.setDoOutput(true);
              conn.setUseCaches(false);
              conn.setRequestProperty("Content-Type", "application/octet-stream");
              ObjectOutputStream request = new ObjectOutputStream(new
              BufferedOutputStream(conn.getOutputStream()));
              request.writeObject((Object)dvo);
              request.flush();
              request.close();
              // get the result input stream
              response = new ObjectInputStream(new BufferedInputStream
              (conn.getInputStream()));
              // read response back from the server
              result = response.readObject();
              if( result!=null && (result instanceof DataVO))
              dvo = (DataVO)result;
              String vo = dvo.printDataVO();
              System.out.println("*DataVO*\n"+vo);
              else
              System.out.println("not an instanceof DataVO");
              catch(IOException ignored)
              System.out.println("Error in DataVO response");
              ignored.printStackTrace();
              Here's the code in the JSP sending the response back to the applet. The 'dvo'
              object is the object which is serialized and has gets and sets for the diff. data
              elements. When I print the 'dvo' before writing the object to outputStream it
              prints the correct values for the data element.
              // send response
              response.setStatus(HttpServletResponse.SC_OK);
              ObjectOutputStream outputStream = new ObjectOutputStream (new BufferedOutputStream
              (response.getOutputStream()));
              outputStream.writeObject(dvo);
              outputStream.flush();
              ERROR is as follows:
              Error in DataVO response
              java.io.StreamCorruptedException: InputStream does not contain a serialized object
              at java/io/ObjectInputStream.readStreamHeader
              at java/io/ObjectInputStream.<init>
              What am I doing wrong?. Please respond soon. The applet is run on IIS and the
              JSP in on weblogic 6.1. I'm not sure if that makes any difference.
              

Maybe you are looking for

  • ODBC--connection to 'SQL Serverservername' failed for one user but not another

    In Win7, we're linking tables in an MS Access 2010 db to tables in a SQL Server 2008 R2 db. The driver user by the File dsn is SQL Server version 6.01.7601.17514 & we're using SQL Server Authentication. For some reason, one user gets the msg "ODBC--c

  • Java.io and java.swing help

    i'm writing a program that write the byte representation of numbers and outputs them to a joptionpane window it keeps telling me that void functions are not allowed is there any way that i can use void functions in my output? or would i need to chang

  • Extended idoc not populating(urgent)

    hi guys i have extended the basic idoc type delvry03 and created an extension delvrtext for it.however when i trigger the idoc from an output type the extended segments are not populated.is there a way you can put a break point in the code.if that is

  • AEBS won't assign IP via Wired ports, but it does assign IP Wirelessly

    I'm having the strangest problem, my AEBS will assign an IP address in the 192.168.1.X range when connected to it wirelessly, but when I connect to it via one of the wired ethernet ports in the back I get a bad IP (169.XXX.XXX.XX). This started happe

  • WiFi connectivity on E5-00 !

    i have a problem with the wifi on my mobile e5, i can't connect with the wireless network at home or anywhere, when i open the "conn. manager" and select "active data connections" it read that i'm connected to the wireless network but ( inactive ), s