tyrus
  1. tyrus
  2. TYRUS-262

@OnOpen fails for programmatically deployed annotated endpoint

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1, 1.3
    • Fix Version/s: 1.3
    • Component/s: server
    • Labels:
      None
    • Environment:

      glasssfish 4.0.1 build 4

      Description

      When programatically deploying an annotated endpoint, the container fails in the @OnOpen method with below exception. My workaround is to use a programmatic endpoint for programmatic deployment, although according to the spec, the reported scenario is allowed.

      [2013-10-25T14:18:51.295+0200] [glassfish 4.0] [SEVERE] [AS-WEB-CORE-00037] [javax.enterprise.web.core] [tid: _ThreadID=109 _ThreadName=http-listener-1(4)] [timeMillis: 1382703531295] [levelValue: 1000] [[
        An exception or error occurred in the container during the request processing
      java.lang.ClassCastException: nl.fontys.fhict.jea.gwt.jee7.server.ws.ServerEndpoint cannot be cast to javax.websocket.Endpoint
      	at org.glassfish.tyrus.core.EndpointWrapper.onConnect(EndpointWrapper.java:447)
      	at org.glassfish.tyrus.core.TyrusEndpoint.onConnect(TyrusEndpoint.java:133)
      	at org.glassfish.tyrus.websockets.DefaultWebSocket.onConnect(DefaultWebSocket.java:115)
      	at org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.init(TyrusHttpUpgradeHandler.java:101)
      	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:777)
      	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
      	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
      	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:399)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:266)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:496)
      	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:175)
      	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:187)
      	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
      	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      	at java.lang.Thread.run(Thread.java:744)
      ]]

        Activity

        jurjenvg created issue -
        Pavel Bucek made changes -
        Field Original Value New Value
        Assignee Pavel Bucek [ pavel_bucek ]
        Pavel Bucek made changes -
        Issue Type New Feature [ 2 ] Bug [ 1 ]
        Fix Version/s 1.3 [ 16600 ]
        Affects Version/s 1.2.1 [ 16601 ]
        Affects Version/s 1.3 [ 16600 ]
        Pavel Bucek made changes -
        Description When programatically deploying an annotated endpoint, the container fails in the @OnOpen method with below exception. My workaround is to use a programmatic endpoint for programmatic deployment, although according to the spec, the reported scenario is allowed.


        [2013-10-25T14:18:51.295+0200] [glassfish 4.0] [SEVERE] [AS-WEB-CORE-00037] [javax.enterprise.web.core] [tid: _ThreadID=109 _ThreadName=http-listener-1(4)] [timeMillis: 1382703531295] [levelValue: 1000] [[
          An exception or error occurred in the container during the request processing
        java.lang.ClassCastException: nl.fontys.fhict.jea.gwt.jee7.server.ws.ServerEndpoint cannot be cast to javax.websocket.Endpoint
        at org.glassfish.tyrus.core.EndpointWrapper.onConnect(EndpointWrapper.java:447)
        at org.glassfish.tyrus.core.TyrusEndpoint.onConnect(TyrusEndpoint.java:133)
        at org.glassfish.tyrus.websockets.DefaultWebSocket.onConnect(DefaultWebSocket.java:115)
        at org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.init(TyrusHttpUpgradeHandler.java:101)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:777)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:399)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:266)
        at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:496)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:175)
        at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:187)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
        at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
        at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
        at java.lang.Thread.run(Thread.java:744)
        ]]
        When programatically deploying an annotated endpoint, the container fails in the @OnOpen method with below exception. My workaround is to use a programmatic endpoint for programmatic deployment, although according to the spec, the reported scenario is allowed.


        {code}[2013-10-25T14:18:51.295+0200] [glassfish 4.0] [SEVERE] [AS-WEB-CORE-00037] [javax.enterprise.web.core] [tid: _ThreadID=109 _ThreadName=http-listener-1(4)] [timeMillis: 1382703531295] [levelValue: 1000] [[
          An exception or error occurred in the container during the request processing
        java.lang.ClassCastException: nl.fontys.fhict.jea.gwt.jee7.server.ws.ServerEndpoint cannot be cast to javax.websocket.Endpoint
        at org.glassfish.tyrus.core.EndpointWrapper.onConnect(EndpointWrapper.java:447)
        at org.glassfish.tyrus.core.TyrusEndpoint.onConnect(TyrusEndpoint.java:133)
        at org.glassfish.tyrus.websockets.DefaultWebSocket.onConnect(DefaultWebSocket.java:115)
        at org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.init(TyrusHttpUpgradeHandler.java:101)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:777)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:399)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:266)
        at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:496)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:175)
        at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:187)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
        at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
        at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
        at java.lang.Thread.run(Thread.java:744)
        ]]{code}
        Hide
        Pavel Bucek added a comment -

        fix merged to the master branch

        Show
        Pavel Bucek added a comment - fix merged to the master branch
        Pavel Bucek made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: