Hi all,

i have to store messagecontexts. I check Sandesha2 source to see how it
do it and i try to do as follow:

public String save(String key, MessageContext messageContext){
 if(key==null)
  key = SandeshaUtil.getUUID();
 try {
  ByteArrayOutputStream stream = new ByteArrayOutputStream();
  removeMustUnderstand(messageContext.getEnvelope());
  ObjectOutputStream s = new ObjectOutputStream(stream);
  s.writeObject(messageContext);
  s.close();
                        
  File file = new File("/home/test/msgCtx."+key);
  FileOutputStream fileOutputStream = new FileOutputStream(file);
  fileOutputStream.write(stream.toByteArray());
  fileOutputStream.flush();
  fileOutputStream.close();     
 } 
 catch(Exception e) {
  log.error(e.toString());
 }
 return key;
}

but when it try to do s.writeObject(messageContext) it throws a
java.io.NotSerializableException:org.apache.axis2.context.MessageContext 

any suggestion?

thx, 
Lorenzo


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to