title: Error in custom repository interface
body: <p>I'm trying to set up my first Java application using Spring Data for MongoDB in a multi-module Maven 3 project. Here are the relevant versions:</p>
  
  <ul>
  <li>Java 7</li>
  <li>mongodb-win32-x86_64-2.2.0</li>
  <li>Spring Data 1.1.1.RELEASE</li>
  <li>Spring 3.2.0.RELEASE</li>
  </ul>
  
  <p>I'm getting the following runtime error:</p>
  
  <pre class="lang-none prettyprint-override"><code>Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actorFacade': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private es.mi.casetools.praetor.persistence.springdata.repositories.ActorRepository es.mi.casetools.praetor.facade.impl.DefaultActorFacade.actorRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actorRepository': FactoryBean threw exception on object creation; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property insert found for type void
      at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
      at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:106)
      at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:57)
      at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)
      at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:248)
      at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:124)
      at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:148)
      ... 30 more
  </code></pre>
  
  <hr>
  
  <p>Searching in google I found people with the same issue and it seems to be related with custom repositories.</p>
  
  <p>Here is the entity I want to store as a mongo document.</p>
  
  <pre class="lang-java prettyprint-override"><code>public class Actor {
      public enum ActorStereotype {
          SYSTEM, 
          PERSON
      }
          private String id;
      private String code; // unique
      private ActorStereotype stereotype;
      private String title; // Short title for the actor
      private String description;
      private String projectId; // project this actor belongs to
  
          // getters &amp; setters
  </code></pre>
  
  <p>The standard repository interface.</p>
  
  <pre class="lang-java prettyprint-override"><code>public interface ActorRepository extends MongoRepository&lt;Actor, String&gt;, ActorRepositoryCustom {
  }
  </code></pre>
  
  <p>The custom interface (where I think the error lives).</p>
  
  <pre class="lang-java prettyprint-override"><code>@NoRepositoryBean
  public interface ActorRepositoryCustom {
      void updateSingleActor(Actor actor);
      void insertActor(Actor actor);
  }
  </code></pre>
  
  <p>The custom interface implementation.</p>
  
  <pre class="lang-java prettyprint-override"><code>public class ActorRepositoryCustomImpl implements ActorRepositoryCustom {
      @Autowired
      private MongoTemplate mongoTemplate;
  
      @Override
      public void updateSingleActor(Actor actor) {
          if(actor.getId() != null) 
              throw new MissingIdException();
  
          // TODO change to Spring Converter
          DBObject dbo = (DBObject)mongoTemplate.getConverter().convertToMongoType(actor);
  
          mongoTemplate.updateFirst(query(where("_id").is(actor.getId())), 
                  Update.fromDBObject(dbo, new String[]{}), 
                  Actor.class);
      }
  
      @Override
      public void insertActor(Actor actor) {  
          if(actor.getId() != null) 
              throw new IdProvidedException();
  
          mongoTemplate.save(actor);
      }
  
  }
  </code></pre>
  
  <p>And finally, the application context.</p>
  
  <pre class="lang-xml prettyprint-override"><code>    &lt;context:annotation-config/&gt;
  
      &lt;bean id="propertyConfigurer"       class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
          &lt;property name="locations"&gt;
              &lt;list&gt;
                  &lt;value&gt;classpath:properties/test.properties&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;!-- mongodb configuration --&gt;          
      &lt;mongo:repositories base-package="es.mi.casetools.praetor.persistence.springdata.repositories" 
          mongo-template-ref="mongoTemplate" repository-impl-postfix="Impl"&gt;                  
          &lt;repository:exclude-filter type="annotation" expression="org.springframework.data.repository.NoRepositoryBean"/&gt;    
      &lt;/mongo:repositories&gt;
  
      &lt;mongo:mongo id="mongotest" host="${mongo.host}" port="${mongo.port}" write-concern="SAFE"&gt;
      &lt;/mongo:mongo&gt;
  
      &lt;mongo:db-factory dbname="${mongo.dbname}" mongo-ref="mongotest"/&gt;
  
      &lt;bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"&gt;
          &lt;constructor-arg name="mongoDbFactory" ref="mongoDbFactory"/&gt;
      &lt;/bean&gt; 
      &lt;bean id="actorFacade" class="es.mi.casetools.praetor.facade.impl.DefaultActorFacade"&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>I also have a little Spring test that fails loading the above application context giving the exception I listed near the top. </p>
  
  <p>I tried adding the following but I get the same exception.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;bean id="actorRepositoryCustomImpl" class="es.mi.casetools.praetor.persistence.springdata.repositories.ActorRepositoryCustomImpl"&gt;&lt;/bean&gt;
  </code></pre>
  
  <p>Has someone got a clue of what the error may be?</p>