title: Bean creation exception in spring mobile
body: <p>I am getting the following exception while using <a href="http://www.srccodes.com/p/article/25/spring-mobile-hello-world-example-that-includes-deviceresolver-sitepreference-urlpath-siteswitcher-and-litedevicedelegatingviewresolver" rel="nofollow">sample</a></p>
  
  <p>nested exception is 
  <code>org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.mobile.device.Device]: Specified class is an interface]</code> with root cause</p>
  
  <p>My controller is as follows:</p>
  
  <pre><code>package com.srccodes.spring.controller;
  
  import java.util.logging.Logger;
  import org.springframework.mobile.device.Device;
  import org.springframework.mobile.device.site.SitePreference;
  import org.springframework.stereotype.Controller;
  import org.springframework.ui.Model;
  import org.springframework.web.bind.annotation.RequestMapping;
  
  /**
   * @author Abhijit Ghosh
   * @version 1.0
   */
  @Controller
  public class SpringMobileHelloController {
      private static final Logger logger = Logger.getLogger(SpringMobileHelloController.class.getName());
  
      @RequestMapping("/")
      public String sayHello(SitePreference sitePreference, Device device, Model model) {
          logger.info("SitePreference : " + sitePreference);
          logger.info("Device : " + device);
  
          model.addAttribute("message", "Hello World!");
  
          return "helloWorld";
      }
  }
  
  
  My dispatcher-servlet.xml is:
  
   (some parts omitted)
  
      &lt;context:component-scan base-package="com.srccodes.spring.controller" /&gt;
  
      &lt;mvc:annotation-driven&gt;
          &lt;mvc:argument-resolvers&gt;
              &lt;bean            class="org.springframework.mobile.device.site.SitePreferenceWebArgumentResolver" /&gt;            
              &lt;bean class="org.springframework.mobile.device.DeviceWebArgumentResolver" /&gt;
          &lt;/mvc:argument-resolvers&gt;
      &lt;/mvc:annotation-driven&gt;
  
      &lt;mvc:interceptors&gt;
          &lt;!-- Resolve the device which has generated the request --&gt;
          &lt;bean class="org.springframework.mobile.device.DeviceResolverHandlerInterceptor" /&gt;
  
          &lt;!-- User's site preference --&gt;
          &lt;bean class="org.springframework.mobile.device.site.SitePreferenceHandlerInterceptor" /&gt;
  
          &lt;!-- Redirects users to the device specific site --&gt;
          &lt;bean class="org.springframework.mobile.device.switcher.SiteSwitcherHandlerInterceptor" factory-method="urlPath"&gt;
              &lt;constructor-arg value="/m" /&gt;
              &lt;constructor-arg value="/t" /&gt;
              &lt;constructor-arg value="/SpringMobileHelloWorld" /&gt;
          &lt;/bean&gt;
      &lt;/mvc:interceptors&gt;
  
  
      &lt;!-- Device aware view resolving --&gt;
      &lt;bean id="liteDeviceDelegatingViewResolver" class="org.springframework.mobile.device.view.LiteDeviceDelegatingViewResolver"&gt;
          &lt;constructor-arg&gt;
              &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
                  &lt;property name="prefix" value="/WEB-INF/pages/" /&gt;
                  &lt;property name="suffix" value=".jsp" /&gt;
              &lt;/bean&gt;
          &lt;/constructor-arg&gt;
  
          &lt;property name="mobilePrefix" value="m/" /&gt;
          &lt;property name="tabletPrefix" value="t/" /&gt;
          &lt;property name="enableFallback" value="true" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>Please help me out as I am a beginner in spring mobile.This example is available in spring source official website.It is saying that device is a interface but I have used its implementing classes only.Basically I think its an error in dispatcher servlet.xml</p>