[jboss-user] [Remoting] - Re: java.lang.ClassNotFoundException

yantriki do-not-reply at jboss.com
Wed Jul 19 14:27:20 EDT 2006


Tom thanks for your reply.

After I added a ServerCallBackHandler on the server side, the ClassNotFoundException was gone.

I changed the code as per your suggestion, to create a Connector on the client to receive a push call. However the following code gets executed on the jboss server itself, which is where my remoting server resides as service.

	public void pingClients() {
  | 		if (m_listeners.size() > 0) {
  | 			Object data = "ping";
  | 			Callback c = new Callback(data);
  | 			Set<InvokerCallbackHandler> errorSet = new HashSet<InvokerCallbackHandler>();
  | 			for (InvokerCallbackHandler h : m_listeners) {
  | 				try {
  | 					h.handleCallback(c);
  | 				} catch (HandleCallbackException e) {
  | 					errorSet.add(h);
  | 				}
  | 			}
  | 			logger.info("Failed ping for " + errorSet.size() + " clients...");
  | 			for (InvokerCallbackHandler h : errorSet) {
  | 				m_listeners.remove(h);
  | 			}
  | 		}
  | 	}
  | 

The client never receives the ping message. Consequently once the client is added and exits without removing Listener from the server, I don't know how to remove it from the list of listeners.

Here is my client call back handler:
public class ClientCallbackHandler implements InvokerCallbackHandler, Serializable {
  | 
  | 	public void handleCallback(Callback callback) throws HandleCallbackException {
  | 		Object obj = callback.getParameter();
  | 		System.out.println("The server sent: "+obj);
  | 	}
  | 
  | }
  | 

The client is able to call invoke of the server. This works fine, however in my code I create client connector and register the client handler based on the return value from this invoke (for push callback).


  | 			int i = (Integer) client.invoke("acquire");
  | 			if (i >= 0) {
  | 				String callbackLocatorURI = transport + "://" + serverName + ":" + (port + 1);
  | 			      InvokerLocator callbackLocator = new InvokerLocator(callbackLocatorURI);				
  | 				setupServer(callbackLocator);
  | 				client.addListener(handler, locator);
  | 			}
  | 
appreciate your help.
regards,
vivek

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

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



More information about the jboss-user mailing list