您好我已經設置了Spring MVC(4)+ Postgresql + JPA應用程序,並且遇到以下情況: 我想爲我的「User」存儲庫設置自定義查詢,現有的(空)UserRepository:Spring MVC OptionalValidatorFactoryBean未找到
public interface AccountRepository extends JpaRepository<User,Long> {
@Query("select u from User u where u.Email = ?1")
User findByEmail(String emailAddress);
}
隨着空庫,一切都與服務器OK,與verison上面我得到了在啓動時出現以下異常:
org.springframework.beans.factory .BeanCreationException:創建名爲'accountController'的bean時出錯:注入自動裝配依賴關係失敗;
嵌套的例外是
org.springframework.beans.factory.BeanCreationException:無法自動裝配領域:私人com.springapp.mvc.Repositories.AccountRepository com.springapp.mvc.AccountController.accountRepository;
嵌套的例外是
org.springframework.beans.factory.CannotLoadBeanClassException:找不到類[org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean]爲名爲「豆org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean# 0'在null中定義;
嵌套的例外是
拋出java.lang.ClassNotFoundException:org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean
即使強硬。我有OptionalValidatorFactoryBean.java在罐子(提取它)提供與Maven。我很困惑。
凹凸,凹凸,凹凸 – 2015-02-07 18:45:33
該庫是否添加到依賴關係? – Rothens 2015-07-05 23:14:04