[jboss-user] [Remoting] - Re: Un/Marshaller not found

hurzeler do-not-reply at jboss.com
Tue Jun 26 19:46:30 EDT 2007


Please help I am really stuck.

I use JBoss 4.0.5GA with Jboss remoting 1.4.0. The question is how do I get the socket server configured so that it accepts simple text. I have created three extra classes SimpleInputStreamWrapper which just returns the input and outputstreams and the two marshallers like:

  | package com.test.socket.V75SocketServer;
  | 
  | import java.io.BufferedReader;
  | import java.io.IOException;
  | import java.io.InputStream;
  | import java.io.InputStreamReader;
  | import java.io.Reader;
  | import java.util.Map;
  | 
  | import org.jboss.remoting.marshal.serializable.SerializableUnMarshaller;
  | 
  | /**
  |  * @author hurzeler
  |  *
  |  */
  | public class TextUnMarshaller extends SerializableUnMarshaller
  | {
  | 
  |     /**
  |      * 
  |      */
  |     private static final long serialVersionUID = -5026128440188409051L;
  | 
  |     /**
  |      * 
  |      */
  | 
  |     public TextUnMarshaller(){}
  |     
  |     @Override
  |     public Object read(InputStream is, Map map) throws IOException, ClassNotFoundException
  |     {
  | 	    StringBuffer buffer = new StringBuffer();
  | 	    try {
  | 		InputStreamReader isr = new InputStreamReader(is, "UTF8");
  | 		Reader in = new BufferedReader(isr);
  | 		int ch;
  | 		while ((ch = in.read()) > -1) {
  | 			buffer.append((char)ch);
  | 		}
  | 		in.close();
  | 		return buffer.toString();
  | 	    } catch (IOException e) {
  | 		e.printStackTrace();
  | 		return null;
  | 	    }
  | 
  |     }
  | 
  | }

However the un/marshaller gets never called.
Please help!!!

Thanks

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057919#4057919

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057919



More information about the jboss-user mailing list