

[Spring
securityチュートリアルの実装](http://terasolunaorg.github.io/guideline/5.3.0.RELEASE/ja/Tutorial/TutorialSecurity.html)を進めており、ログインの機能ができないところで困っています。  
設定環境  
Eclipse Oxygen（pleiades-4.7.0）  
JDK(1.8.0_131)  
Apache Maven 3.5.0  
STS（3.9.0）をeclipse上で接続

データベースはOracleを使用しています。  
pom.xmlの記述修正済み

[code]

    <dependency>
    <groupId>com.oracle.jdbc</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0.4</version>
    <scope>runtime</scope>
    </dependency>
    
[/code]

設定はプロンプトでscott/tigerを操作して  
の中の

CREATE TABLE 操作と  
INSERT INTO 操作  
COMMITを行いました。

現状は、[10.4.4.2.2.
ログインページの作成](http://terasolunaorg.github.io/guideline/5.3.0.RELEASE/ja/Tutorial/TutorialSecurity.html#id38)のところの  
ウェルカムページの表示までいけました。

[![必要事項入力結果](https://i.stack.imgur.com/OG3U7.jpg)](https://i.stack.imgur.com/OG3U7.jpg)

問題点としては、それ以降のアカウント認証とログインができないことにあります。

共通のログとアラートとして  
Account RepositoryクラスのfindOneメソッドの機能や実行事態に問題があるということがでていますが、  
扱うusernameの要素周りの定義については何度か確認しましたが、現状問題はなさそうに見えます。

もう一つの考えられる要因は、  
[10.4.4.1.5.
データベースの初期化スクリプトの設定](http://terasolunaorg.github.io/guideline/5.3.0.RELEASE/ja/Tutorial/TutorialSecurity.html#id34)のところのパスワードのハッシュ化の  
BCryptPasswordEncoderがきちんと機能していないという点にあるのではないかということです。

少し環境も、異なる設定にしていますが、何かアプローチできる点があれば教えていただきたいと思います。

以下フォーム入力時エラー

[code]

    date:2017-10-10 10:13:31    thread:http-bio-8080-exec-6 X-Track:30dc735ee1b14157bd55270b6a1a104d    level:DEBUG logger:o.s.jdbc.datasource.DataSourceTransactionManager message:Creating new transaction with name [com.example.security.domain.service.userdetails.SampleUserDetailsService.loadUserByUsername]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT,readOnly; ''
    date:2017-10-10 10:13:31    thread:http-bio-8080-exec-6 X-Track:30dc735ee1b14157bd55270b6a1a104d    level:DEBUG logger:o.s.jdbc.datasource.DataSourceTransactionManager message:Acquired Connection [net.sf.log4jdbc.ConnectionSpy@a4e56b] for JDBC transaction
    date:2017-10-10 10:13:31    thread:http-bio-8080-exec-6 X-Track:30dc735ee1b14157bd55270b6a1a104d    level:DEBUG logger:o.s.jdbc.datasource.DataSourceTransactionManager message:Participating in existing transaction
    date:2017-10-10 10:13:31    thread:http-bio-8080-exec-6 X-Track:30dc735ee1b14157bd55270b6a1a104d    level:DEBUG logger:o.s.jdbc.datasource.DataSourceTransactionManager message:Participating transaction failed - marking existing transaction as rollback-only
    date:2017-10-10 10:13:31    thread:http-bio-8080-exec-6 X-Track:30dc735ee1b14157bd55270b6a1a104d    level:DEBUG logger:o.s.jdbc.datasource.DataSourceTransactionManager message:Setting JDBC transaction [net.sf.log4jdbc.ConnectionSpy@a4e56b] rollback-only
    date:2017-10-10 10:13:31    thread:http-bio-8080-exec-6 X-Track:30dc735ee1b14157bd55270b6a1a104d    level:DEBUG logger:o.s.jdbc.datasource.DataSourceTransactionManager message:Initiating transaction rollback
    date:2017-10-10 10:13:31    thread:http-bio-8080-exec-6 X-Track:30dc735ee1b14157bd55270b6a1a104d    level:DEBUG logger:o.s.jdbc.datasource.DataSourceTransactionManager message:Rolling back JDBC transaction on Connection [net.sf.log4jdbc.ConnectionSpy@a4e56b]
    date:2017-10-10 10:13:31    thread:http-bio-8080-exec-6 X-Track:30dc735ee1b14157bd55270b6a1a104d    level:DEBUG logger:o.s.jdbc.datasource.DataSourceTransactionManager message:Releasing JDBC Connection [net.sf.log4jdbc.ConnectionSpy@a4e56b] after transaction
    date:2017-10-10 10:13:31    thread:http-bio-8080-exec-6 X-Track:30dc735ee1b14157bd55270b6a1a104d    level:ERROR logger:o.s.s.w.a.UsernamePasswordAuthenticationFilter   message:An internal error occurred while trying to authenticate the user.
    org.springframework.security.authentication.InternalAuthenticationServiceException: Invalid bound statement (not found): com.example.security.domain.repository.account.AccountRepository.findOne
        at org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:126)
        at org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:144)
        at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:174)
        at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:199)
        at org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:94)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:212)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:121)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:124)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.terasoluna.gfw.web.logging.mdc.AbstractMDCPutFilter.doFilterInternal(AbstractMDCPutFilter.java:115)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.terasoluna.gfw.web.exception.ExceptionLoggingFilter.doFilter(ExceptionLoggingFilter.java:99)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.terasoluna.gfw.web.logging.mdc.MDCClearFilter.doFilterInternal(MDCClearFilter.java:50)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:748)
    Caused by: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.example.security.domain.repository.account.AccountRepository.findOne
        at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:230)
        at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:48)
        at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:65)
        at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
        at com.sun.proxy.$Proxy33.findOne(Unknown Source)
        at com.example.security.domain.service.account.AccountSharedServiceImpl.findOne(AccountSharedServiceImpl.java:23)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.terasoluna.gfw.common.exception.ResultMessagesLoggingInterceptor.invoke(ResultMessagesLoggingInterceptor.java:95)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
        at com.sun.proxy.$Proxy36.findOne(Unknown Source)
        at com.example.security.domain.service.userdetails.SampleUserDetailsService.loadUserByUsername(SampleUserDetailsService.java:27)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.terasoluna.gfw.common.exception.ResultMessagesLoggingInterceptor.invoke(ResultMessagesLoggingInterceptor.java:95)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
        at com.sun.proxy.$Proxy37.loadUserByUsername(Unknown Source)
        at org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:114)
        ... 56 common frames omitted
    
[/code]


CC BY-SA 3.0
2017-10-10T02:17:43.730
38555
2017-10-10T02:58:10.270
2017-10-10T02:58:10.270
3060
25002
question
java spring
Spring Securityによる認証・認可の機能の実装でうまく動作しません。