7 Replies Latest reply on Aug 23, 2006 9:32 AM by cnbs

    How to unregister a ServerInvoker?

    cnbs

      Hello.
      I'm using remoting shipped in Jboss-4.0.4.
      I have problems with deployment/undeployment. I deploy an application with remoting, create a Connector and test connectivity with client. After this i change my code, compile and redeploy application and when i try to create a connector i get this exception:

      org.jboss.remoting.InvalidConfigurationException: The invoker for locator (InvokerLocator [rmi://127.0.0.1:3550/]) is already in use by another Connector. Either change the locator or add new handlers to existing Connector

      I tried use the already registered invoker but, the application code remains old.
      So how can i unregister this invoker to be able to create a new Connector?



        • 1. Re: How to unregister a ServerInvoker?

          Just as a simple tests, I deployed a remoting-service.xml file in the deploy directory for JBossAS 4.0.4 and would then change some of the attribute values (i.e. backlog to 205). This worked without any problems. Contentes of remoting-service.xml pasted below.

          Can you post the service.xml you are using (or what ever you are using) or create a jira issue and put in how to duplicate what you are doing?

          Thanks.

          -Tom

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE server>
          
          <server>
           <classpath codebase="lib"
           archives="*"/>
          
           <mbean code="org.jboss.remoting.network.NetworkRegistry"
           name="jboss.remoting:service=NetworkRegistry"/>
          
           <mbean code="org.jboss.remoting.transport.Connector"
           name="jboss.remoting:service=Connector,transport=Socket"
           display-name="Socket transport Connector">
          
           <attribute name="Configuration">
           <config>
           <invoker transport="socket">
           <attribute name="numAcceptThreads">1</attribute>
           <attribute name="maxPoolSize">303</attribute>
           <attribute name="clientMaxPoolSize" isParam="true">305</attribute>
           <attribute name="socketTimeout">60000</attribute>
           <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
           <attribute name="serverBindPort">6666</attribute>
           <attribute name="enableTcpNoDelay" isParam="false">false</attribute>
           <attribute name="backlog">203</attribute>
           </invoker>
           <handlers>
           <handler subsystem="mock">org.jboss.remoting.samples.http.WebInvocationHandler</handler>
           </handlers>
           </config>
           </attribute>
           </mbean>
          
          </server>
          


          • 2. Re: How to unregister a ServerInvoker?
            cnbs

            Thank you Tom.
            I have not used any remoting-service.xml, and my code looks like this:

            locatorURI = "rmi://localhost:3550";
            
            public void startServer() {
             try {
             InvokerLocator locator = new InvokerLocator(locatorURI);
             Connector connector = new Connector(locator);
             connector.create();
             connector.addInvocationHandler("ASubSystem", this);
             log.debug("Starting remoting server with locator uri : " + locatorURI);
             connector.start();
             log.debug("Remoting server started with locator uri : " + locatorURI);
             } catch (MalformedURLException e) {
             log.error("Server start failed :" + e.getMessage());
             } catch (Exception e) {
             e.printStackTrace();
             }
             }

            As you can see there is no configuration. I have to restart JbossAP every time i redeploy my app.




            • 3. Re: How to unregister a ServerInvoker?
              cnbs

              i mean JBossAS :)

              • 4. Re: How to unregister a ServerInvoker?

                Since are creating the Connector via code, will also need to call stop() and destroy() on Connector when done using it (i.e. have a stopServer() method to do this that gets called when your app is undeployed).

                • 5. Re: How to unregister a ServerInvoker?
                  cnbs

                  Sorry for a stupid question but how can i do this:

                  "tom.elrod@jboss.com" wrote:
                  ... that gets called when your app is undeployed...



                  • 6. Re: How to unregister a ServerInvoker?

                    Will depend on type of application being deployed. May have to deploy the remoting server as an service mbean and have your other class look it up when being deployed.

                    Can find more info at http://wiki.jboss.org/wiki/Wiki.jsp?page=DeploymentService.

                    • 7. Re: How to unregister a ServerInvoker?
                      cnbs

                       

                      "tom.elrod@jboss.com" wrote:
                      Will depend on type of application being deployed. May have to deploy the remoting server as an service mbean and have your other class look it up when being deployed.

                      Can find more info at http://wiki.jboss.org/wiki/Wiki.jsp?page=DeploymentService.


                      Why is it so complicated? Why not just let the application know when it is undeployed? There got to be a simpler way to do this.
                      Anyway. Thank you :)