Error querying database. Cause: java.lang.IllegalArgumentException:Failed to decrypt.(错误笔记)...

java.lang.IllegalArgumentException:Failed to decrypt

从错误可以看出,解密失败。

原因是你在数据库连接配置的地方,设置了加密。即:

config.decrypt=true
将其改成:

config.decrypt=false
问题就可以解决。

public-key: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAITOx1pKAT9xh7cfoZqUw6SLjgl/Y44M2XUAw37aRndmku+FSdGp9PXGwJYoeXt/TbxR1DSdd7S2+/s1cUsvvDMCAwEAAQ==
spring:
  http:
    encoding:
      charset: UTF-8
      force: true
      enabled: true
  datasource:
    druid:
      url: jdbc:mysql://localhost:3306/fairchild?useSSL=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
      #        url: jdbc:mysql://192.168.31.196:3306/fairchild?useSSL=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
      username: root
      password: 123456
      driver-class-name: com.mysql.cj.jdbc.Driver
    #  connection-properties: config.decrypt=true;config.decrypt.key=${public-key}
      initial-size: 5
      min-idle: 10
      max-active: 20
      max-wait: 60000
      time-between-eviction-runs-millis: 2000
      min-evictable-idle-time-millis: 60000
      max-evictable-idle-time-millis: 9000000
      test-while-idle: true
      test-on-borrow: false
      test-on-return: false
      validation-query: select 1
      pool-prepared-statements: true
      max-open-prepared-statements: 20
      async-init: true
      stat-view-servlet:
        enabled: true
        url-pattern: /druid/*
        reset-enable: true
        login-username: druid
        login-password: druid
      web-stat-filter:
        enabled: true
        url-pattern: /*
        exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
        session-stat-enable: false
        profile-enable: true
      filter:
        wall:
          enabled: true
          db-type: mysql
        config:
          enabled: true
      aop-patterns: cn.com.coding4fun.*
  jpa:
    show-sql: true
    generate-ddl: false
    hibernate:
      ddl-auto: none
    open-in-view: true
    properties:
      hibernate:
        format_sql: true
        order_updates: true
        order_inserts: true
        jdbc:
          batch_size: 50
          fetch_size: 50
        javax:
          cache:
            provider: org.ehcache.jsr107.EhcacheCachingProvider
            uri: classpath:hibernate-ehcache.xml
            missing_cache_strategy: create
        enable_lazy_load_no_trans: true
        cache:
          use_query_cache: true
          use_second_level_cache: true
          region_prefix: jcache-hibernate
          use_minimal_puts: false
          use_reference_entries: true
          use_structured_entries: false
          auto_evict_collection_cache: false
          hibernate.cache.default_cache_concurrency_strategy: read-only
          region:
            factory_class: jcache
  cache:
    jcache:
      provider: org.ehcache.jsr107.EhcacheCachingProvider
      config: classpath:ehcache.xml
  messages:
    basename: i18n/messages
    encoding: UTF-8
server:
  port: 8081
  tomcat:
    uri-encoding: UTF-8

 

转载于:https://www.cnblogs.com/mzdljgz/p/11175123.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值