2017-06-14 259 views
0

我在h2数据库中使用了jhipster-4.5.1,我在更改代码后运行服务器时出现错误,但代码中没有错误,但代码中没有错误,但是代码中运行服务器时出现错误modifies.it说Jhipster运行服务器时出错

2017-06-14 17:43:03.578 WARN 19964 --- [ restartedMain] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bloodPressureResource' defined in file [/home/rajeev/Devapp_Maven/target/classes/com/devapp/web/rest/BloodPressureResource.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bloodPressureRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.devapp.repository.BloodPressureRepository.findAllByTimestampBetweenOrderByTimestampDesc(java.time.LocalDate,java.time.LocalDate)! 
2017-06-14 17:43:03.916 DEBUG 19964 --- [ restartedMain] c.e.c.Ehcache-com.devapp.domain.Points : Close successful. 
2017-06-14 17:43:03.919 DEBUG 19964 --- [ restartedMain] c.e.c.Ehcache-com.devapp.domain.Weight : Close successful. 
2017-06-14 17:43:03.921 DEBUG 19964 --- [ restartedMain] c.e.c.E.devapp.domain.BloodPressure  : Close successful. 
2017-06-14 17:43:03.923 DEBUG 19964 --- [ restartedMain] c.e.c.E.devapp.domain.Preferences  : Close successful. 
2017-06-14 17:43:03.925 DEBUG 19964 --- [ restartedMain] c.e.c.E.devapp.domain.Authority   : Close successful. 
2017-06-14 17:43:03.930 DEBUG 19964 --- [ restartedMain] c.e.core.Ehcache-com.devapp.domain.User : Close successful. 
2017-06-14 17:43:03.932 DEBUG 19964 --- [ restartedMain] c.e.c.E.devapp.domain.User.authorities : Close successful. 
2017-06-14 17:43:03.994 WARN 19964 --- [ restartedMain] o.s.boot.SpringApplication    : Error handling failed (Error creating bean with name 'delegatingApplicationListener' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.config.internalCacheAdvisor' defined in class path resource [org/springframework/cache/annotation/ProxyCachingConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cache.interceptor.BeanFactoryCacheOperationSourceAdvisor]: Factory method 'cacheAdvisor' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheAutoConfigurationValidator' defined in class path resource [org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.cache-org.springframework.boot.autoconfigure.cache.CacheProperties': Initialization of bean failed; nested exception is java.lang.IllegalStateException: org.springframework.boot[email protected]60ee6558 has not been refreshed yet) 
2017-06-14 17:43:04.016 ERROR 19964 --- [ restartedMain] o.s.boot.SpringApplication    : Application startup failed 

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bloodPressureResource' defined in file [/home/rajeev/Devapp_Maven/target/classes/com/devapp/web/rest/BloodPressureResource.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bloodPressureRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.devapp.repository.BloodPressureRepository.findAllByTimestampBetweenOrderByTimestampDesc(java.time.LocalDate,java.time.LocalDate)! 

由于提前

+0

请格式化代码,提取错误,并尽量精确地描述你的问题。 – flob

回答

0

你的查询中BloodPressureRepositoryfindAllByTimestampBetweenOrderByTimestampDesc是无效的。

那是什么东西被告知该错误至少:

Validation failed for query for method public abstract java.util.List com.devapp.repository.BloodPressureRepository.findAllByTimestampBetweenOrderByTimestampDesc(java.time.LocalDate,java.time.LocalDate)!

+0

我应该如何改变它,没有得到任何其他方法?以及如何修改查询---- \t @Query(“从BloodPressure blood_pressure中选择blood_pressure,其中blood_pressure.manytoone.login =?#{principal.username}由BloodPressure命令。日期递减 “) –

+0

那代码--- 公共接口BloodPressureRepository延伸JpaRepository <血压,龙> { \t // @查询(” 选择从血压* “) \t @Query(” 从血压blood_pressure其中选择blood_pressure blood_pressure。 manytoone.login =?#{principal.username} order by BloodPressure.Date desc“) \t List findAllByTimestampBetweenAndUserLoginOrderByTimestampDesc(LocalDate firstDate,LocalDate secondDate); \t List findAllByTimestampBetweenAndUserLoginOrderByTimestampDesc(LocalDate daysAgo,LocalDate rightNow,String login); } –

+0

如果您要将该代码(正确格式化)添加到您的问题中,有人可能会帮助您。我从来没有使用'@ Query'语法'?#{principal.userName}'但可能不知道如何找到'principal'。也许你需要将它添加到参数中并指定'@Param(“principal”)? – flob