title: Get records with Vaadin 10 Spring Jpa
body: <p>good morning everyone.
  I'm starting to use vaadin 10, I'm trying to set items in a grid with Spring Jpa as follows, but for me it marks an error, this situation does not happen in the previous versions of vaadin.</p>
  
  <pre><code>@HtmlImport("styles/shared-styles.html") @Route("") public class MainView extends VerticalLayout {
  
  @Autowired
  private UserService userService;
  
  private Grid&lt;User&gt; grid = new Grid&lt;&gt;();
  
  public MainView() { 
  
  grid.setItems(userService.selectAll());
  
  add(grid);
  
  }
  </code></pre>
  
  <p>I got the following error:</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.portal.app.spring.MainView': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.portal.app.spring.MainView]: Constructor threw exception; nested exception is java.lang.NullPointerException
  
  .....
  
  Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.portal.app.spring.MainView]: Constructor threw exception; nested exception is java.lang.NullPointerException at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:182) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1228) ~[spring-beans-5.0.6.RELEASE.jar:5.0.6.RELEASE] ... 72 common frames omitted Caused by: java.lang.NullPointerException: null
  </code></pre>
  
  <p>from what I understand, this is caused by @autowire in my service.</p>
  
  <p>I hope someone shares with me an idea of ​​how I resolve the error, thanks :)</p>