2016-10-25 10 views
0

ライブラリのバージョンに苦しんだ後、私は固執しています。 A similar questionは、3歳で、私は多くの新しいバージョンのものを使用しており、Optional<>について不平を言っているので、適用されていないようです。私のGradleファイル:https://github.com/JetForMe/spring-hoa/blob/master/build.gradle?ts=4メソッドのクエリーメタモデルを作成できませんでした。public abstract java.util.Optional

public 
interface 
UserRepository 
    extends JpaRepository<User, Long> 
{ 
    Optional<User>    findByLogin(String inLogin); 
} 

エンティティ

@Entity public class User 
{ 
    public 
    User(String inLogin, String inClearPassword) 
    { 
     mLogin = inLogin; 
     mEncryptedPassword = inClearPassword;  // TODO 
    } 

    public Long   getId()      { return mId; } 
    public String   getLogin()     { return mLogin; } 

    @Id 
    @GeneratedValue 
    private Long     mId; 

    @JsonIgnore 
    public String     mEncryptedPassword; 
    public String     mLogin; 
} 

全ログ用:

$ gradle bootRun 
:compileJava UP-TO-DATE 
:processResources UP-TO-DATE 
:classes UP-TO-DATE 
:findMainClass 
:bootRun 
Oct 25, 2016 4:10:55 AM com.latencyzero.hoa.Application main 
INFO: Launched! 
Oct 25, 2016 4:10:56 AM com.latencyzero.hoa.Application main 
INFO: Launched! 
2016-10-25 04:10:56.857 INFO 1142 --- [ restartedMain] s.c.a.AnnotationConfigApplicationContext : Refreshing org.spring[email protected]62419c38: startup date [Tue Oct 25 04:10:56 PDT 2016]; root of context hierarchy 
2016-10-25 04:10:57.125 INFO 1142 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$a730500e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 

    . ____   _   __ _ _ 
/\\/___'_ __ _ _(_)_ __ __ _ \ \ \ \ 
(()\___ | '_ | '_| | '_ \/ _` | \ \ \ \ 
\\/ ___)| |_)| | | | | || (_| | )))) 
    ' |____| .__|_| |_|_| |_\__, |//// 
=========|_|==============|___/=/_/_/_/ 
:: Spring Boot ::  (v1.4.1.RELEASE) 

2016-10-25 04:10:57.334 INFO 1142 --- [ restartedMain] com.latencyzero.hoa.Application   : No active profile set, falling back to default profiles: default 
2016-10-25 04:10:57.343 INFO 1142 --- [ restartedMain] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot[email protected]1b543bc9: startup date [Tue Oct 25 04:10:57 PDT 2016]; parent: org.spring[email protected]62419c38 
2016-10-25 04:10:58.512 INFO 1142 --- [ restartedMain] o.s.b.f.s.DefaultListableBeanFactory  : Overriding bean definition for bean 'ignoredPathsWebSecurityConfigurerAdapter' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.security.SpringBootWebSecurityConfiguration; factoryMethodName=ignoredPathsWebSecurityConfigurerAdapter; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.actuate.autoconfigure.ManagementWebSecurityAutoConfiguration; factoryMethodName=ignoredPathsWebSecurityConfigurerAdapter; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/actuate/autoconfigure/ManagementWebSecurityAutoConfiguration.class]] 
2016-10-25 04:10:58.691 INFO 1142 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode! 
2016-10-25 04:10:58.761 INFO 1142 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode! 
2016-10-25 04:10:58.766 INFO 1142 --- [ restartedMain] .RepositoryConfigurationExtensionSupport : Spring Data MongoDB - Could not safely identify store assignment for repository candidate interface com.latencyzero.hoa.UserRepository. 
2016-10-25 04:10:58.847 WARN 1142 --- [ restartedMain] o.s.c.a.ConfigurationClassPostProcessor : Cannot enhance @Configuration bean definition 'refreshScope' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'. 
2016-10-25 04:10:59.062 INFO 1142 --- [ restartedMain] o.s.cloud.context.scope.GenericScope  : BeanFactory id=f74c8b81-5f49-333e-bb6b-335bfdc05d6d 
2016-10-25 04:10:59.181 INFO 1142 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$8b164d11] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
2016-10-25 04:10:59.226 INFO 1142 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$a730500e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
2016-10-25 04:10:59.740 INFO 1142 --- [ restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http) 
2016-10-25 04:10:59.757 INFO 1142 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service Tomcat 
2016-10-25 04:10:59.759 INFO 1142 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.5 
2016-10-25 04:10:59.860 INFO 1142 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]  : Initializing Spring embedded WebApplicationContext 
2016-10-25 04:10:59.860 INFO 1142 --- [ost-startStop-1] o.s.web.context.ContextLoader   : Root WebApplicationContext: initialization completed in 2517 ms 
2016-10-25 04:11:00.203 INFO 1142 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'metricsFilter' to: [/*] 
2016-10-25 04:11:00.204 INFO 1142 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*] 
2016-10-25 04:11:00.204 INFO 1142 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*] 
2016-10-25 04:11:00.204 INFO 1142 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*] 
2016-10-25 04:11:00.204 INFO 1142 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*] 
2016-10-25 04:11:00.206 INFO 1142 --- [ost-startStop-1] .s.DelegatingFilterProxyRegistrationBean : Mapping filter: 'springSecurityFilterChain' to: [/*] 
2016-10-25 04:11:00.206 INFO 1142 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'webRequestLoggingFilter' to: [/*] 
2016-10-25 04:11:00.206 INFO 1142 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'applicationContextIdFilter' to: [/*] 
2016-10-25 04:11:00.206 INFO 1142 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/] 
2016-10-25 04:11:00.208 INFO 1142 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'webServlet' to [/h2-console/*] 
2016-10-25 04:11:00.666 INFO 1142 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default' 
2016-10-25 04:11:00.680 INFO 1142 --- [ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [ 
    name: default 
    ...] 
2016-10-25 04:11:00.747 INFO 1142 --- [ restartedMain] org.hibernate.Version     : HHH000412: Hibernate Core {5.0.11.Final} 
2016-10-25 04:11:00.748 INFO 1142 --- [ restartedMain] org.hibernate.cfg.Environment   : HHH000206: hibernate.properties not found 
2016-10-25 04:11:00.750 INFO 1142 --- [ restartedMain] org.hibernate.cfg.Environment   : HHH000021: Bytecode provider name : javassist 
2016-10-25 04:11:00.787 INFO 1142 --- [ restartedMain] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final} 
2016-10-25 04:11:00.986 INFO 1142 --- [ restartedMain] org.hibernate.dialect.Dialect   : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect 
2016-10-25 04:11:01.309 INFO 1142 --- [ restartedMain] org.hibernate.tuple.PojoInstantiator  : HHH000182: No default (no-argument) constructor for class: com.latencyzero.hoa.User (class must be instantiated by Interceptor) 
2016-10-25 04:11:01.385 INFO 1142 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000227: Running hbm2ddl schema export 
2016-10-25 04:11:01.393 INFO 1142 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000230: Schema export complete 
2016-10-25 04:11:01.434 INFO 1142 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 
2016-10-25 04:11:01.675 WARN 1142 --- [ restartedMain] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController' defined in file [/Users/rmann/Projects/HOA/spring-hoa/build/classes/main/com/latencyzero/hoa/UserController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Could not create query metamodel for method public abstract java.util.Optional com.latencyzero.hoa.UserRepository.findByLogin(java.lang.String)! 
2016-10-25 04:11:01.675 INFO 1142 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 
2016-10-25 04:11:01.675 INFO 1142 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000227: Running hbm2ddl schema export 
2016-10-25 04:11:01.678 INFO 1142 --- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000230: Schema export complete 
2016-10-25 04:11:01.682 INFO 1142 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service Tomcat 
2016-10-25 04:11:01.705 INFO 1142 --- [ restartedMain] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 
2016-10-25 04:11:01.729 ERROR 1142 --- [ restartedMain] o.s.boot.SpringApplication    : Application startup failed 

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController' defined in file [/Users/rmann/Projects/HOA/spring-hoa/build/classes/main/com/latencyzero/hoa/UserController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Could not create query metamodel for method public abstract java.util.Optional com.latencyzero.hoa.UserRepository.findByLogin(java.lang.String)! 
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1148) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1051) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeay.java:306) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:751) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
    at com.latencyzero.hoa.Application.main(Application.java:46) [main/:na] 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45] 
    at lect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45] 
    at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45] 
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.4.1.RELEASE.jar:1.4.1.RELEASE] 
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Could not create query metamodel for method public abstract java.util.Optional com.latencyzero.hoa.UserRepository.findByLogin(java.lang.String)! 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DepDescriptor.java:207) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1128) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1056) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    ... 24 common frames omitted 
Caused by: java.lang.IllegalArgumentException: Could not create query metamodel for method public abstract java.util.Optional com.latencyzero.hoa.UserRepository.findByLogin(java.lang.String)! 
    at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:106) ~[spring-data-jpa-1.10.4.RELEASE.jar:na] 
    at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:214) ~[spring-data-jpa-1.10.4.RELEASE.jar:na] 
    at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:77) ~[spring-data-jpa-1.10.4.RELEASE.jar:na] 
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:435) ~[spring-data-commons-1.12.3.RELEASE.jar:na] 
    at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:220) ~[spring-data-commons-1.12.3.RELEASE.jar:na] 
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport66) ~[spring-data-commons-1.12.3.RELEASE.jar:na] 
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:252) ~[spring-data-commons-1.12.3.RELEASE.jar:na] 
    at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:92) ~[spring-data-jpa-1.10.4.RELEASE.jar:na] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] 
    ... 35 common frames omitted 
Caused by: java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [login] on this ManagedType [com.latencyzero.hoa.User] 
    at org.hibernate.jpa.internal.metamodel.AbstractManagedType.checkNotNull(AbstractManagedType.java:128) ~[hibernate-entitymanager-5.0.11.Final.jar:5.0.11.Final] 
    at org.hibernate.jpa.internal.metamodel.AbstractManagedType.getAttribute(AbstractManagedType.java:113) ~[hibernate-entitymanager-5.0.11.Final.jar:5.0.11.Final] 
    at org.springframework.data.jpa.repository.query.QueryUtils.toExpressionRecursively(QueryUtils.java:566) ~[spring-data-jpa-1.10.4.RELEASE.jar:na] 
    at org.springframework.data.jpa.repository.query.JpaQueryCreator$PredicateBuilder.getTypedPath(JpaQueryCreator.java:334) ~[spring-data-jpa-1.10.4.RELEASE.jar:na] 
    at org.springframework.data.jpa.repository.query.JpaQueryCreator$PredicateBuilder.build(JpaQueryCreator.java:277) ~[spring-data-jpa-1.10.4.RELEASE.jar:na] 
    at org.springframework.data.jpa.repository.query.JpaQueryCreator.toPredicate(JpaQueryCreator.java:182) ~[spring-data-jpa-1.10.4.RELEASE.jar:na] 
    at org.springframework.data.jpa.repository.query.JpaQueryCreator.create(JpaQueryCreator.java:109) ~[spring-data-jpa-1.10.4.RELEASE.jar:na] 
    org.springframework.data.jpa.repository.query.JpaQueryCreator.create(JpaQueryCreator.java:49) ~[spring-data-jpa-1.10.4.RELEASE.jar:na] 
    at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:109) ~[spring-data-commons-1.12.3.RELEASE.jar:na] 
    at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:88) ~[spring-data-commons-1.12.3.RELEASE.jar:na] 
    at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:73) ~[spring-data-commons-1.12.3.RELEASE.jar:na] 
    at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$QueryPreparer.<init>(PartTreeJpaQuery.java:118) ~[spring-data-jpa-1.10.4.RELEASE.jar:na] 
    at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$CountQueryPreparer.<init>(PartTreeJpaQuery.java:241) ~[spring-data-jpa-1.10.4.RELEASE.jar:na] 
    at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:68) ~[spring-data-jpa-1.10.4.RELEASE.jar:na] 
    at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:103) ~[spring-data-jpa-1.10.4.RELEASE.jar:na] 
    ... 44 common frames omitted 


BUILD SUCCESSFUL 

Total time: 12.328 secs 
+0

グラデルビルドから 'javax.persistence'と' spring-data-jpa'依存関係を削除してください。それらはすでに 'spring-boot-startter-data-jpa'によって管理されています。 –

+0

**パスワードを暗号化しない**(または平文で保存する)、攻撃者がDBを取得したときに暗号化キーも取得します。約100msの間、ランダムな塩でHMACを繰り返し、塩をハッシュで保存します。 password_hash、PBKDF2、Bcryptなどの関数を使用します。要点は、攻撃者が無差別にパスワードを見つけるのに多くの時間を費やすことです。 – zaph

+0

次に、 'login'という名前のフィールドがなく、' mLogin'という名前のフィールドがあります。したがって、あなたの 'findBy'メソッドは' findByLogin'の代わりに 'findByMLogin'を読み込むか、あなたのエンティティのフィールドの名前を変更するべきです。 –

答えて

2

はfindByMLoginとメソッドのfindByLoginの名前を置き換えます。ここで使用されるパターンはfindByXXXです。XXXはメンバーフィールドの名前です。

+0

ブックマークのチュートリアルでは '@ Column'を使用していないので、私はそれについて何が欠けているか知りたいと思います。 – Rick

+1

そうです。おそらくfindByMLoginは動作しますか? '指定された名前の属性を見つけることができません[ログイン] ' – Ruddy

+0

@Ruddy、ありがとうございました。それはコンパイルされ、実行され、 "MongoSocketOpenException:例外オープンソケット"(おそらく大したことはない)について文句を言う。しかし、今ではすべてのリクエストに基本的な認証のチャレンジがあり、何を入れるべきかわからないので失敗します。もし私がそれを理解できなければ、私は新しい質問をするでしょう。 – Rick

0

私は問題がspring-data-jpaバージョンにあると思います。 Optional<>を使用するには、1.6.0.RELEASE以降を使用する必要があります。これをチェックしてくださいchangelog

+0

私は現在 '1.10.4.RELEASE'を使っていますので、それは問題ではないと思います。 – Rick

関連する問題