English 中文(简体)
JDBC 驱动器驱动器例外问题正在键盘服务中出现
原标题:JDBC driver Exception issue is coming in keycloak service

我试图用外部 Mysql 数据库 - 8 版本来配置我的键盘 Clloak-18 正在掌舵图上运行的密钥 。

这是我的掌舵图表文件

值.yaml 文件

image:
  repository: quay.io/keycloak/keycloak
  pullPolicy: IfNotPresent
  # Overrides the image tag whose default is the chart appVersion.
  tag: "18.0.0"
  args: ["start-dev"
       ,"--log-console-color=true"
       ,"--db=mysql"
       ,"--db-username=****"
       ,"--db-password=*****"
       ,"--db-url=jdbc:mysql://194.148.0.57/keycloakblockchain"
      ]

< 强力 > 部署文件

- name: {{ .Chart.Name }}
          securityContext:
            {{- toYaml .Values.securityContext | nindent 12 }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          args: {{ .Values.args }}

<强 > ERROR

2022-05-05 02:43:50,762 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: No suitable driver found for jdbc:mysql://194.148.0.57/keycloakblockchain

2022-05-05 02:43:38,765 WARN  [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator] (JPA Startup Thread: keycloak-default) HHH000342: Could not obtain connection to query metadata: java.sql.SQLException: No suitable driver found for jdbc:mysql://194.148.0.57/keycloakblockchain
    at org.h2.jdbcx.JdbcDataSource.getJdbcConnection(JdbcDataSource.java:191)
    at org.h2.jdbcx.JdbcDataSource.getXAConnection(JdbcDataSource.java:352)
    at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:216)
    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:513)
    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:494)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:75)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1126)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)```
问题回答

尝试 < 强 > 移动 < 强 > / 强 > < 强 > jdbc: 并使用 < 强 > mysql:/ 代替

"--db-url=mysql://194.148.0.57/keycloakblockchain"

我也有同样的问题。我花了一些时间才注意到,在制作制作图像时,我在“KC_DB=mysql” 中有一个打字机。

如果您使用这里的多克文件 : https://www.keycloak.org/server/containers

而不是只需要将 KC_DB 环境 var 更改为 Mysql 。

我的嵌入文件 :

FROM quay.io/keycloak/keycloak:18.0.2 as builder

ENV KC_HEALTH_ENABLED=true
ENV KC_METRICS_ENABLED=true
ENV KC_PROXY=edge
ENV KC_DB=mariadb
ENV KC_DB_URL_PROPERTIES=characterEncoding=UTF-8
ENV KC_TRANSACTION_XA_ENABLED=false
ENV KC_CACHE_CONFIG_FILE=cache-ispn-jdbc-ping.xml

COPY cache-ispn-jdbc-ping.xml /opt/keycloak/conf/cache-ispn-jdbc-ping.xml
RUN curl -sL https://github.com/aerogear/keycloak-metrics-spi/releases/download/2.5.3/keycloak-metrics-spi-2.5.3.jar -o /opt/keycloak/providers/keycloak-metrics-spi-2.5.3.jar
RUN /opt/keycloak/bin/kc.sh build

FROM quay.io/keycloak/keycloak:latest
COPY --from=builder /opt/keycloak/ /opt/keycloak/
WORKDIR /opt/keycloak

ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start"]

我的docker-compact.yml(我曾经在本地测试):

  [...]

  keycloak:
    build:
      context: ./keycloak
      dockerfile: Dockerfile
    container_name:  keycloak 
    restart:  no 
    labels:
      -  traefik.enable=true 
      -  traefik.http.services.keycloak.loadbalancer.server.port=8080 
      -  traefik.http.routers.keycloak.entrypoints=http 
      -  traefik.http.routers.keycloak.rule=Host(`sso.localhost`) || Host(`sso.${HOSTNAME}`) 
      -  traefik.http.routers.keycloak.service=keycloak@docker 
    environment:
      KC_EXTERNAL_IP: 172.21.2.2
      KC_EXTERNAL_PORT: 9600
      KC_DB_URL_HOST: db-keycloak
      KC_DB_URL_PORT: 3306
      KC_DB_URL_DATABASE: db
      KC_DB_USERNAME: user
      KC_DB_PASSWORD: pass
      KC_PROXY: edge
      KC_HOSTNAME_STRICT: false
      KEYCLOAK_ADMIN: root
      KEYCLOAK_ADMIN_PASSWORD: root
    networks:
      internal:
        ipv4_address: 172.21.2.2
    expose:
      -  8080 
      -  9600 
    ports:
      -  82:8080 
    depends_on:
      - db-keycloak

  [...]




相关问题
anyone get mysql workbench 5.2 to work with mamp?

i cannot get mysql workbench 5.2 to work. i have mamp and mamp pro installed and running and no matter what type of connection i try it just wont connect. what can i do? i have a mac with snow ...

Synchronize model in MySQL Workbench

After reading the documentation for MySQL Workbench I got the impression that it s possible to alter a database in the server (e.g. add a new column) and later incorporate the DDL changes into your ...

Syntax Error with MySql Workbench and IF Statement

I m migrating from T-SQL to MySql syntax and don t know how to get over this syntax error given by Workbench 5.1.18: -- --------------------------------------------------------------------------------...

How do I run a script on/in a mysql database?

I have created a MySQL database using MySQL Workbench. It has about 20 tables. I cannot figure out how to run scripts on the database. Basically, I want to make a database creation script which will ...

MySQL Workbench: Generate a bunch of rows?

I have a MySQL workbench model that I ve used to generate a schema. To play around with it, I d like a bunch of fake data. Is there an easy way to generate this, or must I do it by hand?

Is it possible to save MySQL Workbench files as plain XML?

DB Designer had a lot of bugs but one outstanding feature was that database models were saved in plain XML by default. This allowed a user to diff file versions via SVN or Beyond Compare, easily ...

热门标签