6 Replies Latest reply on Oct 17, 2011 9:01 AM by Steve Cohen

    Endpoint already registered

    Ben Sisson Newbie

      I placed the following request for information in the JBoss Tools forum and they refered me to JBossws. I hope someone can help me with this issue.

      I am using Eclipse 3.3 and JBoss Tools Core 2.0.1.GA. I created a SEAM Web service (TestWs) which runs correctly. I start JBoss Server from the JBoss Server View. I check the console and I can find a reference to my TestWs Web service. I make some changes to my Web service and then right click on my moduel (within by JBoss Server view) and do a full publish of that service again. This time I do not see a reference to my web service. I'm using the Eclipse web service explorer to test my web service. When I try to use it again (after the changes and the redeploy) I get a could not create deployment - endpoint already registered error (see below). If I completely shutdown Eclipse, reopen and start JBoss Server again it works fine but after the first test (in debug mode) it will get the same message again and I will have to shut down and restart Eclipse again. This is very time consuming and any help would be greatly apprecaited.

      11:46:59,969 ERROR [MainDeployer] Could not create deployment: file:/C:/Eclipse/Servers/jboss-4.2.2.GA/jboss-4.2.2.GA/server/all/deploy/PSDynamicWebProject-ear.ear/PSDynamicWebProject.war/
      java.lang.IllegalStateException: Endpoint already registered: jboss.ws:context=PSDynamicWebProject,endpoint=TestWs
      at org.jboss.wsf.framework.management.DefaultEndpointRegistry.register(DefaultEndpointRegistry.java:89)
      at org.jboss.wsf.framework.management.ManagedEndpointRegistry.register(ManagedEndpointRegistry.java:59)
      at org.jboss.wsf.framework.deployment.EndpointRegistryDeploymentAspect.create(EndpointRegistryDeploymentAspect.java:46)
      at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(DeploymentAspectManagerImpl.java:115)
      at org.jboss.wsf.container.jboss42.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:97)
      at org.jboss.wsf.container.jboss42.DeployerInterceptor.create(DeployerInterceptor.java:79)
      at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
      at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy54.create(Unknown Source)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:959)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy9.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)

        • 1. Re: Endpoint already registered
          Ben Sisson Newbie

          I would like to provide additional information for this issue. Our whole team has looked at this issue and cannot find a work around or the cause of the issue but we have figured out the sequence that triggers the issue.

          1) We created a web service using annotations (@WebService(name = "TestWs") and it runs fine.
          2) We created a class (People) that is annotated for xml marshalling (@XmlRootElement).
          3) In the web service a database is queried and the data is stored in the People class.
          4) Using javax.xml.bind the class is marshalled into a xml string.
          5) At this point, in debut mode, there are occasions (depending upon the class fields) the marshaller will either work fine or the it wil fail. If it works fine the xml string is returned to the Web Service Explorer (built into Eclipse) and if it fails the error message string is returned to the Web Service Explorer.
          6) Then we make changes to the People class (add or delete fields) and we get a message asking us if we want to continue, stop or restart the server. If we select continue the server runs find but only picks up the old version of the People class and not the new changes. The issues begin when we chose stop or restart server.

          When the server is restarted there are two key issues: (1) If I search the console I cannot find a reference to my web service after the restart. The first time I start the server I see a reference that the web service was deplyed. (2) When I used the Web Service Explorer to find the web service I get an exception: javax.xml.ws.WebServiceException: Cannot obtain endpoint for: jboss.ws:context=/PSDynamicWebProject,endpoint=TestWs

          At this point nothing we do in Eclipse can eliminate this exception. We have tried restarting the JBoss server, clicking on the module and doing a full publish and nothing works. The only resolution to get around this at this point has been to shutdwon Eclipse completely and restart it. This works until we have to change the class again and we go through the same steps.

          We are in the start-up phase of re-writing our web applicaitons here and are evaluating JBoss and JBoss tools. We would really like to find a reslution to this since we are using Eclipse as our IDE and any help would be apprecaited.

          • 2. Re: Endpoint already registered
            Ben Sisson Newbie

            Additional information. This issue appears to only happen when in Debug mode within Eclipse.

            • 3. Re: Endpoint already registered
              Alessio Soldano Master

              Generally speaking, the "Endpoint already registered" error can be caused by a failed deploy/undeploy that left the endpoint registry in a inconsistent state (i.e. the endpoint is registered but is actually not available). Do the errors you get somehow influence the deploy/undeploy?

              • 4. Re: Endpoint already registered
                Steve Cohen Newbie

                I am now bitten by this.  I am less interested in solving the bug than in cleaning it up.  Where is this "endpoint registry" and how might I revert it to a clean state?

                • 5. Re: Endpoint already registered
                  Richard Opalka Master

                  I highly suggest you to switch to JBoss 6.1.0.GA or JBoss 7.0.2

                  Should be fixed there

                  • 6. Re: Endpoint already registered
                    Steve Cohen Newbie

                    Unfortumately, this may not be not an option for me.  I am constrained by the policies of the corporation for which I'm working.  At present 5.1.0-GA is the only platform they'll support, and they WILL NOT ever support 6.x.x, but there is some talk of supporting in the not-too-distant future 7.x.x.  I will try to press and see if this may be pushed forward.