Hi All,

In my project we use remoting services to communicate between client and 
server. 

The server listens on a particular port say 5800, all the clients try to 
connect to server on that particular port giving their local port to 
communicate. (lets say local ports start from 5900 and increment by 1 for each 
client).

Clients try to query heart beat from server every 3 minutes to keep the 
connection alive and sync with the server every time server restarts.

The problem is during the restart of the server, not all the clients are able 
to connect back to the server, it is random some clients connect perfectly some 
clients throw below exception.


  | 
  | 2008-12-15 15:47:09,905 FATAL 
[com.xxxxx.datamodel.client.TransporterClients] The invoker for locator 
(InvokerLocator [socket://10.10.227.121:5901/?serializationtype=jboss]) is 
already in use by another Connector.  Either change the locator or add new 
handlers to existing Connector.
  | com.xxxxx.datamodel.DMException: The invoker for locator (InvokerLocator 
[socket://xx.xx.xxx.xxx:5901/?serializationtype=jboss]) is already in use by 
another Connector.  Either change the locator or add new handlers to existing 
Connector.
  |         at 
com.xxxxx.datamodel.client.TransporterClients.createServer(TransporterClients.java:171)
  |         at 
com.xxxxx.datamodel.client.TransporterClients.<init>(TransporterClients.java:59)
  |         at 
com.xxxxx.datamodel.client.DriverManager.<init>(DriverManager.java:17)
  |         at 
com.xxxxx.datamodel.client.remoting.ConnectionManager.init(ConnectionManager.java:44)
  |         at 
com.xxxxx.datamodel.client.remoting.ConnectionManager.<init>(ConnectionManager.java:39)
  |         at 
com.xxxxx.datamodel.client.remoting.ConnectionManagerHelper.getConnection(ConnectionManagerHelper.java:38)
  |         at 
com.xxxxx.datamodel.client.remoting.ConnectionManager.getConnectionManager(ConnectionManager.java:104)
  |         at 
com.xxxxx.sms.SMSCommunicationService.getRemoteSMSGatewayConnection(SMSCommunicationService.java:134)
  |         at 
com.xxxxx.sms.SMSCommunicationService.access$100(SMSCommunicationService.java:44)
  |         at 
com.xxxxx.sms.SMSCommunicationService$HeartBeatTask.run(SMSCommunicationService.java:160)
  |         at java.util.TimerThread.mainLoop(Timer.java:512)
  |         at java.util.TimerThread.run(Timer.java:462)
  | Caused by: org.jboss.remoting.InvalidConfigurationException: The invoker 
for locator (InvokerLocator 
[socket://10.10.227.121:5901/?serializationtype=jboss]) is already in use by 
another Connector.  Either ch
  | ange the locator or add new handlers to existing Connector.
  |         at 
org.jboss.remoting.InvokerRegistry.createServerInvoker(InvokerRegistry.java:519)
  |         at org.jboss.remoting.transport.Connector.init(Connector.java:396)
  |         at org.jboss.remoting.transport.Connector.create(Connector.java:782)
  |         at 
org.jboss.remoting.transporter.TransporterServer.getConnector(TransporterServer.java:163)
  |         at 
org.jboss.remoting.transporter.TransporterServer.<init>(TransporterServer.java:105)
  |         at 
org.jboss.remoting.transporter.TransporterServer.createTransporterServer(TransporterServer.java:292)
  |         at 
org.jboss.remoting.transporter.TransporterServer.createTransporterServer(TransporterServer.java:260)
  |         at 
org.jboss.remoting.transporter.TransporterServer.createTransporterServer(TransporterServer.java:502)
  |         at 
com.xxxxx.datamodel.client.TransporterClients.createServer(TransporterClients.java:168)
  |         ... 11 more
  | 
  | 

The code to establish client connection to server is given below.


  | TransporterClients(String pRmtURL, String pLclURL) throws DMException {
  |             rmturl = pRmtURL+"/?serializationtype=jboss";
  |             lclurl = getLocalURL(pLclURL);
  |             logger.info("Remote URL: "+rmturl);
  |             logger.info("Local URL: "+lclurl);
  |             try {
  |                     manager = (com.xxxxx.datamodel.rmt.DriverManager) 
TransporterClient
  |                                     .createTransporterClient(rmturl,
  |                                                     
com.xxxxx.datamodel.rmt.DriverManager.class);
  |                     driver = (com.xxxxx.datamodel.rmt.Driver) 
TransporterClient
  |                                     .createTransporterClient(rmturl,
  |                                                     
com.xxxxx.datamodel.rmt.Driver.class);
  |                     connection = (com.xxxxx.datamodel.rmt.Connection) 
TransporterClient
  |                                     .createTransporterClient(rmturl,
  |                                                     
com.xxxxx.datamodel.rmt.Connection.class);
  |                     stmt = (com.xxxxx.datamodel.rmt.Statement) 
TransporterClient
  |                                     .createTransporterClient(rmturl,
  |                                                     
com.xxxxx.datamodel.rmt.Statement.class);
  |                     observerserver = new Observable();
  |                     observer = createServer(observerserver, 
com.xxxxx.datamodel.rmt.Observer.class.getName());
  |             } catch (Exception e) {
  |                     logger.fatal(e.getLocalizedMessage(), e);
  |                     close();
  |                     throw new DMException(e);
  |             }
  |     }
  | 
  | 

The close method is given below.


  | 
  | void close() {
  |             if(observer!=null)
  |                     observer.stop();
  |             if(stmt!=null)
  |                     TransporterClient.destroyTransporterClient(stmt);
  |             if(connection!=null)
  |                     TransporterClient.destroyTransporterClient(connection);
  |             if(driver!=null)
  |                     TransporterClient.destroyTransporterClient(driver);
  |             if(manager!=null)
  |                     TransporterClient.destroyTransporterClient(manager);
  |     }
  | 
  | 

If there is any exception in the connection code it will try to close and try 
to recreate the connections in the next cycle.

I think the closing code is not releasing all the resources used by the client.

Any help would be greatly appreciated.

Thanks.

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4196720
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to