6 Replies Latest reply on Mar 7, 2014 4:44 AM by jmesnil

    Need help for wildfly's ManagedExecutorService

    wyonge

      Hi:

      When I run javaEE7 tutorial's  websocketbot Example Application ( located in the tut-install/examples/web/websocket/websocketbot/directory ) in wildfly 8.0.0 Final,I got the error message about

      INFO  [BotEndpoint] (default task-12) Connection error (java.lang.RuntimeException: java.lang.reflect.InvocationTargetException)
      
      

      I had already change the source code

      @Resource(name="comp/DefaultManagedExecutorService")
          private ManagedExecutorService mes;
      
      

      to

      @Resource(lookup="java:jboss/ee/concurrency/executor/default")
          private ManagedExecutorService mes;
      
      

      or

      @Resource
          private ManagedExecutorService mes;
      
      

      But when i debug the code ,find the mes is null .

      In wildfly's administrator console, the java:jboss/ee/concurrency/executor/default is exists .

      JNDI-View.PNG

      The core code about this application as follows:

            if (cmsg.getTarget().compareTo("Duke") == 0) {
                      /* The bot replies to the message */
                      mes.submit(new Runnable() {               // the mes is null 
                          public void run() {
                              String resp = botstockbean.respond(cmsg.getMessage());
                              sendAll(session, new ChatMessage("Duke", cmsg.getName(), resp));
                          }
                      });
                
                  }
      
      

      anybody can help me ? thanks!