2013-03-01 46 views
0

在我的spring 3控制器中執行以下方法期間,出現錯誤(AtmosphereResource類型不是通用的;它不能用參數進行參數化)。Spring 3 +大氣 - 類型AtmosphereResource不是通用的

@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); 
    } 

回答

3

薩呂,

你可能猜到了答案,但AtmosphereResource不再存在先從0.9及更高版本。只要刪除它,它會起作用。

A +

- Jeanfrancois

+0

BeanInstantiationException爲AtmosphereResource。請幫忙! – masT 2013-12-17 06:21:19

+0

跳轉到大氣郵件列表...或嘗試2.1.0-RC1並閱讀https://github.com/Atmosphere/atmosphere/wiki/Configuring-Atmosphere's-Classes-Creation-and-Injection – jfarcand 2013-12-17 21:45:33

相關問題