tyrus
  1. tyrus
  2. TYRUS-77

The org.glassfish.tyrus.spi.grizzlyprovider.GrizzlyEngine throws a NullPointerException when it starts.

    Details

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

      Description

      In my project pom.xml, I have upgraded my dependencies of the following artifacts

      websocket-impl From: 1.0-b04 To: 1.0-b06
      websocket-provider-grizzly From: 1.0-b04 To: 1.0-b06
      javax.net.websocket-api From: 1.0-b04 To: javax.websocket-api 1.0-b11

      Code:

      HelloWebSocketEndpoint.java (Endpoint)
      /**
       * @author Mohamed Taman
       * @version 1.0b
       * @since JSR356 - WS-API b11
       *
       */
      @WebSocketEndpoint(value = "/hello",configuration=DefaultServerConfiguration.class)
      public class HelloWebSocketEndpoint {
      
         @WebSocketOpen
         public void onConnectionEstablished() {
            
            System.out.println("Session is opened ");
      
         }
      
         @WebSocketMessage
         public void echo(String message, Session session) {
            try {
               // Echo the message back to sender.
               session.getRemote().sendString(message + " From Endpoint");
            } catch (IOException ex) {
               Logger.getLogger(HelloWebSocketEndpoint.class.getName()).log(Level.SEVERE, null, ex);
            }
      
         }
      
         @WebSocketClose
         public void onConnectionClosed(Session session) throws IOException {
            System.out.println("Session will be closed");
            session.close();
         }
      }
      
      Main.java (Deployer)
      * @author Mohamed Taman
       */
      public class Main {
         
         public static void main(String[] args) {
            
               Server server = new Server("localhost",8025,"/example",HelloWebSocketEndpoint.class);
            try {   
              server.start();
               System.out.println("Press any key to exit");
               System.in.read();
            } catch (IOException ex) {
               Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
            }finally{
               server.stop();
               System.out.println("Server stopped.");
            }
            
         }
      }
      
      Throws The following error

      Jan 30, 2013 4:57:36 PM org.glassfish.grizzly.http.server.NetworkListener start
      INFO: Started listener bound to [0.0.0.0:8025]
      Jan 30, 2013 4:57:36 PM org.glassfish.grizzly.http.server.HttpServer start
      INFO: [HttpServer] Started.
      Jan 30, 2013 4:57:36 PM org.glassfish.tyrus.platform.BeanServer setEngine
      INFO: Provider class instance: org.glassfish.tyrus.spi.grizzlyprovider.GrizzlyEngine@ce124a7 of class class org.glassfish.tyrus.spi.grizzlyprovider.GrizzlyEngine assigned in the BeanServer
      Jan 30, 2013 4:57:36 PM org.glassfish.tyrus.platform.BeanServer <init>
      INFO: Provider class loaded: org.glassfish.tyrus.spi.grizzlyprovider.GrizzlyEngine
      java.lang.NullPointerException
      Press any key to exit
      at org.glassfish.tyrus.platform.BeanServer.getMethodToPathMap(BeanServer.java:166)
      at org.glassfish.tyrus.platform.BeanServer.initWebSocketServer(BeanServer.java:137)
      at org.glassfish.tyrus.platform.main.Server.start(Server.java:136)
      at eg.com.tm.ws1_0.example.hw.Main.main(Main.java:22)
      Jan 30, 2013 4:57:36 PM org.glassfish.tyrus.platform.main.Server start
      INFO: WebSocket Registered apps: URLs all start with ws://localhost:8025
      Jan 30, 2013 4:57:36 PM org.glassfish.tyrus.platform.main.Server start
      INFO: WebSocket server started.

        Activity

        Mohamed Taman created issue -
        Pavel Bucek made changes -
        Field Original Value New Value
        Assignee Pavel Bucek [ pavel_bucek ]
        Hide
        Pavel Bucek added a comment - - edited

        1.0-b06 does not implement javax.websocket-api:1.0-b11.

        please try tyrus version 1.0-b10:

                <dependency>
                    <groupId>org.glassfish.tyrus</groupId>
                    <artifactId>tyrus-container-grizzly</artifactId>
                    <version>1.0-b10</version>
                </dependency>
        

        (all other dependencies are redundant)

        Show
        Pavel Bucek added a comment - - edited 1.0-b06 does not implement javax.websocket-api:1.0-b11. please try tyrus version 1.0-b10: <dependency> <groupId>org.glassfish.tyrus</groupId> <artifactId>tyrus-container-grizzly</artifactId> <version>1.0-b10</version> </dependency> (all other dependencies are redundant)
        Hide
        Pavel Bucek added a comment -

        feel free to reopen/post questions to users@tyrus.java.net

        Show
        Pavel Bucek added a comment - feel free to reopen/post questions to users@tyrus.java.net
        Pavel Bucek made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: