apache / shardingsphere

Empowering Data Intelligence with Distributed SQL for Sharding, Scalability, and Security Across All Databases.
Apache License 2.0
19.95k stars 6.74k forks source link

encrypt not work in 4.0.0-RC2-SNAPSHOT version #2866

Closed jukai5501 closed 5 years ago

jukai5501 commented 5 years ago

Bug Report

Which version of ShardingSphere did you use?

4.0.0-RC2-SNAPSHOT

Which project did you use? Sharding-JDBC or Sharding-Proxy?

Sharding-JDBC

Expected behavior

Encrypt fields when inserting and decrypt fields when querying

Actual behavior

Encrypt fields not work when inserting and decrypt fields not work when querying

Reason analyze (If you can)

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

spring: 
  shardingsphere:
    props:
      sql:
        show: true
    datasource:
      names: ds
      ds:
        type: com.zaxxer.hikari.HikariDataSource
        driver-class-name: com.mysql.cj.jdbc.Driver
        jdbc-url: jdbc:mysql://${MYSQL_HOST:localhost}:${MYSQL_PORT:3306}/${MYSQL_DB:test}?serverTimezone=Asia/Shanghai
        username: ${MYSQL_USER:test}
        password: ${MYSQL_PASSWORD:test}
        hikari:
          minimum-idle: 60
          maximum-pool-size: 60
          idle-timeout: 30000
          max-lifetime: 1800000
          connection-timeout: 30000
          pool-name: ExampleHikariCP
          connection-test-query: SELECT 1
    encrypt:
      tables:
        columns:
          encryptor: example_encrypt
          cipherColumn: user_auth.credential
          assistedQueryColumn: user_auth.credential
      encryptors:
        example_encrypt:
          type: aes
          props:
            'aes.key.value': ${SHARDING_ENCRYPTOR_AES_PWD:123456}
    sharding:
      tables:
        party:
          actual-data-nodes: ds.party_$->{0..1}
          key-generator:
            column: party_id
            type: snowflake
          table-strategy:
            inline:
              sharding-column: party_id
              algorithm-expression: party_$->{party_id % 2}
        user_auth:
          key-generator:
            column: user_auth_id
            type: snowflake

Example codes for reproduce this issue (such as a github link).

KomachiSion commented 5 years ago

@jukai5501, I think there are some mistakes in configuration. And I want to make sure some information:

  1. Do you want to encrypt table user_auth column credential?
  2. Is table user_auth a sharding table?
jukai5501 commented 5 years ago

Hi!

  1. Yes, I want to encrypt table user_auth column credential.
  2. Table user_auth is not a sharding table, just use key-generator function.

在 2019年8月14日,09:55,杨翊 Sion Yang notifications@github.com 写道:

@jukai5501 https://github.com/jukai5501, I think there are some mistakes in configuration. And I want to make sure some information:

Do you want to encrypt table user_auth column credential? Is table user_auth a sharding table? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-shardingsphere/issues/2866?email_source=notifications&email_token=AF4QKPEX47VD33YRBC3OG3DQENQZBA5CNFSM4ILKET3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4HO7MA#issuecomment-521072560, or mute the thread https://github.com/notifications/unsubscribe-auth/AF4QKPDIXCV7V3V4JLMF2OLQENQZBANCNFSM4ILKET3A.

KomachiSion commented 5 years ago

Try to use this configuration:

spring: 
  shardingsphere:
    props:
      sql:
        show: true
    datasource:
      names: ds
      ds:
        type: com.zaxxer.hikari.HikariDataSource
        driver-class-name: com.mysql.cj.jdbc.Driver
        jdbc-url: jdbc:mysql://${MYSQL_HOST:localhost}:${MYSQL_PORT:3306}/${MYSQL_DB:test}?serverTimezone=Asia/Shanghai
        username: ${MYSQL_USER:test}
        password: ${MYSQL_PASSWORD:test}
        hikari:
          minimum-idle: 60
          maximum-pool-size: 60
          idle-timeout: 30000
          max-lifetime: 1800000
          connection-timeout: 30000
          pool-name: ExampleHikariCP
          connection-test-query: SELECT 1
    encrypt:
      tables:
        user_auth:
          columns:
            credential:
              encryptor: example_encrypt
              cipherColumn: credential
              assistedQueryColumn: credential_assisted
      encryptors:
        example_encrypt:
          type: aes
          props:
            'aes.key.value': ${SHARDING_ENCRYPTOR_AES_PWD:123456}
    sharding:
      tables:
        party:
          actual-data-nodes: ds.party_$->{0..1}
          key-generator:
            column: party_id
            type: snowflake
          table-strategy:
            inline:
              sharding-column: party_id
              algorithm-expression: party_$->{party_id % 2}
jukai5501 commented 5 years ago

Hi!

This configuration did not work.

Failed to bind properties under 'spring.shardingsphere.encrypt.tables.userauth.columns.encryptor' to org.apache.shardingsphere.core.yaml.config.encrypt.YamlEncryptColumnRuleConfiguration:

Property: spring.shardingsphere.encrypt.tables.userauth.columns.encryptor Value: example_encrypt Origin: class path resource [application.yml]:64:24 Reason: No converter found capable of converting from type [java.lang.String] to type [org.apache.shardingsphere.core.yaml.config.encrypt.YamlEncryptColumnRuleConfiguration]

在 2019年8月14日,10:35,杨翊 Sion Yang notifications@github.com 写道:

Try to use this configuration:

spring: shardingsphere: props: sql: show: true datasource: names: ds ds: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.cj.jdbc.Driver jdbc-url: jdbc:mysql://${MYSQL_HOST:localhost}:${MYSQL_PORT:3306}/${MYSQL_DB:test}?serverTimezone=Asia/Shanghai username: ${MYSQL_USER:test} password: ${MYSQL_PASSWORD:test} hikari: minimum-idle: 60 maximum-pool-size: 60 idle-timeout: 30000 max-lifetime: 1800000 connection-timeout: 30000 pool-name: ExampleHikariCP connection-test-query: SELECT 1 encrypt: tables: user_auth: columns: credential: encryptor: example_encrypt cipherColumn: credential assistedQueryColumn: credential_assisted encryptors: example_encrypt: type: aes props: 'aes.key.value': ${SHARDING_ENCRYPTOR_AESPWD:123456} sharding: tables: party: actual-data-nodes: ds.party$->{0..1} key-generator: column: party_id type: snowflake table-strategy: inline: sharding-column: partyid algorithm-expression: party$->{party_id % 2} — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-shardingsphere/issues/2866?email_source=notifications&email_token=AF4QKPHY44LOVLGVD5MQLFLQENVP3A5CNFSM4ILKET3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4HQVGY#issuecomment-521079451, or mute the thread https://github.com/notifications/unsubscribe-auth/AF4QKPANZPIC7ALYDBW2HWLQENVP3ANCNFSM4ILKET3A.

KomachiSion commented 5 years ago

Are you using the latest 4.0.0-RC2-SNAPSHOT?

I execute the configuration without exception:

spring:
  shardingsphere:
    datasource:
      names: ds
      ds:
        type: com.zaxxer.hikari.HikariDataSource
        driver-class-name: com.mysql.jdbc.Driver
        jdbc-url: jdbc:mysql://localhost:3306/demo_ds?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false
        username: root
        password:

    sharding:
      default-data-source-name: ds
      tables:
        party:
          actual-data-nodes: ds.party_$->{0..1}
          table-strategy:
            inline:
              sharding-column: party_id
              algorithm-expression: party_$->{party_id % 2}
          key-generator:
            column: party_id
            type: SNOWFLAKE
            props:
              worker.id: 1
              max.tolerate.time.difference.milliseconds: 100
    encrypt:
      tables:
        user_auth:
          columns:
            credential:
              encryptor: example_encrypt
              cipherColumn: credential
              assistedQueryColumn: credential
      encryptors:
        example_encrypt:
          type: aes
          props:
            'aes.key.value': 123456

    props:
      sql.show: true
jukai5501 commented 5 years ago

Sorry, i am not using the latest 4.0.0-RC2-SNAPSHOT. I will pull the latest 4.0.0-RC2-SNAPSHOT branch and try it again.

------------------ 原始邮件 ------------------ 发件人: "杨翊 Sion Yang"notifications@github.com; 发送时间: 2019年8月14日(星期三) 中午11:06 收件人: "apache/incubator-shardingsphere"incubator-shardingsphere@noreply.github.com; 抄送: "Huangyongjun"305981646@qq.com;"Mention"mention@noreply.github.com; 主题: Re: [apache/incubator-shardingsphere] encrypt not work in4.0.0-RC2-SNAPSHOT version (#2866)

Are you using the latest 4.0.0-RC2-SNAPSHOT?

I execute the configuration without exception: spring: shardingsphere: datasource: names: ds ds: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver jdbc-url: jdbc:mysql://localhost:3306/demods?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false username: root password: sharding: default-data-source-name: ds tables: party: actual-data-nodes: ds.party$->{0..1} table-strategy: inline: sharding-column: partyid algorithm-expression: party$->{party_id % 2} key-generator: column: party_id type: SNOWFLAKE props: worker.id: 1 max.tolerate.time.difference.milliseconds: 100 encrypt: tables: user_auth: columns: credential: encryptor: example_encrypt cipherColumn: credential assistedQueryColumn: credential encryptors: example_encrypt: type: aes props: 'aes.key.value': 123456 props: sql.show: true
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

jukai5501 commented 5 years ago

Hi!

I pulled the latest 4.0.0-RC2-SNAPSHOT version. The application can start normally, I was using your configuration, but the logs printed like this.

```

2019-08-14 22:29:27.376 INFO 39486 --- [ main] o.a.s.core.util.ConfigurationLogger : EncryptRuleConfiguration 
encryptors: 
  example_encrypt: 
        props: aes.key.value: 123456
        type: aes 
    tables: 
      user_auth: 
        columns: 
          credential: 
            assistedQueryColumn: credential 
            cipherColumn: credential 
            encryptor: example_encrypt 
     2019-08-14 22:29:27.377 INFO 39486 --- [ main] o.a.s.core.util.ConfigurationLogger : Properties 
     sql.show: ‘true'

```

Then there are not printing sharding configuration, but I configure them. 
So sharding does not work when i call the query or save interface.

```
2019-08-14 22:30:47.712 INFO 39486 --- [ XNIO-1 task-1] ShardingSphere-SQL : SQL: insert into party (party_nickname, party_nickname_spelling, sex, birthday, personal_profile, status_cd, create_dt, update_dt, status_dt) values (?, ?, ?, ?, ?, ?, ?, ?, ?)        2019-08-14 22:30:47.798 ERROR 39486 --- [ XNIO-1 task-1] c.h.g.s.c.s.a.m.e.GlobalExceptionHandler : Internal exception: org.springframework.dao.DataIntegrityViolationException: ### Error updating database. Cause: java.sql.SQLException: Field 'party_id' doesn't have a default value

```

在 2019年8月14日,11:06,杨翊 Sion Yang notifications@github.com 写道:

Are you using the latest 4.0.0-RC2-SNAPSHOT?

I execute the configuration without exception:

spring: shardingsphere: datasource: names: ds ds: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver jdbc-url: jdbc:mysql://localhost:3306/demo_ds?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false username: root password:

sharding:
  default-data-source-name: ds
  tables:
    party:
      actual-data-nodes: ds.party_$->{0..1}
      table-strategy:
        inline:
          sharding-column: party_id
          algorithm-expression: party_$->{party_id % 2}
      key-generator:
        column: party_id
        type: SNOWFLAKE
        props:
          worker.id: 1
          max.tolerate.time.difference.milliseconds: 100
encrypt:
  tables:
    user_auth:
      columns:
        credential:
          encryptor: example_encrypt
          cipherColumn: credential
          assistedQueryColumn: credential
  encryptors:
    example_encrypt:
      type: aes
      props:
        'aes.key.value': 123456

props:
  sql.show: true

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-shardingsphere/issues/2866?email_source=notifications&email_token=AF4QKPFF4RFSOD7T7CWW6O3QENZDXA5CNFSM4ILKET3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4HR6MY#issuecomment-521084723, or mute the thread https://github.com/notifications/unsubscribe-auth/AF4QKPEBEWB7VGPOWQ27GELQENZDXANCNFSM4ILKET3A.

jukai5501 commented 5 years ago

Hi!

Yes, I set party_id as key_generator. This is my configuration.
spring:
  shardingsphere:
    props:
      sql:
        show: true
    datasource:
      names: ds
      ds:
        type: com.zaxxer.hikari.HikariDataSource
        driver-class-name: com.mysql.cj.jdbc.Driver
        jdbc-url: jdbc:mysql://${MYSQL_HOST:localhost}:${MYSQL_PORT:3306}/${MYSQL_DB:test}?serverTimezone=Asia/Shanghai
        username: ${MYSQL_USER:test}
        password: ${MYSQL_PASSWORD:test}
        hikari:
          minimum-idle: 60
          maximum-pool-size: 60
          idle-timeout: 30000
          max-lifetime: 1800000
          connection-timeout: 30000
          pool-name: ExampleHikariCP
          connection-test-query: SELECT 1
    encrypt:
      tables:
        user_auth:
          columns:
            credential:
              encryptor: example_encrypt
              cipherColumn: credential
              assistedQueryColumn: credential
      encryptors:
        example_encrypt:
          type: aes
          props:
            'aes.key.value': 123456
    sharding:
      default-data-source-name: ds
      tables:
        party:
          actual-data-nodes: ds.party_$->{0..1}
          key-generator:
            column: party_id
            type: snowflake
          table-strategy:
            inline:
              sharding-column: party_id
              algorithm-expression: party_$->{party_id % 2}

在 2019年8月15日,08:51,杨翊 Sion Yang notifications@github.com 写道:

Do you set party_id as key_generator? It looks like configuration error for key-generator

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-shardingsphere/issues/2866?email_source=notifications&email_token=AF4QKPC4GD5EJVDL367XGALQESSAPA5CNFSM4ILKET3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4KQTOI#issuecomment-521472441, or mute the thread https://github.com/notifications/unsubscribe-auth/AF4QKPE2KR2J5NYVISMVVUTQESSAPANCNFSM4ILKET3A.

KomachiSion commented 5 years ago

Please change to this configuration and retry.

spring:
  shardingsphere:
    datasource:
      names: ds
      ds:
        type: com.zaxxer.hikari.HikariDataSource
        driver-class-name: com.mysql.jdbc.Driver
        jdbc-url: jdbc:mysql://localhost:3306/demo_ds?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false
        username: root
        password:

    sharding:
      default-data-source-name: ds
      tables:
        party:
          actual-data-nodes: ds.party_$->{0..1}
          table-strategy:
            inline:
              sharding-column: party_id
              algorithm-expression: party_$->{party_id % 2}
          key-generator:
            column: party_id
            type: SNOWFLAKE
            props:
              worker.id: 1
              max.tolerate.time.difference.milliseconds: 100
      encrypt-rule:
        tables:
          user_auth:
            columns:
              credential:
                encryptor: example_encrypt
                cipherColumn: credential
                assistedQueryColumn: credential
        encryptors:
          example_encrypt:
            type: aes
            props:
              'aes.key.value': 123456

    props:
      sql.show: true
jukai5501 commented 5 years ago

Hi!

I was using your configuration. Error reporting at runtime.

The credential field that need to be encrypted are filled twice.
2019-08-15 15:52:54.808  INFO 59557 --- [  XNIO-1 task-2] ShardingSphere-SQL                       : Actual SQL: ds ::: insert into user_auth (party_id, identity_type,
                                           identifier, credential,
                                           status_cd, create_dt,
                                           update_dt, status_dt, user_auth_id, credential)
        values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ::: [368788267685908481, mobile_phone, 13600825279, jmByToo/lVb3XosBJNiK9dK1RufS2XrYs75OeFUiMDM=, 00000, 2019-08-15 15:52:54.727, 2019-08-15 15:52:54.727, 2019-08-15 15:52:54.727, 368788267820122113, 12345]
2019-08-15 15:52:54.915 ERROR 59557 --- [  XNIO-1 task-2] c.h.g.s.c.s.a.m.e.GlobalExceptionHandler : Internal exception:

org.springframework.jdbc.BadSqlGrammarException: 
### Error updating database.  Cause: java.sql.SQLSyntaxErrorException: Column 'credential' specified twice
### The error may exist in file [/Users/huangyongjun/Documents/MyJobs/HuangCao/codes/java-codes/hc-example-projects/microservice/1.0.x/example-microservice/example-party/example-party-provider/target/classes/com/huangcao/microservice/example/provider/party/service/dao/IUserAuthDAO.xml]
### The error may involve com.huangcao.microservice.example.provider.party.service.dao.IUserAuthDAO.insertUserAuth-Inline
### The error occurred while setting parameters
### SQL: insert into user_auth (party_id, identity_type,                                            identifier, credential,                                            status_cd, create_dt,                                            update_dt, status_dt)         values (?, ?,                      ?, ?,                      ?, ?,                      ?, ?)
### Cause: java.sql.SQLSyntaxErrorException: Column 'credential' specified twice
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Column 'credential' specified twice
    at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:93)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
    at com.sun.proxy.$Proxy115.insert(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
    at com.sun.proxy.$Proxy117.insertUserAuth(Unknown Source)
    at com.huangcao.microservice.example.provider.party.service.smo.PartySMOImpl.savePartyInfo(PartySMOImpl.java:60)
    at com.huangcao.microservice.example.provider.party.service.smo.PartySMOImpl$$FastClassBySpringCGLIB$$ea5f1222.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
    at com.huangcao.microservice.example.provider.party.service.smo.PartySMOImpl$$EnhancerBySpringCGLIB$$3b9e5344.savePartyInfo(<generated>)
    at com.huangcao.microservice.example.provider.party.service.controller.PartyController.savePartyInfo(PartyController.java:34)
    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.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:665)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
    at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
    at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:88)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:215)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter.doFilterInternal(DefaultLogoutPageGeneratingFilter.java:52)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:206)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:100)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:74)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:114)
    at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:104)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at com.huangcao.gcommons.springframework.configuration.springboot.autoconfigure.web.servlet.filter.ias.OAuthFilter.doFilter(OAuthFilter.java:42)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
    at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
    at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
    at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78)
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99)
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376)
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLSyntaxErrorException: Column 'credential' specified twice
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
    at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:970)
    at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:387)
    at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
    at org.apache.shardingsphere.shardingjdbc.executor.SQLExecuteCallbackFactory$2.executeSQL(SQLExecuteCallbackFactory.java:65)
    at org.apache.shardingsphere.shardingjdbc.executor.SQLExecuteCallbackFactory$2.executeSQL(SQLExecuteCallbackFactory.java:61)
    at org.apache.shardingsphere.core.execute.sql.execute.SQLExecuteCallback.execute0(SQLExecuteCallback.java:68)
    at org.apache.shardingsphere.core.execute.sql.execute.SQLExecuteCallback.execute(SQLExecuteCallback.java:57)
    at org.apache.shardingsphere.core.execute.ShardingExecuteEngine.syncGroupExecute(ShardingExecuteEngine.java:125)
    at org.apache.shardingsphere.core.execute.ShardingExecuteEngine.serialExecute(ShardingExecuteEngine.java:90)
    at org.apache.shardingsphere.core.execute.ShardingExecuteEngine.groupExecute(ShardingExecuteEngine.java:83)
    at org.apache.shardingsphere.core.execute.sql.execute.SQLExecuteTemplate.executeGroup(SQLExecuteTemplate.java:73)
    at org.apache.shardingsphere.core.execute.sql.execute.SQLExecuteTemplate.executeGroup(SQLExecuteTemplate.java:56)
    at org.apache.shardingsphere.shardingjdbc.executor.AbstractStatementExecutor.executeCallback(AbstractStatementExecutor.java:132)
    at org.apache.shardingsphere.shardingjdbc.executor.PreparedStatementExecutor.execute(PreparedStatementExecutor.java:156)
    at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.execute(ShardingPreparedStatement.java:172)
    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.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
    at com.sun.proxy.$Proxy172.execute(Unknown Source)
    at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
    at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
    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.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
    at com.sun.proxy.$Proxy171.update(Unknown Source)
    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.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
    at com.sun.proxy.$Proxy171.update(Unknown Source)
    at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
    at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
    at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
    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.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
    at com.sun.proxy.$Proxy170.update(Unknown Source)
    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.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)
    at com.huangcao.gdata.mybatis.plugin.UpdateWithCachePlugin.intercept(UpdateWithCachePlugin.java:53)
    at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
    at com.sun.proxy.$Proxy170.update(Unknown Source)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
    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.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
    ... 135 common frames omitted

在 2019年8月15日,15:36,杨翊 Sion Yang notifications@github.com 写道:

Please change to this configuration and retry.

spring: shardingsphere: datasource: names: ds ds: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.jdbc.Driver jdbc-url: jdbc:mysql://localhost:3306/demo_ds?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false username: root password:

sharding:
  default-data-source-name: ds
  tables:
    party:
      actual-data-nodes: ds.party_$->{0..1}
      table-strategy:
        inline:
          sharding-column: party_id
          algorithm-expression: party_$->{party_id % 2}
      key-generator:
        column: party_id
        type: SNOWFLAKE
        props:
          worker.id: 1
          max.tolerate.time.difference.milliseconds: 100
  encrypt-rule:
    tables:
      user_auth:
        columns:
          credential:
            encryptor: example_encrypt
            cipherColumn: credential
            assistedQueryColumn: credential
    encryptors:
      example_encrypt:
        type: aes
        props:
          'aes.key.value': 123456

props:
  sql.show: true

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-shardingsphere/issues/2866?email_source=notifications&email_token=AF4QKPDAF2EK5VGJHQOUVV3QEUBQDA5CNFSM4ILKET3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4LCWTI#issuecomment-521546573, or mute the thread https://github.com/notifications/unsubscribe-auth/AF4QKPDXU54A4R76EGWSOMTQEUBQDANCNFSM4ILKET3A.

KomachiSion commented 5 years ago

@jukai5501, you need to change some config according to your environment, do not copy my configuration, cipherColumn and assistedQueryColumn should be two column in table, I don't know your table structure so I use same column as simple.

jukai5501 commented 5 years ago

Hi! I implemented the ShardingQueryAssistedEncryptor interface. I want to encrypt credential field when I save it and decrypt credential field when I query it.

在 2019年8月15日,16:18,杨翊 Sion Yang notifications@github.com 写道:

@jukai5501 https://github.com/jukai5501, you need to change some config, do not copy my configuration, cipherColumn and assistedQueryColumn should be two column in table, I don't know your table structure so I use same column as simple.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-shardingsphere/issues/2866?email_source=notifications&email_token=AF4QKPCZK7FTGLWUQBEPC7DQEUGOBA5CNFSM4ILKET3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4LFJ6Q#issuecomment-521557242, or mute the thread https://github.com/notifications/unsubscribe-auth/AF4QKPFTHGZZIZV3GVVFFA3QEUGOBANCNFSM4ILKET3A.

KomachiSion commented 5 years ago

Remove assistedQueryColumn and retry

jukai5501 commented 5 years ago

Hi!

I removed assistedQueryColumn configuration. Error reporting at runtime.
2019-08-15 16:35:36.898 ERROR 61204 --- [  XNIO-1 task-1] c.h.g.s.c.s.a.m.e.GlobalExceptionHandler : Internal exception:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: java.lang.IllegalArgumentException: Can not find assisted query Column Name
### The error may exist in file [/Users/huangyongjun/Documents/MyJobs/HuangCao/codes/java-codes/hc-example-projects/microservice/1.0.x/example-microservice/example-party/example-party-provider/target/classes/com/huangcao/microservice/example/provider/party/service/dao/IUserAuthDAO.xml]
### The error may involve com.huangcao.microservice.example.provider.party.service.dao.IUserAuthDAO.insertUserAuth-Inline
### The error occurred while setting parameters
### SQL: insert into user_auth (party_id, identity_type,                                            identifier, credential,                                            status_cd, create_dt,                                            update_dt, status_dt)         values (?, ?,                      ?, ?,                      ?, ?,                      ?, ?)
### Cause: java.lang.IllegalArgumentException: Can not find assisted query Column Name
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
    at com.sun.proxy.$Proxy115.insert(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)
    at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
    at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
    at com.sun.proxy.$Proxy117.insertUserAuth(Unknown Source)
    at com.huangcao.microservice.example.provider.party.service.smo.PartySMOImpl.savePartyInfo(PartySMOImpl.java:60)
    at com.huangcao.microservice.example.provider.party.service.smo.PartySMOImpl$$FastClassBySpringCGLIB$$ea5f1222.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
    at com.huangcao.microservice.example.provider.party.service.smo.PartySMOImpl$$EnhancerBySpringCGLIB$$8c1621.savePartyInfo(<generated>)
    at com.huangcao.microservice.example.provider.party.service.controller.PartyController.savePartyInfo(PartyController.java:34)
    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.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:665)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
    at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
    at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:88)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:215)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter.doFilterInternal(DefaultLogoutPageGeneratingFilter.java:52)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:206)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:100)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:74)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:114)
    at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:104)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at com.huangcao.gcommons.springframework.configuration.springboot.autoconfigure.web.servlet.filter.ias.OAuthFilter.doFilter(OAuthFilter.java:42)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
    at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
    at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
    at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78)
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99)
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376)
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

在 2019年8月15日,16:33,杨翊 Sion Yang notifications@github.com 写道:

Remove assistedQueryColumn and retry

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-shardingsphere/issues/2866?email_source=notifications&email_token=AF4QKPDQBURP3EU6KQWQQCTQEUIFRA5CNFSM4ILKET3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4LGJUQ#issuecomment-521561298, or mute the thread https://github.com/notifications/unsubscribe-auth/AF4QKPG6EBDSJETPJSYMLYLQEUIFRANCNFSM4ILKET3A.

jukai5501 commented 5 years ago

Hi!

It is OK now, I forgot remove the ShardingQueryAssistedEncryptor conf.

在 2019年8月15日,16:33,杨翊 Sion Yang <notifications@github.com mailto:notifications@github.com> 写道:

Remove assistedQueryColumn and retry

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-shardingsphere/issues/2866?email_source=notifications&email_token=AF4QKPDQBURP3EU6KQWQQCTQEUIFRA5CNFSM4ILKET3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4LGJUQ#issuecomment-521561298, or mute the thread https://github.com/notifications/unsubscribe-auth/AF4QKPG6EBDSJETPJSYMLYLQEUIFRANCNFSM4ILKET3A.