tyrus
  1. tyrus
  2. TYRUS-164

My WebSocket application failed to deploy.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Invalid
    • Affects Version/s: 1.0-b13
    • Fix Version/s: 1.0-rc1
    • Component/s: None
    • Labels:
      None
    • Environment:

      Windows 7 SP1
      Glassfish v4 b81
      Tyrus 1.0_b13

      Description

      I have filled an issue before regarding this issue. TYRUS-161

      As per last specification I have registered one decoder/encoder for text data type, instead of multiple encoders for the same type of message for different objects.

      And while I am deploying my application (that runs before on GFv4_b78) I got the following errors:

      -------------------------------------------------------
       T E S T S
      -------------------------------------------------------
      Running com.taman.rtrc.endpoint.data.LoginMessageTest
      Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.109 sec
      Running com.taman.rtrc.endpoint.data.RunnerMessageTest
      Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec
      Running com.taman.rtrc.endpoint.server.RTRCServerTest
      Mar 31, 2013 3:30:04 PM org.glassfish.tyrus.server.ServerContainerFactory create
      INFO: Provider class loaded: org.glassfish.tyrus.container.grizzly.GrizzlyEngine
      Mar 31, 2013 3:30:05 PM org.glassfish.grizzly.http.server.NetworkListener start
      INFO: Started listener bound to [0.0.0.0:2020]
      Mar 31, 2013 3:30:05 PM org.glassfish.grizzly.http.server.HttpServer start
      INFO: [HttpServer] Started.
      Mar 31, 2013 3:30:05 PM org.glassfish.tyrus.server.TyrusServerContainer stop
      INFO: Closing down : org.glassfish.tyrus.server.TyrusEndpoint@4ea17876
      Mar 31, 2013 3:30:05 PM org.glassfish.grizzly.http.server.NetworkListener stop
      INFO: Stopped listener bound to [0.0.0.0:2020]
      Mar 31, 2013 3:30:05 PM com.taman.rtrc.endpoint.server.RTRCServerTest setUpClass
      SEVERE: null
      javax.websocket.DeploymentException: Text MessageHandler already registered.
      
      	at org.glassfish.tyrus.core.ErrorCollector.composeComprehensiveException(ErrorCollector.java:83)
      	at org.glassfish.tyrus.server.TyrusServerContainer.start(TyrusServerContainer.java:144)
      	at org.glassfish.tyrus.server.Server.start(Server.java:122)
      	at com.taman.rtrc.endpoint.server.RTRCServerTest.setUpClass(RTRCServerTest.java:40)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
      	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:601)
      	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
      	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
      	at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
      	at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
      
      Mar 31, 2013 3:30:15 PM org.glassfish.tyrus.server.TyrusServerContainer stop
      INFO: Closing down : org.glassfish.tyrus.server.TyrusEndpoint@4ea17876
      Mar 31, 2013 3:30:15 PM org.glassfish.tyrus.server.Server stop
      INFO: Websocket Server stopped.
      Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 10.742 sec <<< FAILURE!
      

      My Server:

      @ServerEndpoint(value = "/server/register",
              decoders = {MessageConverter.class},
              encoders = {MessageConverter.class} )
      public class RTRCServer {
      

      Message converter

      public class MessageConverter implements Decoder.Text<Message>, Encoder.Text<Message> {}
      

      It seams that the implementation refuses one class that implements both encoder/decoder. Should I separate them?

        Activity

        Hide
        Pavel Bucek added a comment -

        this is not about decoders/encoders, this is about @OnMessage annotated methods and registered message handlers.

        your endpoint is still invalid (it has two @OnMessage methods in same "classification", see @OnMessage javadoc).

        Show
        Pavel Bucek added a comment - this is not about decoders/encoders, this is about @OnMessage annotated methods and registered message handlers. your endpoint is still invalid (it has two @OnMessage methods in same "classification", see @OnMessage javadoc).
        Hide
        Mohamed Taman added a comment -

        I got it, thanks.

        Show
        Mohamed Taman added a comment - I got it, thanks.

          People

          • Assignee:
            Pavel Bucek
            Reporter:
            Mohamed Taman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: