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.. :/

Similar Messages

  • 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!
    &#20320;&#22909;&#65281;&#24863;&#35874;&#20320;&#30340;&#24110;&#21161;&#65281;&#31532;&#19968;&#27425;&#26469;&#21040;sun &#35770;&#22363;&#26469;&#25552;&#38382;&#65292;&#24456;&#28608;&#21160;&#21834;&#65292;&#21621;&#21621;&#12290;
    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)
    &#19979;&#38754;&#26159;NetCotroller&#31867;&#30340;&#19968;&#20010;&#20869;&#37096;&#31867;&#65292;&#36127;&#36131;&#25509;&#25910;&#25968;&#25454;&#65306;
    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);
                       //&#21040;&#19979;&#38754;&#36825;&#21477;&#26102;&#65292;&#23601;&#25243;&#20986;&#20102;&#37027;&#24322;&#24120;&#65281;
               // 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

  • 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: 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 "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.io.StreamCorruptedException: Type code out of  range, is 63

    Hi,
    i ma using Weblogic 7.0 ......... I got one exception in the weblogic log, Exception is as follows -
    ####<Nov 28, 2006 3:15:54 PM EST> <Info> <EJB> <atnyprd5>
    <XXXServer1> <ExecuteThread: '83' for queue: 'default'> <kernel identity>
    <11864:d63651c3623375dd> <010051> <EJB Exception during invocation from home:
    [email protected]53 threw exception:
    com.xxxxxx.exception.XXXXXXEJBException: MSG: javax.naming.CommunicationException
    [Root exceptionis java.rmi.UnmarshalException: cannot unmarshaling return; nested  exception is:   1990         
    java.io.StreamCorruptedException: Type code out of  range, is 63]null TIME: 0> 1991
    com.xxxxxx.exception.xxxxxxEJBException: MSG: javax.naming.CommunicationException
    [Root exception is java.rmi.UnmarshalException: cannot  unmarshaling return; nested exception is:   1992
    java.io.StreamCorruptedException: Type code out of  range, is 63]null TIME: 0 1993
    at com.xxxxxx.util.EJBUtil.handleSysError (EJBUtil.java:40) 1994
    at com.xxxxxx.util.EJBUtil.handleSysError (EJBUtil.java:59) 1995
    at com.xxxxxx.db.DbAccess.initConnection (DbAccess.java:98) 1996
    at com.xxxxxx.db.DbAccess.<init>(DbAccess.java:37)
    I am getting this exception while fetching a datasource connection from the connection pool of weblogic.
    My applciation is running for past 2 years and we did not got this exception before, So I suspect there is no problem in the code......... where it is going wrong ????
    Please help me in this......
    Thanks and regards

    Hi,
    atleast any idea about what the exception is and what it is related to ???
    Its bit urjent to resolve
    Thankx and Regards

  • Java.io.StreamCorruptedException: Type code out of range, is -20

    Hi ,
    When i am connecting from a client to an EJB running in Weblogic on the localhost , I got the follwoing exception.
    GENERAL-EXCEPTION: java.rmi.UnmarshalException: failed to unmarshal cookie; nest
    ed exception is:
    java.io.StreamCorruptedException: Type code out of range, is -20
    java.rmi.UnmarshalException: failed to unmarshal cookie; nested exception is:
    java.io.StreamCorruptedException: Type code out of range, is -20
    java.io.StreamCorruptedException: Type code out of range, is -20
    at java.io.ObjectInputStream.peekCode(ObjectInputStream.java:1551)
    at java.io.ObjectInputStream.refill(ObjectInputStream.java:1679)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:278)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
    at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
    bjectInputStream.java:140)
    at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.ja
    va:91)
    at weblogic.rjvm.ResponseImpl.getReplicaInfo(ResponseImpl.java:171)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:264)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
    ef.java:229)
    Can anyone tell what this type code -20 is?

    www.google.com is your friend.
    http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=Type+code+out+of+range%2C+is+-20&btnG=Google+Search

  • Java.io.StreamCorruptedException: Type code out of range, is 0, BLOB, Weblogic 7, Oracle 8i

    Test message

    Nagaraju wrote:
    Hi
    I am trying to insert a Java Object ( Serialized Bean) into Oracle BLOB. I am getting the following exception when reading back from Blob. Following is the code and the Exception stack is pasted below. I am using weblogic 7.0 Applcation server/Oracle 8.i
    If any body have an idea please let me know.
    Thanks is advance..
    Nagaraju.
    java.io.StreamCorruptedException: Type code out of range, is 0
    at java.io.ObjectInputStream.peekCode(ObjectInputStream.java:1551)
    at java.io.ObjectInputStream.refill(ObjectInputStream.java:1679)
    at java.io.ObjectInputStream.read(ObjectInputStream.java:1655)
    at java.io.DataInputStream.readInt(DataInputStream.java:333)
    at java.io.ObjectInputStream.readInt(ObjectInputStream.java:1975)
    at java.util.SimpleTimeZone.readObject(SimpleTimeZone.java:1437)Hi. Unless you post the whole stacktrace, or at least enough of it to show
    some weblogic or even jdbc classes, we can have no clue what this is about...
    Joe

  • It says invalid post code when it is actually the right one.what should I do in such a case?

    It says invalid post code when it is actually the right one.what should I do in such a case?

    That issue can be caused by corrupted cookies.
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Firefox > Preferences > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Firefox > Preferences > Privacy > Cookies: "Show Cookies"
    If clearing the cookies doesn't help then it is possible that the file <i>cookies.sqlite</i> that stores the cookies is corrupted.
    Rename (or delete) <b>cookies.sqlite</b> (cookies.sqlite.old) and delete <b>cookies.sqlite-journal</b> and <b>cookies.txt</b>, if they exist, in the Firefox Profile Folder in case the file cookies.sqlite got corrupted.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox

  • 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

  • Invalid Response Code 401 when calling webservice via wsil

    Hi Experts,
    I have some web services which use destinations which I maintained in Visual Admin under Web Service Security. For authentication I use SAP Logon Tickets. Everything worked fine until I applied SPS14 for nw04s. No I suddenly get the following Exeption:
      com.sap.engine.services.webservices.espbase.discovery.BaseIOException: Invalid Response Code 401 while accessing URL: http://localhost:80/inspection.wsil. Response Message: Unauthorized. Content Type: text/html. Body Content: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Error Report</title> <style> td {font-family : Arial, Tahoma, Helvetica, sans-serif; font-size : 14px;} A:link A:visited A:active </style> </head> <body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" rightmargin="0"> <table width="100%" cellspacing="0" cellpadding="0" border="0" align="left" height="75"> <tr bgcolor="#FFFFFF"> <td align="left" colspan="2" height="48"><font face="Arial, Verdana, Helvetica" size="4" color="#666666"><b>  401 &nbsp Unauthorized</b></font></td> </tr> <tr bgcolor="#3F73A3"> <td height="23" width="84"><img width=1 height=1 border=0 alt=""></td> <td height="23"><img width=1 height=1 border=0 alt=""></td> <td align="right" height="23"><font face="Arial, Verdana, Helvetica" size="2" color="#FFFFFF"><b>SAP J2EE Engine/7.00 </b></font></td> </tr> <tr bgcolor="#9DCDFD"> <td height="4" colspan="3"><img width=1 height=1 border=0 alt=""></td> </tr> </table> <br><br><br><br><br><br> <table width="100%" cellspacing="0" cellpadding="0" border="0" align="left" height="75"> <tr bgcolor="#FFFFFF"> <td align="left" colspan="2" height="48"><font face="Arial, Verdana, Helvetica" size="3" color="#000000"><b>  No login module succeeded.</b></font></td> </tr> <tr bgcolor="#FFFFFF"> <td align="left" valign="top" height="48"><font face="Arial, Verdana, Helvetica" size="2" color="#000000"><b>  Details:</b></font></td> <td align="left" valign="top" height="48"><font face="Arial, Verdana, Helvetica" size="3" color="#000000"><pre>  No details available</pre></font></td> </tr> </body> </html>
        at com.sap.engine.services.webservices.server.management.discovery.DestinationsResolver.resolveURL(DestinationsResolver.java:220)
        at com.sap.engine.services.webservices.server.management.discovery.DestinationsResolver.resolveEntity(DestinationsResolver.java:120)
        at com.sap.engine.services.webservices.espbase.query.WSQueryImpl.initialize(WSQueryImpl.java:184)
        at com.sap.engine.services.webservices.espbase.query.WSQueryImpl.findWSInterfaces(WSQueryImpl.java:151)
        at com.sap.engine.services.webservices.server.management.discovery.ServiceDiscoveryImpl.getWSDLUrl(ServiceDiscoveryImpl.java:71)
        ... 58 more
    The strange thing is, when I set the destination to use basic authentication with user and pwd it works again. But then the given user account is used for authentication and not the account of the calling user. If I return to logonTickets it works correctly! When I restart the server I get the error again.
    Strange problem. I have this problem since I applied SPS14. Do I have to configure something additionally? I know there were changes made in the topic of web service security. Or could it be a bug of sps14?
    Any help is appreciated!
    Regards Manuel

    Hi,
    in sps14 the security levels are a bit stricter than before. So in my case, I was not allowed to access the inspection.wsil with web services. I solved my problem by changing the
    [sap.com/com.sap.engine.services.webservices.tool*inspection.wsil] authentication stack (policy configuration) to look like this:
    EvaluateTicketLoginModule SUFFICIENT
    BasicPasswordLoginModule REQUIRED
    CreateTicketLoginModule SUFFICIENT
    and additionally I had to map the WSIL_SecurityRole security role only to the
    role SAP-J2EE-Engine/all.
    I hope this helps.
    Regards Manuel

  • Invalid Java code from oracg

    I'm having a problem with oracg generating invalid Java code using XDK for Java 9.2.0.5.0 on Solaris 8.
    Specifically, oracg generates invalid Type names for elements that have both attributes and complexTypes; at least, that's where I'm having problems with it.
    I've included my test case in this posting. I have defined the following structure in test.xsd:
    <test lang="en">
    <table border="0">
    <tr>
    <td>blah</td>
    </tr>
    </table>
    </test>
    Then, oracg generates an add method for TestType as:
    public void addTable(TestType.Lang.Table thetable)
    It doesn't seem to realize that Lang is an attribute, and
    it puts it in the type path. This happens throughout the TestType.java file.
    Please advise.
    Thanks,
    -Darren
    P.S. I'm using "oracle-xdk-9.2.0.5.0/bin/oracg -schema test.xsd -outputDir src -package test"
    ========
    test.xsd
    ========
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema targetNamespace="http://xmlns/test" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns/test" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
    <xs:complexType name="testType" mixed="false">
    <xs:choice maxOccurs="unbounded">
    <xs:element name="table" nillable="false">
    <xs:complexType mixed="false">
    <xs:sequence maxOccurs="unbounded">
    <xs:element name="tr" nillable="false">
    <xs:complexType mixed="false">
    <xs:sequence maxOccurs="unbounded">
    <xs:element name="td" nillable="true"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:sequence>
    <xs:attribute name="border" type="xs:nonNegativeInteger" use="optional" default="1"/>
    <xs:attribute name="cellspacing" type="xs:nonNegativeInteger" use="optional" default="2"/>
    <xs:attribute name="cellpadding" type="xs:nonNegativeInteger" use="optional" default="2"/>
    </xs:complexType>
    </xs:element>
    </xs:choice>
    <xs:attribute name="lang" use="optional" default="en">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:minLength value="1"/>
    <xs:maxLength value="10"/>
    <xs:enumeration value="en"/>
    <xs:enumeration value="es"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:attribute>
    </xs:complexType>
    <xs:element name="test" type="testType" nillable="false"/>
    </xs:schema>
    =============
    TestType.java
    =============
    /* DO NOT EDIT THIS FILE - it is machine-generated */
    /* File: TestType.java - generated by XML Class Generator version 2.0.0 at Mon Jun 30 13:26:33 PDT 2003 */
    package test.types;
    import oracle.xml.parser.schema.*;
    import oracle.xml.parser.v2.*;
    import oracle.xml.classgen.CGXSDElement;
    import oracle.xml.classgen.InvalidContentException;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class TestType extends CGXSDElement
    static final String name = "testType";
    static final String namespace = "http://xmlns/test";
    protected TestType.Lang alang;
    public void setLang(TestType.Lang thelang)
    throws IllegalArgumentException
    this.alang = thelang;
    super.addAttribute("lang" , thelang.getNodeValue());
    public static class Lang extends CGXSDElement
    public Lang(XSDDataValue elemValue)
    throws InvalidContentException
    try
    Hashtable h = XSDSimpleType.getBuiltInDatatypes();
    XSDSimpleType baseType = (XSDSimpleType)h.get("string");
    type = XSDSimpleType.derivedFrom(baseType,"string", " ");
    XSDSimpleType stype = (XSDSimpleType)type;
    stype.setFacet("maxLength","10");
    stype.setFacet("minLength","1");
    stype.setFacet("enumeration","en");
    stype.setFacet("enumeration","es");
    String nodeValue = elemValue.getLexicalValue();
    stype.validateValue(nodeValue);
    super.setNodeValue(nodeValue);
    catch (Exception e)
    throw new InvalidContentException("Error: Invalid value.");
    public Lang(String value)
    throws InvalidContentException
    try
    Hashtable h = XSDSimpleType.getBuiltInDatatypes();
    XSDSimpleType baseType = (XSDSimpleType)h.get("string");
    type = XSDSimpleType.derivedFrom(baseType,"string", " ");
    XSDSimpleType stype = (XSDSimpleType)type;
    stype.setFacet("maxLength","10");
    stype.setFacet("minLength","1");
    stype.setFacet("enumeration","en");
    stype.setFacet("enumeration","es");
    stype.validateValue(value);
    super.setNodeValue(value);
    catch (Exception e)
    throw new InvalidContentException("Error: Invalid value.");
    public void addTable(TestType.Lang.Table thetable)
    throws InvalidContentException
    super.addElement(thetable);
    public static class Table extends CGXSDElement
    static final String name = "table";
    static final String namespace = "http://xmlns/test";
    public Table()
    super();
    public void setType(TestType.Lang.Table.Table_Type elemtype)
    throws IllegalArgumentException
    this.type = elemtype;
    public void print(XMLOutputStream out)
    throws IOException
    super.printAttributes(out, name, namespace);
    public static class Table_Type extends CGXSDElement
    static final String name = "Table_Type";
    static final String namespace = "http://xmlns/test";
    protected Integer aborder;
    protected Integer acellspacing;
    protected Integer acellpadding;
    public void setBorder(Integer theborder)
    throws IllegalArgumentException
    this.aborder = theborder;
    super.addAttribute("border" , theborder);
    public Integer getBorder()
    throws IllegalArgumentException
    return this.aborder;
    public void setCellspacing(Integer thecellspacing)
    throws IllegalArgumentException
    this.acellspacing = thecellspacing;
    super.addAttribute("cellspacing" , thecellspacing);
    public Integer getCellspacing()
    throws IllegalArgumentException
    return this.acellspacing;
    public void setCellpadding(Integer thecellpadding)
    throws IllegalArgumentException
    this.acellpadding = thecellpadding;
    super.addAttribute("cellpadding" , thecellpadding);
    public Integer getCellpadding()
    throws IllegalArgumentException
    return this.acellpadding;
    public void addTr(TestType.Lang.Table.Table_Type.Tr thetr)
    throws InvalidContentException
    super.addElement(thetr);
    public static class Tr extends CGXSDElement
    static final String name = "tr";
    static final String namespace = "http://xmlns/test";
    public Tr()
    super();
    public void setType(TestType.Lang.Table.Table_Type.Tr.Tr_Type elemtype)
    throws IllegalArgumentException
    this.type = elemtype;
    public void print(XMLOutputStream out)
    throws IOException
    super.printAttributes(out, name, namespace);
    public static class Tr_Type extends CGXSDElement
    static final String name = "Tr_Type";
    static final String namespace = "http://xmlns/test";
    public void addTd(TestType.Lang.Table.Table_Type.Tr.Tr_Type.Td thetd)
    throws InvalidContentException
    super.addElement(thetd);
    public static class Td extends CGXSDElement
    static final String name = "td";
    static final String namespace = "http://xmlns/test";
    public Td()
    super();
    public void setType(TestType.Lang.Table.Table_Type.Tr.Tr_Type.Td.Td_Type elemtype)
    throws IllegalArgumentException
    this.type = elemtype;
    public void print(XMLOutputStream out)
    throws IOException
    super.printAttributes(out, name, namespace);
    public static class Td_Type extends CGXSDElement
    static final String name = "Td_Type";
    static final String namespace = "http://xmlns/test";
    public void addText(String text)
    super.addElement(new String(text));
    public void addCDATA(String text)
    super.addElement(new String(text));
    public Vector getChildElements()
    return super.getChildElements();
    public void print(XMLOutputStream out)
    throws IOException
    super.print(out);
    public void validate(XMLSchema schema)
    public Vector getChildElements()
    return super.getChildElements();
    public void print(XMLOutputStream out)
    throws IOException
    super.print(out);
    public void validate(XMLSchema schema)
    public Vector getChildElements()
    return super.getChildElements();
    public void print(XMLOutputStream out)
    throws IOException
    super.print(out);
    public void validate(XMLSchema schema)
    public Vector getChildElements()
    return super.getChildElements();
    public void print(XMLOutputStream out)
    throws IOException
    super.print(out);

    Malaya_Kishore wrote:
    Inorder to get the advantages of latest features of Java1.6 [*performance, security*, etc], the code needs to be recompiled using JDK1.6Why do you think that?
    As I understand it you have two types of "latest features". Bug fixes, JVM updates and the like in which case recompiling will have no affect. API or language updates, when you will not simply recompile but update your code base to make use off.
    The only thing I can think of that a simple recompile would help with is if the compiler updates. I'd guess this would be minimal .
    Edited by: mlk on 22-Aug-2008 09:40

  • 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

  • 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.

Maybe you are looking for

  • WORST CUSTOMER SUPPORT FROM APPLE !!

    To tell in brief "I did not expect this from Apple".I made the purchase of iPhone 5 thorough the Singapore-website,the purchase was made thorough my Debit Card and as soon as the purchase was made the amount of s$948 was debitted from my account and

  • Cannot Login... Help !

    Hi, I am an experimented Mac user, but quite new with Snow Leopard Server. I've just purchased the brand new MacMini Server. I have configured my server with the name server.local and installed OpenDirectory as Master. I wanted to try the network log

  • Classic 160GB, Itunes and Windows Explorer all disagree on how much space is on the Ipod

    Hi, I restored and resynced my Ipod Classic 160GB (about 2.5-3 years old) to see if it would help a problem I was having when plugging it into my stereo receiver via USB (the receiver was only recognizing it for four or five songs, then losing the co

  • How to improve poor video quality in iMovie?

    I have a movie in iTunes (version 10.6.3).  When I play the video, the quality is good on my Mac, on my iPad 3 and on my Apple TV.  The Apple TV is hooked to a 42-inch LCD TV. Next, I open the video file (MP4) using QuickTime Player.  I use the Edit

  • ICloud and outlook problem

    I use a pc for my work calendar and a mac at home.  I had my work calendar so I could view and edit it on my personal calendar (mac) with mobileme I updated to iCloud now my work calendar on outlook won't open it says "The set of folders cannot be op