[jboss-user] [Remoting] - Re: InvokerLocator already exists for listener

dunks80 do-not-reply at jboss.com
Thu Oct 26 07:16:26 EDT 2006


Well i think I found the problem...

In org.jboss.remoting.Client the createListenerMetadata uses the callbackHandlers hashCode to create the listenerId which is later used to in the   AbstractInvokerLocator to detemine whether a listener already has a clientLocator registered for it. 

Client

  |  private Map createListenerMetadata(InvokerCallbackHandler callbackHandler)
  |    {
  |       String listenerId = String.valueOf(callbackHandler.hashCode());
  |       Map metadata = new HashMap();
  |       metadata.put(LISTENER_ID_KEY, listenerId);
  |       return metadata;
  |    }
  | 
AbstractInvoker

  | /**
  |     * Sets the callback server locator for the specified callback listener id
  |     *
  |     * @param locator
  |     */
  |    public void addClientLocator(String listenerId, InvokerLocator locator)
  |    {
  |       Object obj = localServerLocators.put(listenerId, locator);
  |       if(obj != null)
  |       {
  |          throw new RuntimeException("InvokerLocator already exists for listener id " + listenerId + ".  " +
  |                                     "Remove this listener before adding again.");
  |       }
  |    }
  | 

I was using JRockit 64-bit jdk  for linux (R26.4.0-jdk1.5.0.6). I switched over to the normal Sun jdk  and the problem magically went away. I'm not sure if this is a problem with the way JRockit handles hashcodes or if it's a problem with using the hashcode of the callbackHandler as the listenerId. 

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

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



More information about the jboss-user mailing list