javaspringjakarta-eeatmosphere

Spring 3 + atmosphere - type AtmosphereResource is not generic


I am getting Error of (The type AtmosphereResource is not generic; it cannot be parameterized with arguments ) during implementation of the following method in my spring 3 controller.

 @RequestMapping(value="/websockets", method=RequestMethod.GET)
     @ResponseBody
     public void websockets(final AtmosphereResource<HttpServletRequest,HttpServletResponse> event) {

          final HttpServletRequest  req = event.getRequest();
            final HttpServletResponse res = event.getResponse();
            event.suspend();

            final Broadcaster bc = event.getBroadcaster();
            bc.scheduleFixedBroadcast(new Callable<String>() {

                public String call() throws Exception {

                    return (new Date()).toString();
                }
            }, 11, TimeUnit.SECONDS);
     }

Solution

  • You probably figured the answer, but AtmosphereResource<?,?> no longer exists starting with 0.9 and higher version. Just remove that and it will works.