Java.io.StreamCorruptedException
Hi I'm currently working on a project which deals with objectStreams.
When a client connects to the server, the server creates a send thread and a receive thread to serve the client.As one can imagine there is an ObjectInputStream accepting objects from the client in the receive thread and an ObjectOutputStream in the send thread to send objects.
However in order to assure that the client has not disconnected there is one more ObjectOutputStream in the receive thread that send PING messages to the client. The addition of this stream causes StreamCorruptedException. When rewriting the code using DataStreams ,instead of ObjectStreams,it works perfectly.
I make sure that every ObjectOutputStream is flushed,i create them before the corresponding ObjectInputStreams and i access the sockets using synchronized (socket)when i attempt to get the input and ouput streams.
When I disable the ping function thus, not creating the ObjectOutputStream from the receive thread side, my application is working...
can anybody give me a tip?
It would be very much appreciated. Thanks in advance
can anybody give me a tip?Yes. Don't. Use the same ObjectOutputStream for both purposes, or use the DataOutputStream for the ping as you already discovered. Object streams have headers and state so you can't just add another one to the same stream.
Similar Messages
-
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.
-
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 -
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 regardsHi,
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 -
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 -
Help needed!
I'm using WLS6.1 with SP1.
Calling weblogic.deploy on command line causes the following exceptions no
matter if i'm using list or deploy option:
java weblogic.deploy -port 7501 list 12345678
java.io.StreamCorruptedException: Type code out of range, is 0
at java.io.ObjectInputStream.peekCode(ObjectInputStream.java:1280)
at
java.io.ObjectInputStream.SkipToEndOfBlockData(ObjectInputStream.java:1211)
at
java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:776)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:353)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:232)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:978)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:232)
at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectIn
putStream.java:107)
at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectIn
putStream.java:115)
at
weblogic.rjvm.ConnectionManager.readPeerInfo(ConnectionManager.java:686)
at
weblogic.rjvm.ConnectionManagerClient.handleIdentifyResponse(ConnectionManag
erClient.java:140)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:627)
at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)
--------------- nested within: ------------------
weblogic.utils.AssertionError: ***** ASSERTION FAILED ***** - with nested
exception:
[java.io.StreamCorruptedException: Type code out of range, is 0]
at
weblogic.rjvm.ConnectionManager.readPeerInfo(ConnectionManager.java:688)
at
weblogic.rjvm.ConnectionManagerClient.handleIdentifyResponse(ConnectionManag
erClient.java:140)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:627)
at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
Code)
JNDI naming exception: Naming exception trying to connect to:
t3://localhost:7501 as: system: beaadminyes, that was the reason.
thank you very much!
"Dimitri Rakitine" <[email protected]> schrieb im Newsbeitrag
news:[email protected]...
That sounds like you use 1.2 on the client side - make sure that you use1.3.
>
In weblogic.developer.interest.ejb Nora Serinek <[email protected]>
wrote:
Help needed!
I'm using WLS6.1 with SP1.
Calling weblogic.deploy on command line causes the following exceptionsno
matter if i'm using list or deploy option:
java weblogic.deploy -port 7501 list 12345678
java.io.StreamCorruptedException: Type code out of range, is 0
at
java.io.ObjectInputStream.peekCode(ObjectInputStream.java:1280)
at
java.io.ObjectInputStream.SkipToEndOfBlockData(ObjectInputStream.java:1211)
at
java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:776)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:353)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:232)
atjava.io.ObjectInputStream.inputObject(ObjectInputStream.java:978)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
atjava.io.ObjectInputStream.readObject(ObjectInputStream.java:232)
at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectIn
putStream.java:107)
at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectIn
putStream.java:115)
at
weblogic.rjvm.ConnectionManager.readPeerInfo(ConnectionManager.java:686)
at
weblogic.rjvm.ConnectionManagerClient.handleIdentifyResponse(ConnectionManag
erClient.java:140)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:627)
atweblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,Compiled
Code)
--------------- nested within: ------------------
weblogic.utils.AssertionError: ***** ASSERTION FAILED ***** - withnested
exception:
[java.io.StreamCorruptedException: Type code out of range, is 0]
at
weblogic.rjvm.ConnectionManager.readPeerInfo(ConnectionManager.java:688)
at
weblogic.rjvm.ConnectionManagerClient.handleIdentifyResponse(ConnectionManag
erClient.java:140)
at
weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:627)
atweblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets2(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java,
Compiled Code)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,Compiled
Code)
JNDI naming exception: Naming exception trying to connect to:
t3://localhost:7501 as: system: beaadmin--
Dimitri -
Am running into following exception even after following all guidelines to implement POF. The main objective is to perform Distributed Bulk cache loading.
Oracle Coherence GE 3.7.1.10 <Error> (thread=Invocation:InvocationService, member=1): Failure to deserialize an Invocable object: java.io.StreamCorruptedException: unknown user type: 1001
java.io.StreamCorruptedException: unknown user type: 1001
at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3312)
at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2604)
at com.tangosol.io.pof.ConfigurablePofContext.deserialize(ConfigurablePofContext.java:371)
at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.readObject(Service.CDB:1)
at com.tangosol.coherence.component.net.Message.readObject(Message.CDB:1)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.InvocationService$InvocationRequest.read(InvocationService.CDB:8)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.deserializeMessage(Grid.CDB:19)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:31)
at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
at java.lang.Thread.run(Thread.java:662)
Following is the pof-config.xml
<?xml version="1.0" encoding="UTF-8" ?>
<pof-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.oracle.com/coherence/coherence-pof-config"
xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-pof-config/1.1/coherence-pof-config.xsd">
<user-type-list>
<include>coherence-pof-config.xml</include>
<user-type>
<type-id>1001</type-id>
<class-name>com.westgroup.coherence.bermuda.loader.DistributedLoaderAgent</class-name>
<serializer>
<class-name>com.tangosol.io.pof.PofAnnotationSerializer</class-name>
<init-params>
<init-param>
<param-type>int</param-type>
<param-value>{type-id}</param-value>
</init-param>
<init-param>
<param-type>java.lang.Class</param-type>
<param-value>{class}</param-value>
</init-param>
<init-param>
<param-type>boolean</param-type>
<param-value>true</param-value>
</init-param>
</init-params>
</serializer>
</user-type>
<user-type>
<type-id>1002</type-id>
<class-name>com.westgroup.coherence.bermuda.profile.lpa.LPACacheProfile</class-name>
<serializer>
<class-name>com.tangosol.io.pof.PofAnnotationSerializer</class-name>
<init-params>
<init-param>
<param-type>int</param-type>
<param-value>{type-id}</param-value>
</init-param>
<init-param>
<param-type>java.lang.Class</param-type>
<param-value>{class}</param-value>
</init-param>
<init-param>
<param-type>boolean</param-type>
<param-value>true</param-value>
</init-param>
</init-params>
</serializer>
</user-type>
<user-type>
<type-id>1003</type-id>
<class-name>com.westgroup.coherence.bermuda.profile.lpa.Address</class-name>
<serializer>
<class-name>com.tangosol.io.pof.PofAnnotationSerializer</class-name>
<init-params>
<init-param>
<param-type>int</param-type>
<param-value>{type-id}</param-value>
</init-param>
<init-param>
<param-type>java.lang.Class</param-type>
<param-value>{class}</param-value>
</init-param>
<init-param>
<param-type>boolean</param-type>
<param-value>true</param-value>
</init-param>
</init-params>
</serializer>
</user-type>
<user-type>
<type-id>1004</type-id>
<class-name>com.westgroup.coherence.bermuda.profile.lpa.Discipline</class-name>
<serializer>
<class-name>com.tangosol.io.pof.PofAnnotationSerializer</class-name>
<init-params>
<init-param>
<param-type>int</param-type>
<param-value>{type-id}</param-value>
</init-param>
<init-param>
<param-type>java.lang.Class</param-type>
<param-value>{class}</param-value>
</init-param>
<init-param>
<param-type>boolean</param-type>
<param-value>true</param-value>
</init-param>
</init-params>
</serializer>
</user-type>
<user-type>
<type-id>1005</type-id>
<class-name>com.westgroup.coherence.bermuda.profile.lpa.Employment</class-name>
<serializer>
<class-name>com.tangosol.io.pof.PofAnnotationSerializer</class-name>
<init-params>
<init-param>
<param-type>int</param-type>
<param-value>{type-id}</param-value>
</init-param>
<init-param>
<param-type>java.lang.Class</param-type>
<param-value>{class}</param-value>
</init-param>
<init-param>
<param-type>boolean</param-type>
<param-value>true</param-value>
</init-param>
</init-params>
</serializer>
</user-type>
</user-type-list>
<allow-interfaces>true</allow-interfaces>
<allow-subclasses>true</allow-subclasses>
</pof-config>
cache-config.xml
<cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config"
xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config http://xmlns.oracle.com/coherence/coherence-cache-config/1.1/coherence-cache-config.xsd">
<defaults>
<serializer>pof</serializer>
</defaults>
<caching-scheme-mapping>
<cache-mapping>
<cache-name>DistributedLPACache</cache-name>
<scheme-name>LPANewCache</scheme-name>
<init-params>
<init-param>
<param-name>back-size-limit</param-name>
<param-value>250MB</param-value>
</init-param>
</init-params>
</cache-mapping>
</caching-scheme-mapping>
<caching-schemes>
<!-- Distributed caching scheme. -->
<distributed-scheme>
<scheme-name>LPANewCache</scheme-name>
<service-name>HBaseLPACache</service-name>
<serializer>
<instance>
<class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
<init-params>
<init-param>
<param-type>java.lang.String</param-type>
<param-value>pof-config.xml</param-value>
</init-param>
</init-params>
</instance>
</serializer>
<backing-map-scheme>
<read-write-backing-map-scheme>
<internal-cache-scheme>
<class-scheme>
<class-name>com.tangosol.util.ObservableHashMap</class-name>
</class-scheme>
</internal-cache-scheme>
<cachestore-scheme>
<class-scheme>
<class-name>com.westgroup.coherence.bermuda.profile.lpa.LPACacheProfile</class-name>
</class-scheme>
</cachestore-scheme>
<read-only>false</read-only>
<write-delay-seconds>0</write-delay-seconds>
</read-write-backing-map-scheme>
</backing-map-scheme>
<autostart>true</autostart>
</distributed-scheme>
<invocation-scheme>
<scheme-name>InvocationService</scheme-name>
<service-name>InvocationService</service-name>
<thread-count>5</thread-count>
<autostart>true</autostart>
</invocation-scheme>
</caching-schemes>
</cache-config>
DistributedLoaderAgent (user type 1001)
import java.io.IOException;
import java.io.Serializable;
import java.lang.annotation.Annotation;
import org.apache.log4j.Logger;
import com.tangosol.io.pof.PofReader;
import com.tangosol.io.pof.PofWriter;
import com.tangosol.io.pof.PortableObject;
import com.tangosol.io.pof.annotation.Portable;
import com.tangosol.io.pof.annotation.PortableProperty;
import com.tangosol.net.AbstractInvocable;
import com.tangosol.net.InvocationService;
@Portable
public class DistributedLoaderAgent extends AbstractInvocable implements PortableObject{
private static final long serialVersionUID = 10L;
private static Logger m_logger = Logger.getLogger(DistributedLoaderAgent.class);
@PortableProperty(0)
public String partDumpFileName = null;
public String getPartDumpFileName() {
return partDumpFileName;
public void setPartDumpFileName(String partDumpFileName) {
this.partDumpFileName = partDumpFileName;
public DistributedLoaderAgent(){
super();
m_logger.debug("Configuring this loader ");
public DistributedLoaderAgent(String partDumpFile){
super();
m_logger.debug("Configuring this loader to load dump file "+ partDumpFile);
partDumpFileName = partDumpFile;
@Override
public void init(InvocationService service) {
// TODO Auto-generated method stub
super.init(service);
@Override
public void run() {
// TODO Auto-generated method stub
try{
m_logger.debug("Invoked DistributedLoaderAgent");
MetadataTranslatorService service = new MetadataTranslatorService(false, "LPA");
m_logger.debug("Invoking service.loadLPACache");
service.loadLPACache(partDumpFileName);
}catch(Exception e){
m_logger.debug("Exception in DistributedLoaderAgent " + e.getMessage());
@Override
public void readExternal(PofReader arg0) throws IOException {
// TODO Auto-generated method stub
setPartDumpFileName(arg0.readString(0));
@Override
public void writeExternal(PofWriter arg0) throws IOException {
// TODO Auto-generated method stub
arg0.writeString(0, getPartDumpFileName());
Please assist.OK I have two suggestions.
1. Always create and flush the ObjectOutputStream before creating the ObjectInputStream.
2. Always close the output before you close the input. Actually once you close the output stream both the input stream and the socket are closed anyway so you can economize on this code. In the above you have out..writeObject() followed by input.close() followed by out.close(). Change this to out.writeObject() followed by out.close(). It may be that something needed flushing and the input.close() prevented the flush from happening. -
UnmarshalException followed by java.io.StreamCorruptedException
package Jdbcpgms;
import java.sql.*;
import javax.sql.*;
import javax.naming.*;
import java.io.*;
import java.util.*;
import weblogic.jndi.*;
* @author owner
public class DataSourceClient {
/** Creates a new instance of DataSourceClient */
public DataSourceClient() {}
public static void main (String [] args){
try{
TestDataSource testDS = new TestDataSource();
testDS.setDataBaseServer("http://jdbc:odbc:oracle:thin:@localhost:1521:MKPAppDB");
testDS.setDatabasePort(1521);
testDS.setDataBaseName("MKPAppDB");
//Context ctx = new InitialContext();
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
Context ctx = new InitialContext(ht);
ctx.rebind("MKPAppDB", testDS);
testDS = null;
testDS=(TestDataSource)ctx.lookup("dn=MKPAppDB");
Connection conn = testDS.getConnection("scott", "tiger");
System.out.println("DataSourc returned, bound to "+ testDS.getDataBaseServer()
+ ":" testDS.getDatabasePort()
":" + testDS.getDataBaseName());
catch(Exception e){
e.printStackTrace();
Above is the Client I use to create a context and bind my database to context.
I get below exception. Also I have attached my TestDataSource. please take a
look If you have solution to run my lient.
C:\java\j2sdk1.4.2\bin>java Jdbcpgms.DataSourceClient
javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalExcepti
on: error unmarshalling arguments; nested exception is:
java.io.StreamCorruptedException]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(Exceptio
nTranslator.java:83)
at weblogic.jndi.internal.WLContextImpl.translateException(WLContextImpl
.java:385)
at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:136)
at javax.naming.InitialContext.rebind(InitialContext.java:363)
at Jdbcpgms.DataSourceClient.main(DataSourceClient.java:37)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested
ex
ception is:
java.io.StreamCorruptedException
at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.j
ava:108)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:284)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:244)
at weblogic.jndi.internal.ServerNamingNode_811_WLStub.rebind(Unknown Sou
rce)
at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:134)
... 2 more
Caused by: java.io.StreamCorruptedException
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:150
6)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
bjectInputStream.java:114)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.ja
va:111)
at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:466)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerR
ef.java:108)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:409)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:353)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
144)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.jav
a:404)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
C:\java\j2sdk1.4.2\bin>javac C:\java\muthu\src\jdbcpgms\DataSourceClient.java
d C:\java\muthu\classes
C:\java\j2sdk1.4.2\bin>java Jdbcpgms.DataSourceClient
javax.naming.CommunicationException [Root exception is java.net.ConnectException
: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available rou
ter to destination]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(Exceptio
nTranslator.java:47)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLIni
tialContextFactoryDelegate.java:623)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:301)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:234)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
extFactory.java:135)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
62)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at Jdbcpgms.DataSourceClient.main(DataSourceClient.java:36)
Caused by: java.net.ConnectException: t3://localhost:7001: Destination unreachab
le; nested exception is:
java.net.ConnectException: Connection refused: connect; No available rou
ter to destination
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:199)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:125)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:291)
... 7 more
C:\java\j2sdk1.4.2\bin>java Jdbcpgms.DataSourceClient
javax.naming.CommunicationException [Root exception is java.net.ConnectException
: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available rou
ter to destination]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(Exceptio
nTranslator.java:47)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLIni
tialContextFactoryDelegate.java:623)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:301)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:234)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
extFactory.java:135)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
62)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at Jdbcpgms.DataSourceClient.main(DataSourceClient.java:36)
Caused by: java.net.ConnectException: t3://localhost:7001: Destination unreachab
le; nested exception is:
java.net.ConnectException: Connection refused: connect; No available rou
ter to destination
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:199)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:125)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:291)
... 7 more
C:\java\j2sdk1.4.2\bin>java Jdbcpgms.DataSourceClient
[TestDataSource.java]Hi,
By putting 'TestDataSource' class in server classpath sould solve the problem.
Also , if u can, just try with weblogic 6.1 and post the exception. -
Java.io.StreamCorruptedException Load
Hi There,
I am getting java.io.StreamCorruptedException while doing applet-servlet communication.
I am closing all the streams once done.
But still during load i am seeing this exception in the logs though its not stopping the application to work its working fine but in the logs i am seeing this exceptions during load.
Any pointers would be of great help.
TxI am assuming that the ObjectOutputStream called flush() prior to attempting to read the file.
That having been said, the serialization specification should be portable across JVM's. Is the source identical on both machines? If a field has been added or removed or renamed, you may get errors similar to the one you are experiencing.
- Saish
"My karma ran over your dogma." - Anon -
Java.io.StreamCorruptedException (APPLET SERVLET Communication)
Hi There,
I have an applet which calls the servlet over httpconnection and sends serialized object to the servlet.
It works fine but during heavy load it throws following exception but the application doesnot break :-
[8/5/09 7:36:09:498 EDT] 292c510e SystemErr R java.io.StreamCorruptedException
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.io.ObjectInputStream.readObject0(ObjectInputStream.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.util.HashMap.readObject(HashMap.java:1172)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1003)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.io.ObjectInputStream.readObject0(ObjectInputStream.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.cisco.swc.applications.dlm.servlet.MigrationReportServlet.doPost(MigrationReportServlet.java:53)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
[8/5/09 7:36:09:499 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:76)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.cisco.tools.filter.AccessLogFilter.doFilter(AccessLogFilter.java:114)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.netegrity.was511.filter.ServletFilter.doFilter(ServletFilter.java:72)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1027)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:544)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:210)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:139)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:332)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:254)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:657)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:453)
[8/5/09 7:36:09:500 EDT] 292c510e SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:937)
Any pointers would be of great help.
ThanksFirst, your singleton is not threadsafe, second because it's overly complicated. Simply eagerly initialize it.
Third: why don't you use the Session or a request parameter to handle your data?
Fourth: are you sure the serialized data is correctly written? -
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 -
Java.io.StreamCorruptedException: illegal handle value
Hi
I am using Oracle Coherence 3.3 in my application. I my application we are taking the objects from Webservices and storing them in the Cache(Replicated). And then retrieve them from the Cache.
But now on our application Linux server we are getting "java.io.StreamCorruptedException: illegal handle value"
Can anybody tell the reason of this. I am not sure whether it is a Coherence issue.
The log of error which i am getting is this. Please do reply. Its really urgent.
[6/7/08 11:23:36:287 EDT] 00004442 SystemErr R (Wrapped: CacheName=UMAChannelZipCache, Key=44120) java.io.StreamCorruptedException: illegal handle value
at java.io.ObjectInputStream.readHandle(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
at java.util.HashMap.readObject(HashMap.java(Compiled Code))
at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java(Compiled Code))
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
at java.util.TreeMap.buildFromSorted(TreeMap.java(Compiled Code))
at java.util.TreeMap.buildFromSorted(TreeMap.java(Inlined Compiled Code))
at java.util.TreeMap.readTreeSet(TreeMap.java(Inlined Compiled Code))
at java.util.TreeSet.readObject(TreeSet.java(Compiled Code))
at sun.reflect.GeneratedMethodAccessor167.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java(Compiled Code))
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
at java.util.HashMap.readObject(HashMap.java(Compiled Code))
at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java(Compiled Code))
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java(Compiled Code))
at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code))
at com.tangosol.util.ExternalizableHelper.readSerializable(ExternalizableHelper.java(Inlined Compiled Code))
at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java(Compiled Code))
at com.tangosol.coherence.component.net.Message.readObject(Message.CDB(Inlined Compiled Code))
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.ReplicatedCache$ConverterFromInternal.convert(ReplicatedCache.CDB(Compiled Code))
at com.tangosol.coherence.component.util.CacheHandler.getCachedResource(CacheHandler.CDB(Compiled Code))
at com.tangosol.coherence.component.util.CacheHandler.get(CacheHandler.CDB(Compiled Code))
at com.tangosol.coherence.component.util.SafeNamedCache.get(SafeNamedCache.CDB(Compiled Code))
at com.att.uma.cache.ChannelCacheManager.checkCacheByZip(ChannelCacheManager.java(Compiled Code))
at com.att.uma.channel.UMAChannelServices.getChannelsByZip(UMAChannelServices.java(Compiled Code))
at com.att.uma.channel.RetrieveChannelLineup.performTask(RetrieveChannelLineup.java(Compiled Code))
at com.att.uma.channel.RetrieveChannelLineup.doPost(RetrieveChannelLineup.java(Compiled Code))
at com.att.uma.channel.RetrieveChannelLineup.doGet(RetrieveChannelLineup.java(Compiled Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java(Compiled Code))
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))Hi user628020,
Since you are using standard Java serialization, the only two reasons I can think of are:
1) a bug in serialization routines for any of the classes your objects use (e.g. TreeMap)
2) concurrent modification of the same object by another thread at the same time
With urgent support questions I would suggest using the Oracle Metalink.
Regards,
Gene -
Java.io.StreamCorruptedException after rolling upgrade
Hi,
After removing a first class citizen Class file A in Version2 and performing a rolling upgrade from Version1 to Version2 of our software we find an entry for Class A in replicated cache of Version2. Once we try to read / remove / or overwrite it with null we get a "java.io.StreamCorruptedException".
Is there a way to get rid of these kind of entries in the cache after rolling upgrade is performed or even prevent Class A to be added into the cache during de-serialization?
ThanksI'm not quite sure what you mean yet. Are you talking about the server code or the client code? And, can you be a little more specific on where the problem is? I'm sorry, it's just that I've spent quite a while on the code and I haven't found the problem yet. Thanks again.
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2627" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I am getting these error after changing table space
size for my database ...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I made changes in Database side for table space and
restart server.. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2><Jun 7, 2005 3:44:44 PM EDT>
<Info> <JMS> <BEA-040321> <JMSServer "ss1 JMS Server" is
resuming.><BR><Jun 7, 2005 3:44:45 PM EDT> <Alert> <JMS>
<BEA-040052> <JMSServer "ss1 JMS Server" store failed to open
java.io.StreamCorrup<BR>tedException: Unsupported class version 2.
Expected a value between 1 and 1 inclusive. Possible attempt to access
newer JMS<BR> version then current
version..<BR>java.io.StreamCorruptedException: Unsupported class version
2. Expected a value between 1 and 1 inclusive. Possible
attempt<BR> to access newer JMS version then current
version.<BR> at
weblogic.jms.common.JMSUtilities.versionIOException(JMSUtilities.java:111)<BR>
at
weblogic.jms.store.JDBCIOStream.open(JDBCIOStream.java:438)<BR>
at
weblogic.jms.store.JMSStore.open(JMSStore.java:224)<BR>
at
weblogic.jms.backend.BEStore.open(BEStore.java:262)<BR>
at
weblogic.jms.backend.BEStore.start(BEStore.java:151)<BR>
at
weblogic.jms.backend.BackEnd.openStores(BackEnd.java:1171)<BR>
at
weblogic.jms.backend.BackEnd.resume(BackEnd.java:1290)<BR>
at
weblogic.jms.JMSService.addJMSServer(JMSService.java:2241)<BR>
at
weblogic.jms.JMSService.addDeployment(JMSService.java:2012)<BR>
at
weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:330)<BR>
at
weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(DeploymentTarget.java:590)<BR>
at
weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeployments(DeploymentTarget.java:568)<BR>
at
weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(DeploymentTarget.java:240)<BR>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)<BR> at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<BR>
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<BR>
at
java.lang.reflect.Method.invoke(Method.java:324)<BR>
at
weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:711)<BR>
at
weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:690)<BR>
at
weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:476)<BR>
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1557)<BR>
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1525)<BR>
at
weblogic.management.internal.RemoteMBeanServerImpl.private_invoke(RemoteMBeanServerImpl.java:947)<BR>
at
weblogic.management.internal.RemoteMBeanServerImpl.invoke(RemoteMBeanServerImpl.java:908)<BR>
at weblogic.management.internal.MBeanProxy.invoke</FONT></DIV></BODY></HTML>Hi
I am also getting the similar error when I restart the server and my JMSSTORE table has some records, Here is the exception I am getting
java.io.StreamCorruptedException: Unknown object stream version. 5505025
at weblogic.jms.store.BufferDataInputStream.readObject(BufferDataInputStream.java:167)
at weblogic.jms.store.JDBCIOStream.doRecoverBodies(JDBCIOStream.java:979)
at weblogic.jms.store.JDBCIOStream.doRecover(JDBCIOStream.java:871)
at weblogic.jms.store.JDBCIOStream.recover(JDBCIOStream.java:1090)
at weblogic.jms.store.JMSStore.recover(JMSStore.java:315)
at weblogic.jms.backend.BEStore.open(BEStore.java:264)
at weblogic.jms.backend.BEStore.start(BEStore.java:151)
at weblogic.jms.backend.BackEnd.openStores(BackEnd.java:1171)
at weblogic.jms.backend.BackEnd.resume(BackEnd.java:1290)
at weblogic.jms.JMSService.addJMSServer(JMSService.java:2241)
at weblogic.jms.JMSService.addDeployment(JMSService.java:2012)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:331)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(DeploymentTarget.java:591)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeployments(DeploymentTarget.java:569)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(DeploymentTarget.java:241)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:731)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:710)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:484)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1557)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1525)
at weblogic.management.internal.RemoteMBeanServerImpl.private_invoke(RemoteMBeanServerImpl.java:985)
at weblogic.management.internal.RemoteMBeanServerImpl.invoke(RemoteMBeanServerImpl.java:943)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:946)
at weblogic.management.internal.MBeanProxy.invokeForCachingStub(MBeanProxy.java:481)
at weblogic.management.configuration.ServerMBean_Stub.updateDeployments(ServerMBean_Stub.java:7351)
at weblogic.management.deploy.slave.SlaveDeployer.updateServerDeployments(SlaveDeployer.java:1304)
at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.java:347)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resume(DeploymentManagerServerLifeCycleImpl.java:229)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
at weblogic.Server.main(Server.java:32)
Maybe you are looking for
-
''locking this thread as duplicate, please continue at [https://support.mozilla.org/en-US/questions/986549 /questions/986549]'' my problem is very simple......firefox wont allow me save my downloads to any other location than my c drive....for exampl
-
Sound disappeared in Safari and BBC Radio Widget
Two days ago, without warning, the sound disappeared from both Safari and my BBC Radio Widget. All other sound on the computer is fine and if I play an MP3 through Safari it will play but otherwise there is silence. (Problem was discovered by our 5 y
-
Error in invoking target 'relink' of makefile ins_precomp.mk
I cant install Oracle 10g R1 on RHEL 4. Although I know those versions are pretty old, I need to use those old systems for educational purposes. This is the log, hope someone can help me. LOG: Start output from spawned process: Linking /u01/app/oracl
-
XML to Internal table using XSLT by CALL TRANSFORMATION error
Dear experts, I have to fetch the data from an XML file using XSLT into internal tables. The XML file is very big as following:- <?xml version="1.0" standalone="yes" ?> - <Shipment> <shipmentID>25091203S000778</shipmentID> <manifestDateTime>2009-
-
Return to vendor through RCV open interface
Hi, I would like to return to vendor items with serial numbers through RCV open interface. Is it possible? We are using 11.5.7. Thanks in advance, Merav