0.23版本安装启动报错

  • Choerodon平台版本: 0.23

  • 遇到问题的执行步骤:

  • 报错日志:
    org.springframework.jdbc.BadSqlGrammarException:

Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table ‘hzero_monitor.hpfm_tenant’ doesn’t exist

The error may exist in URL [jar:file:/choerodon/choerodon-monitor.jar!/BOOT-INF/lib/hzero-monitor-saas-1.4.0.RELEASE.jar!/mapper/AuditOpConfigMapper.xml]

The error may involve defaultParameterMap

The error occurred while setting parameters

SQL: SELECT count(0) FROM hmnt_audit_op_config haoc JOIN hpfm_tenant ht ON ht.tenant_id = haoc.tenant_id JOIN iam_permission ip ON haoc.permission_id = ip.id

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table ‘hzero_monitor.hpfm_tenant’ doesn’t exist

; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table ‘hzero_monitor.hpfm_tenant’ doesn’t exist
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:234) ~[spring-jdbc-5.0.10.RELEASE.jar!/:5.0.10.RELEASE]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) ~[spring-jdbc-5.0.10.RELEASE.jar!/:5.0.10.RELEASE]
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) ~[mybatis-spring-1.3.1.jar!/:1.3.1]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) ~[mybatis-spring-1.3.1.jar!/:1.3.1]
at com.sun.proxy.$Proxy165.selectList(Unknown Source) ~[na:na]
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230) ~[mybatis-spring-1.3.1.jar!/:1.3.1]
at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:137) ~[mybatis-3.4.2.jar!/:3.4.2]
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:75) ~[mybatis-3.4.2.jar!/:3.4.2]
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) ~[mybatis-3.4.2.jar!/:3.4.2]
at com.sun.proxy.$Proxy175.listAll(Unknown Source) ~[na:na]
at org.hzero.monitor.infra.repository.impl.AuditOpConfigRepositoryImpl.lambda$pageAll$1(AuditOpConfigRepositoryImpl.java:48) ~[hzero-monitor-saas-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
at org.hzero.monitor.infra.repository.impl.AuditOpConfigRepositoryImpl$$Lambda$801/000000000C01F670.doSelect(Unknown Source) ~[na:na]
at io.choerodon.mybatis.pagehelper.PageHelper.doPageAndSort(PageHelper.java:47) ~[hzero-starter-mybatis-mapper-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
at org.hzero.monitor.infra.repository.impl.AuditOpConfigRepositoryImpl.pageAll(AuditOpConfigRepositoryImpl.java:48) ~[hzero-monitor-saas-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
at org.hzero.monitor.infra.repository.impl.AuditOpConfigRepositoryImpl$$FastClassBySpringCGLIB$$b486b9c4.invoke() ~[hzero-monitor-saas-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-5.0.10.RELEASE.jar!/:5.0.10.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684) ~[spring-aop-5.0.10.RELEASE.jar!/:5.0.10.RELEASE]
at org.hzero.monitor.infra.repository.impl.AuditOpConfigRepositoryImpl$$EnhancerBySpringCGLIB$$9380f7f7.pageAll() ~[hzero-monitor-saas-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
at org.hzero.monitor.app.service.impl.AuditOpConfigServiceImpl.refreshCache(AuditOpConfigServiceImpl.java:76) ~[hzero-monitor-saas-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
at org.hzero.monitor.app.service.impl.AuditOpConfigServiceImpl$$FastClassBySpringCGLIB$$7a1b5ec3.invoke() ~[hzero-monitor-saas-1.4.0.RELEASE.jar!/:1.4.0.RELEASE]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-5.0.10.RELEASE.jar!/:5.0.10.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746) ~[spring-aop-5.0.10.RELEASE.jar!/:5.0.10.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.0.10.RELEASE.jar!/:5.0.10.RELEASE]
at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115) ~[spring-aop-5.0.10.RELEASE.jar!/:5.0.10.RELEASE]
at org.springframework.aop.interceptor.AsyncExecutionInterceptor$$Lambda$800/0000000036E877F0.call(Unknown Source) [spring-aop-5.0.10.RELEASE.jar!/:5.0.10.RELEASE]
at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_242]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_242]

  • 疑问:
    初始化数据库时,是否缺少hzero_monitor.hpfm_tenant表?

ping @WangAlainDelon

1.在平台choerodon-platform服务初始化的时候会把数据权限规则初始化到数据库中,并且会加载到内存.
可以看看hzeo-platform数据库是否初始化成功,如果没有初始化成功可以重新初始化,如果初始化成功了还出现这个问题就去界面点击编辑保存,刷新一下缓存就行了。