[jboss-user] [Remoting] - transporter sample fails when run a second time

bord do-not-reply at jboss.com
Tue Apr 17 17:21:39 EDT 2007


i changed the transporter sample client to run any number of iterations of the makeClientCall and i find that the 2nd iteration gives a failed assertion 
          assertNotNull(processedCustomer);

meaning that the processedCustomer is null.

The server program has an exception indicating "socket in use".

org.jboss.remoting.InvalidConfigurationException: The invoker for locator (Invok
erLocator [socket://10.104.30.186:5433/]) is already in use by another Connector
.  Either change the locator or add new handlers to existing Connector.
        at org.jboss.remoting.InvokerRegistry.createServerInvoker(InvokerRegistr
y.java:520)

Now i thought that maybe adding a new method
public void releaseCustomer(ICustomer customerProxy)
to the CustomerProcessor interface could be used to stop the transporterServer running on the server so as to fix the issue.
i tried hacking this up and cannot get it to work due to issues with the TransporterClient for customerProcessor.

In other words this one did not work for releaseCustomer

   int id = customerProxy.getCustomerId();      TransporterClient.destroyTransporterClient(customerProxy);       ((TransporterServer)cust2server.remove(id)).stop();

where the cust2server is a Map and this one

cust2server.put(customer.getCustomerId(), server);

was added to the processCustomer.

what i get with above is an exception back at the client (on 3rd iteration) with this cause.

Caused by: org.jboss.remoting.ServerInvoker$InvalidStateException: Can not proc
ess invocation request since is not in started state.
        at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:751)
        at org.jboss.remoting.transport.socket.ServerThread.processInvocation(S
erverThread.java:553)
        at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.
java:377)
        at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.ja
va:159)
        at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClient
Invoker.java:163)
        at org.jboss.remoting.Client.invoke(Client.java:1548)
        at org.jboss.remoting.Client.invoke(Client.java:534)
        at org.jboss.remoting.Client.invoke(Client.java:522)
        at org.jboss.remoting.transporter.TransporterClient.invoke(TransporterC
lient.java:297)

---------------------

After some studying of the code i believe the InvokerRegistry has ref count of 2 for the ClientInvoker at the time of the destroyClientInvoker.

And thus never really cleaned up the ClientInvoker completely yet this residual ClientInvoker seemed not to get its serverInvoker set when a new serverInvoker was created.

Well i'm awfully confused with what should be done  
with this sample if not whether there should be some fixes in the remoting so that InvokerRegistries can zero out the count of a ClientInvoker when need be.

anyone?

craig






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

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



More information about the jboss-user mailing list