Hi,

I trying to pass a java object from client to the serve, as shown below:

##################### CLIENT
public Response setData(String resourceSegment, String queryString, 
Serializable object) throws Exception {        
        Reference reference = new Reference(Protocol.HTTP, host, port);
        reference.addSegment(resourceSegment);
        if (queryString != null)
                reference.setQuery(Reference.encode(queryString));
                
        Response response = client.post(reference.toString(), new 
ObjectRepresentation<Serializable>(object));
...
..
}
####################

#################### SERVER 
public void handlePost() {
        try {
                if 
(MediaType.APPLICATION_JAVA_OBJECT.equals(getRequest().getEntity().getMediaType()))
 {                
                        ObjectRepresentation<TimelineDataForUpdate> rep = new 
ObjectRepresentation<TimelineDataForUpdate>(getRequest().getEntity());
                        TimelineDataForUpdate tml = rep.getObject();
                }
        } catch (IOException ioe) {
                trace.error(ioe);
                getResponse().setStatus(Status.SERVER_ERROR_INTERNAL);
        } catch (ClassNotFoundException cnfe) {
                trace.error(cnfe);
                getResponse().setStatus(Status.SERVER_ERROR_INTERNAL);
        }
}
###################

Unfortunately, I am getting a ClassNotFoundException at server.  Please let me 
know if I am doing something wrong.

Thanks in advance!

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2367875

Reply via email to