Try this...

http://www.nabble.com/RE%3A-ObjectSerialization-problem-p7830060.html


On 3/5/07, Monajit Choudhury <[EMAIL PROTECTED]> wrote:

Hi
I am trying to mix the proxy example with the sumup example.So all client
requests in the in the sumup example goes via this proxy.In the proxy I
have a async queuing mechanism by which I dump the requests in a queue and
desirialize it in a separate thread.Now here is the problem...
This is the method in AbstractProxyIoHandler.
public void messageReceived( IoSession session, Object message ) throws
Exception
    {

        ByteBuffer rb = ( ByteBuffer ) message;
        ByteBuffer wb = ByteBuffer.allocate( rb.remaining() );
        rb.mark();
        wb.put( rb );
        wb.flip();
        ServiceContext ctx = ServiceContext.getContext();
        Queue queue1 = (Queue) ctx.lookup("QM1.RecordingQ");
        Message msg = new MessageImpl(wb);
        queue1.pushIntoQueue(msg);
       ( ( IoSession ) session.getAttachment() ).write( wb );
        rb.reset();
        SessionLog.info( session, rb.getString( CHARSET.newDecoder() ) );
    }

Now when i deque the object and do a wb.getObject(), i get the following
exception.
org.apache.mina.common.BufferDataException: Object length should be
greater than 4: 0

Instead of this, the client gets the response properly.I think the proxy
example was written to work with strings only. WHat changes do I need to
make in the proxy to make it work with Objects?Please HELP!!!!


Regds
Monajit




--
..Cheers
Mark

Reply via email to