Hey all!

I've got a doubt. How can I save the MessageContext? I have following piece
of code:

         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream oos = new ObjectOutputStream(baos);
         oos.writeObject(MessageContext.getCurrentMessageContext());

But it doesn't work. It gives me the following error:

Caused by: java.lang.ClassCastException: java.lang.Object cannot be cast to
java.io.ObjectOutput
    at ShoppingCart.getState(ShoppingCart.java:97) ...

Is that the right way of saving the Message context? What's wrong on this
code?

Thank you in advance,


Igor Nogueira

Reply via email to