title: Not an managed type for Spring Data Mongodb
body: <p>I have the following mongo configuration:</p>
  
  <pre><code>&lt;context:component-scan base-package="com.example" /&gt;
  &lt;mongo:repositories base-package="com.example.repositories.mongodb" /&gt;
  </code></pre>
  
  <p>I have the repository as follows:</p>
  
  <pre><code>package com.example.repositories.mongodb;
  public interface ReviewRepository extends CrudRepository&lt;Review, String&gt; {...}
  </code></pre>
  
  <p>and the bean:</p>
  
  <pre><code>package com.example.domain;
  @Document(collection="Review")
  public class Review implements Serializable { ... }
  </code></pre>
  
  <p>Unfortunately, when I start the app, I get the following exception:</p>
  
  <blockquote>
    <p>Caused by: org.springframework.beans.factory.BeanCreationException:
    Could not autowire field: private
    com.example.repositories.mongodb.ReviewRepository
    com.example.Controller.reviewRepository; nested exception is
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name 'reviewRepository': FactoryBean threw
    exception on object creation; nested exception is
    java.lang.IllegalArgumentException: Not an managed type: class
    com.example.domain.Review</p>
  </blockquote>
  
  <p>....</p>
  
  <blockquote>
    <p>Caused by: java.lang.IllegalArgumentException: Not an managed type:
    class com.example.domain.Review</p>
  </blockquote>
  
  <p>I think that this might be caused by the repository and the bean it manages not being in the same package. But I get the same issue also when I do place them in the same package. Any ideas?</p>