@Resource outside the @Controller on Spring Boot
<p>I want to access an @Resource from an pojo class, but i cant. I allways get NullPointer. Im using Spring Boot framework, 1.4.2.RELEASE version. </p>

<p>Is it possible? Here is part of my code:</p>

<pre><code>    @Service
    public class CvFacade implements Cvitae{

        @Resource
        private CvRepository cvDao;

    //....
    }


   public interface CvRepository extends CrudRepository&lt;Cv, Long&gt;{

    @Query("select c from Cv c where c.idiom = :idiom")
    public List&lt;Cv&gt; listarCv(@Param("idiom") EnumIdiom idiom);


    @Query("select c from Person c where c.idPerson=1")
    public List&lt;Person&gt; listarPerson();


}
</code></pre>

<p>my Application:</p>

<pre><code>@SpringBootApplication(scanBasePackages = { "com.xxxxxx.cv.controller","com.xxxxxx.cv.facade","com.xxxxxx.cv.repository"})
@EnableJpaRepositories(basePackages = {"com.xxxxxx.cv.repository"}, entityManagerFactoryRef = "emf")
@PropertySource(value = { "classpath:application.properties" })
@EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class })
public class Application extends SpringBootServletInitializer {
//...

}
</code></pre>