diff --git a/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaOwnerRepositoryImpl.java b/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaOwnerRepositoryImpl.java
index 3b85bfd8d350ed7249465de3e21033db7454a2a9..acebc636699d43a997b06474e0bac1029ae42a2d 100644
--- a/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaOwnerRepositoryImpl.java
+++ b/src/main/java/org/springframework/samples/petclinic/repository/jpa/JpaOwnerRepositoryImpl.java
@@ -45,7 +45,7 @@ public class JpaOwnerRepositoryImpl implements OwnerRepository {
     public Collection<Owner> findByLastName(String lastName) {
         // using 'join fetch' because a single query should load both owners and pets
         // using 'left join fetch' because it might happen that an owner does not have pets yet
-        Query query = this.em.createQuery("SELECT owner FROM Owner owner left join fetch owner.pets WHERE owner.lastName LIKE :lastName");
+        Query query = this.em.createQuery("SELECT DISTINCT owner FROM Owner owner left join fetch owner.pets WHERE owner.lastName LIKE :lastName");
         query.setParameter("lastName", lastName + "%");
         return query.getResultList();
     }
diff --git a/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/JpaOwnerRepositoryImpl.java b/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/JpaOwnerRepositoryImpl.java
index e6d050e59919215fba431bf6da931a21cd0e2cfb..1ce4a6aad03ac2a13e7618847db0a23e9fbf6c16 100644
--- a/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/JpaOwnerRepositoryImpl.java
+++ b/src/main/java/org/springframework/samples/petclinic/repository/springdatajpa/JpaOwnerRepositoryImpl.java
@@ -43,7 +43,7 @@ public class JpaOwnerRepositoryImpl implements OwnerRepository {
     public Collection<Owner> findByLastName(String lastName) {
         // using 'join fetch' because a single query should load both owners and pets
         // using 'left join fetch' because it might happen that an owner does not have pets yet
-        Query query = this.em.createQuery("SELECT owner FROM Owner owner left join fetch owner.pets WHERE owner.lastName LIKE :lastName");
+        Query query = this.em.createQuery("SELECT DISTINCT owner FROM Owner owner left join fetch owner.pets WHERE owner.lastName LIKE :lastName");
         query.setParameter("lastName", lastName + "%");
         return query.getResultList();
     }
diff --git a/src/main/resources/spring/dao-config.xml b/src/main/resources/spring/dao-config.xml
index 620f8852747feb0d8fa56a8f25311a499f3cdb8e..9ea5c17640164362cf1ccc42ddbf47b58e933987 100644
--- a/src/main/resources/spring/dao-config.xml
+++ b/src/main/resources/spring/dao-config.xml
@@ -22,6 +22,8 @@
     <!-- import the dataSource definition -->
     <import resource="datasource-config.xml"/>
 
+    <context:component-scan
+            base-package="org.springframework.samples.petclinic.service"/>
 
     <!-- Configurer that replaces ${...} placeholders with values from a properties file -->
     <!-- (in this case, JDBC-related settings for the JPA EntityManager definition below) -->
@@ -40,7 +42,7 @@
     <!--
         Instruct Spring to perform declarative transaction management
         automatically on annotated classes.
-                
+
         for mode="aspectj"/ see SPR-6392
     -->
     <tx:annotation-driven/>
diff --git a/src/main/resources/spring/mvc-core-config.xml b/src/main/resources/spring/mvc-core-config.xml
index 3724b05593f2093cc52ca8e8d69ad11e42c0f20e..426f1231549704e874dfb94d38123cdd31c958aa 100644
--- a/src/main/resources/spring/mvc-core-config.xml
+++ b/src/main/resources/spring/mvc-core-config.xml
@@ -20,7 +20,7 @@
         - POJOs labeled with the @Controller and @Service annotations are auto-detected.
     -->
     <context:component-scan
-            base-package="org.springframework.samples.petclinic.web, org.springframework.samples.petclinic.service"/>
+            base-package="org.springframework.samples.petclinic.web"/>
 
     <mvc:annotation-driven conversion-service="conversionService"/>