嵌入 H2 的 Camunda:Cockpit 登录失败
Camunda embedded with H2: Cockpit Login fails
我目前正在开发具有以下条件的产品:
- Spring-嵌入 Camunda (7.16) 的启动 (2.6)
- 与 Camunda 的连接配置为使用嵌入以下内容的 H2 (2.1.210) 在 application.yml 中配置:
app:
datasource-camunda:
jdbcUrl: jdbc:h2:./h2/test;MODE=LEGACY
camunda:
bpm:
database:
schema-update: true
auto-deployment-enabled: true
和Java-配置:
@Bean("camundaBpmDataSource")
@ConfigurationProperties
public DataSource camundaDataSource() {
return DataSourceBuilder.create().build();
}
@Bean
public PlatformTransactionManager camundaBpmTransactionManager(DataSource datasource) {
return new DataSourceTransactionManager(datasource)
}
camunda 引擎未明确配置,因为我使用了适当的启动器并让 Spring 自动配置它。因此,生成的设置看起来应该与此处显示的嵌入式 camunda h2 配置非常相似:https://docs.camunda.org/get-started/spring/embedded-process-engine/
应用程序在此设置下运行良好。该应用程序完全没有问题,但我在登录 camunda 驾驶舱时遇到了问题。登录成功,但随后我在登录掩码中看到一条错误消息:
登录失败
An exception occured in the persistence layer. Please check the server
logs for a detailed message and the entire exception stack trace
Caused by: org.h2.jdbc.JdbcSQLNonTransientException: Unbekannter Datentyp: "?2"
Unknown data type: "?2"; SQL statement:
SELECT
CASE
WHEN
EXISTS
(SELECT
A.RESOURCE_ID_
FROM
ACT_RU_AUTHORIZATION A
WHERE
A.TYPE_ = 1
AND
A.USER_ID_ = ?
AND
BITAND(A.PERMS_,?) = ?
AND
A.RESOURCE_TYPE_ = ?
AND
A.RESOURCE_ID_ = ? )
THEN 1
WHEN
EXISTS
(SELECT
ID_
FROM
ACT_RU_AUTHORIZATION A
WHERE
A.TYPE_ = 1
AND
A.USER_ID_ = ?
AND
BITAND(A.PERMS_,?) = ?
AND
A.RESOURCE_TYPE_ = ?
AND
A.RESOURCE_ID_ = '*')
THEN 1
ELSE
(
SELECT
CASE
WHEN
EXISTS
(SELECT
A.RESOURCE_ID_
FROM
ACT_RU_AUTHORIZATION A
WHERE
A.TYPE_ = 1
AND
A.GROUP_ID_ IN ( ? )
AND
BITAND(A.PERMS_,?) = ?
AND
A.RESOURCE_TYPE_ = ?
AND
A.RESOURCE_ID_ = ? )
THEN 1
WHEN
EXISTS
(SELECT
ID_
FROM
ACT_RU_AUTHORIZATION A
WHERE
A.TYPE_ = 1
AND
A.GROUP_ID_ IN ( ? )
AND
BITAND(A.PERMS_,?) = ?
AND
A.RESOURCE_TYPE_ = ?
AND
A.RESOURCE_ID_ = '*')
THEN 1
ELSE (
SELECT
CASE
WHEN
EXISTS
(SELECT
A.RESOURCE_ID_
FROM
ACT_RU_AUTHORIZATION A
WHERE
A.TYPE_ = 0
AND
A.USER_ID_ = '*'
AND
BITAND(A.PERMS_,?) = ?
AND
A.RESOURCE_TYPE_ = ?
AND
A.RESOURCE_ID_ = ? )
THEN 1
WHEN
EXISTS
(SELECT
ID_
FROM
ACT_RU_AUTHORIZATION A
WHERE
A.TYPE_ = 0
AND
A.USER_ID_ = '*'
AND
BITAND(A.PERMS_,?) = ?
AND
A.RESOURCE_TYPE_ = ?
AND
A.RESOURCE_ID_ = '*')
THEN 1
ELSE
null
END
)
END
)
END [50004-210]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:573) ~[h2-2.1.210.jar:2.1.210]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) ~[h2-2.1.210.jar:2.1.210]
at org.h2.message.DbException.get(DbException.java:227) ~[h2-2.1.210.jar:2.1.210]
我已经查看了数据库并看到了所有成功创建的表,那么有人遇到过类似的问题吗?
从 url 中删除“MODE=LEGACY”。这是一个工作示例:
还要确保您使用受支持的 H2 版本。即 1.4.x 到 7.16.x:
https://docs.camunda.org/manual/7.16/introduction/supported-environments/
BOM 将包含 H2 1.4.200。
我目前正在开发具有以下条件的产品:
- Spring-嵌入 Camunda (7.16) 的启动 (2.6)
- 与 Camunda 的连接配置为使用嵌入以下内容的 H2 (2.1.210) 在 application.yml 中配置:
app:
datasource-camunda:
jdbcUrl: jdbc:h2:./h2/test;MODE=LEGACY
camunda:
bpm:
database:
schema-update: true
auto-deployment-enabled: true
和Java-配置:
@Bean("camundaBpmDataSource")
@ConfigurationProperties
public DataSource camundaDataSource() {
return DataSourceBuilder.create().build();
}
@Bean
public PlatformTransactionManager camundaBpmTransactionManager(DataSource datasource) {
return new DataSourceTransactionManager(datasource)
}
camunda 引擎未明确配置,因为我使用了适当的启动器并让 Spring 自动配置它。因此,生成的设置看起来应该与此处显示的嵌入式 camunda h2 配置非常相似:https://docs.camunda.org/get-started/spring/embedded-process-engine/
应用程序在此设置下运行良好。该应用程序完全没有问题,但我在登录 camunda 驾驶舱时遇到了问题。登录成功,但随后我在登录掩码中看到一条错误消息:
登录失败
An exception occured in the persistence layer. Please check the server logs for a detailed message and the entire exception stack trace
Caused by: org.h2.jdbc.JdbcSQLNonTransientException: Unbekannter Datentyp: "?2"
Unknown data type: "?2"; SQL statement:
SELECT
CASE
WHEN
EXISTS
(SELECT
A.RESOURCE_ID_
FROM
ACT_RU_AUTHORIZATION A
WHERE
A.TYPE_ = 1
AND
A.USER_ID_ = ?
AND
BITAND(A.PERMS_,?) = ?
AND
A.RESOURCE_TYPE_ = ?
AND
A.RESOURCE_ID_ = ? )
THEN 1
WHEN
EXISTS
(SELECT
ID_
FROM
ACT_RU_AUTHORIZATION A
WHERE
A.TYPE_ = 1
AND
A.USER_ID_ = ?
AND
BITAND(A.PERMS_,?) = ?
AND
A.RESOURCE_TYPE_ = ?
AND
A.RESOURCE_ID_ = '*')
THEN 1
ELSE
(
SELECT
CASE
WHEN
EXISTS
(SELECT
A.RESOURCE_ID_
FROM
ACT_RU_AUTHORIZATION A
WHERE
A.TYPE_ = 1
AND
A.GROUP_ID_ IN ( ? )
AND
BITAND(A.PERMS_,?) = ?
AND
A.RESOURCE_TYPE_ = ?
AND
A.RESOURCE_ID_ = ? )
THEN 1
WHEN
EXISTS
(SELECT
ID_
FROM
ACT_RU_AUTHORIZATION A
WHERE
A.TYPE_ = 1
AND
A.GROUP_ID_ IN ( ? )
AND
BITAND(A.PERMS_,?) = ?
AND
A.RESOURCE_TYPE_ = ?
AND
A.RESOURCE_ID_ = '*')
THEN 1
ELSE (
SELECT
CASE
WHEN
EXISTS
(SELECT
A.RESOURCE_ID_
FROM
ACT_RU_AUTHORIZATION A
WHERE
A.TYPE_ = 0
AND
A.USER_ID_ = '*'
AND
BITAND(A.PERMS_,?) = ?
AND
A.RESOURCE_TYPE_ = ?
AND
A.RESOURCE_ID_ = ? )
THEN 1
WHEN
EXISTS
(SELECT
ID_
FROM
ACT_RU_AUTHORIZATION A
WHERE
A.TYPE_ = 0
AND
A.USER_ID_ = '*'
AND
BITAND(A.PERMS_,?) = ?
AND
A.RESOURCE_TYPE_ = ?
AND
A.RESOURCE_ID_ = '*')
THEN 1
ELSE
null
END
)
END
)
END [50004-210]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:573) ~[h2-2.1.210.jar:2.1.210]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:496) ~[h2-2.1.210.jar:2.1.210]
at org.h2.message.DbException.get(DbException.java:227) ~[h2-2.1.210.jar:2.1.210]
我已经查看了数据库并看到了所有成功创建的表,那么有人遇到过类似的问题吗?
从 url 中删除“MODE=LEGACY”。这是一个工作示例:
还要确保您使用受支持的 H2 版本。即 1.4.x 到 7.16.x: https://docs.camunda.org/manual/7.16/introduction/supported-environments/
BOM 将包含 H2 1.4.200。