title: Running imported Getting Started project accessing facebook data appears NullPointerException
body: <p>I use Eclipse and Tomcat plugin installed. I imported Spring Getting Started project to access facebook data. Facebook application was registered. Application.properties are setted. Classes are compiled. 
  I run this project with </p>
  
  <blockquote>
    <p>mvn spring-boot:run</p>
  </blockquote>
  
  <p>and all is OK. DispatherServlet is initiated. But if I open <a href="http://localhost:8080" rel="nofollow">http://localhost:8080</a> I get error</p>
  
  <pre><code>2015-07-16 14:02:38.158 ERROR 2248 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause java.lang.NullPointerException: null
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
  at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
  at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
  at com.sun.proxy.$Proxy42.isAuthorized(Unknown Source)
  at hello.HelloController.helloFacebook(HelloController.java:26)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
  at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
  at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
  at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
  at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
  at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
  </code></pre>
  
  <p>etc. What should I do? Please help me!</p>
  
  <p>Below there are Application.java </p>
  
  <pre><code>package hello;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  
  @SpringBootApplication
  public class Application {
  
  public static void main(String[] args) {
      SpringApplication.run(Application.class, args);
  }
  
  }
  </code></pre>
  
  <p>HelloController.java</p>
  
  <pre><code>package hello;
  
  import javax.inject.Inject;
  
  import org.springframework.social.facebook.api.Facebook;
  import org.springframework.social.facebook.api.PagedList;
  import org.springframework.social.facebook.api.Post;
  import org.springframework.stereotype.Controller;
  import org.springframework.ui.Model;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  
  @Controller
  @RequestMapping("/")
  public class HelloController {
  
  private Facebook facebook;
  
  @Inject
  public HelloController(Facebook facebook) {
      this.facebook = facebook;
  }
  
  @RequestMapping(method=RequestMethod.GET)
  public String helloFacebook(Model model) {
      if (!facebook.isAuthorized()) {
          return "redirect:/connect/facebook";
      }
  
      model.addAttribute(facebook.userOperations().getUserProfile());
      PagedList&lt;Post&gt; homeFeed = facebook.feedOperations().getHomeFeed();
      model.addAttribute("feed", homeFeed);
  
      return "hello";
  }
  
  }
  </code></pre>
  
  <p>hello.html</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Hello Facebook&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h3&gt;Hello, &lt;span th:text="${facebookProfile.name}"&gt;Some User&lt;/span&gt;!&lt;/h3&gt;
  
      &lt;h4&gt;Here is your home feed:&lt;/h4&gt;
  
      &lt;div th:each="post:${feed}"&gt;
          &lt;b th:text="${post.from.name}"&gt;from&lt;/b&gt; wrote:
          &lt;p th:text="${post.message}"&gt;message text&lt;/p&gt;
          &lt;img th:if="${post.picture}" th:src="${post.picture}"/&gt;
          &lt;hr/&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>facebookConnect.html</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Hello Facebook&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h3&gt;Connect to Facebook&lt;/h3&gt;
  
      &lt;form action="/connect/facebook" method="POST"&gt;
          &lt;input type="hidden" name="scope" value="read_stream" /&gt;
          &lt;div class="formInfo"&gt;
              &lt;p&gt;You aren't connected to Facebook yet. Click the button to connect this application with your Facebook account.&lt;/p&gt;
          &lt;/div&gt;
          &lt;p&gt;&lt;button type="submit"&gt;Connect to Facebook&lt;/button&gt;&lt;/p&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and facebookConnected.html</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Hello Facebook&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h3&gt;Connected to Facebook&lt;/h3&gt;
  
      &lt;p&gt;
          You are now connected to your Facebook account.
          Click &lt;a href="/"&gt;here&lt;/a&gt; to see some entries from your Facebook home feed.
      &lt;/p&gt;        
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>