Note that there are some explanatory texts on larger screens.

plurals
  1. POSerializationProblem (?) of custom AsyncCallback
    text
    copied!<p>I implemented an own Marshalling/Unmarshalling Sytem with JMS (exercise). I do Request and get Responses back. I want to fire an own callback in response after i received the correct response. But i think my exception is a serialization problem. But i don't know how to fix it.</p> <p>I use that code to call a server</p> <pre><code>button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Request request = new Request("printServer:" + printMessage.getText()); request.setAsyncCallback(new AsyncCallback() { /** * */ private static final long serialVersionUID = 5204649755139243369L; @Override public void onSuccess(String content) { System.out.println("async callback: " + content); } }); c.callServer(request); } }); </code></pre> <p>My request looks like this:</p> <p>public class Request extends Conveyable { private static final long serialVersionUID = 4535036450648916878L;</p> <pre><code>public static int requestIDInc = 0; private int requestID; private AsyncCallback callback; public Request(String content) { super(content); synchronized (this) { requestID = ++requestIDInc; } } public int getRequestID() { return requestID; } public AsyncCallback getAsyncCallback() { // TODO Auto-generated method stub return callback; } public void setAsyncCallback(AsyncCallback callback) { this.callback = callback; } </code></pre> <p>}</p> <p>My own Callback looks like this:</p> <pre><code>public abstract class AsyncCallback implements Serializable{ /** * */ private static final long serialVersionUID = 4951246599084406476L; public abstract void onSuccess(String content); </code></pre> <p>}</p> <p>And the exception i got is this:</p> <pre><code>javax.jms.MessageFormatException: machines.client.ClientWindow$1 at org.exolab.jms.message.ObjectMessageImpl.setObject(ObjectMessageImpl.java:194) </code></pre> <p>It looks a little bit as if the ClientWindow in which a create the Request and fire it off with a buttonClick is included in this callback. But i don't know why. Or maybe the problem isn't there.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload