title: Why Getting error "Error creating bean with name '***': Unsatisfied dependency expressed through field '***'"
body: <p>I am getting  the errors while building the application using maven as below:</p>
  
  <h1>Error:</h1>
  
  <pre><code>org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name '***Controller': Unsatisfied dependency expressed through field '***ServiceImpl'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name '***ServiceImpl': Unsatisfied dependency expressed through field '***Repository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '***Repository': Post-processing of merged bean definition failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.PersistenceContext.synchronization()Ljavax/persistence/SynchronizationType;
  </code></pre>
  
  <p>find the classes as below:</p>
  
  <p>Controller class:</p>
  
  <pre><code>@Controller
  public class UserController {
  
      @Autowired
      private UserServiceImpl userServiceImpl;
  
  
      ------
  }
  </code></pre>
  
  <p>Service Class:</p>
  
  <pre><code>@Service
  public interface UserService {
  
      ----
  }
  </code></pre>
  
  <p>Service impl class:</p>
  
  <pre><code>@Service
  public class UserServiceImpl implements UserService {
  
      @Autowired
      private UserRepository userRepository;
  
  
      ------
  
  }
  </code></pre>
  
  <p>Repository class:</p>
  
  <pre><code>@Repository
      public interface UserRepository extends JpaRepository&lt;User, String&gt;{
  
          @Query(value = "SELECT Number FROM User where Token = :token", nativeQuery=true)
          public String findNumber(@Param("token") String token);
  
  
      }
  </code></pre>
  
  <p>Entity class:</p>
  
  <pre><code>@Entity
  public class User {
  
      @Id
      @XmlElement(name = "Number")
      protected String number;
      @XmlElement(name = "Token", required = true)
      protected String token;
  
      //setter &amp; getters
  
  }
  </code></pre>
  
  <p>Can anyone please suggest on this.</p>