共计 4403 个字符,预计需要花费 12 分钟才能阅读完成。
WGCLOUD 监控零碎的 server 启动时候,日志打印呈现谬误
2022-06-16 09:44:39.516 [taskScheduler-2] ERROR com.wgcloud.task.ScheduledTask - 检测 license 工作谬误
org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: java.sql.SQLSyntaxErrorException: Table 'wgcloud.SYSTEM_INFO' doesn't exist
### The error may exist in class path resource [mybatis/mapper/SystemInfoMapper.xml]
### The error may involve com.wgcloud.mapper.SystemInfoMapper.countByParams-Inline
### The error occurred while setting parameters
### SQL: SELECT count(*) FROM SYSTEM_INFO t
### Cause: java.sql.SQLSyntaxErrorException: Table 'wgcloud.SYSTEM_INFO' doesn't exist
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Table 'wgcloud.SYSTEM_INFO' doesn't exist
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:91)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)
at com.sun.proxy.$Proxy62.selectOne(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:87)
at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:152)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85)
at com.sun.proxy.$Proxy79.countByParams(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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at com.sun.proxy.$Proxy80.countByParams(Unknown Source)
at com.wgcloud.service.SystemInfoService.countByParams(SystemInfoService.java:97)
at com.wgcloud.service.SystemInfoService$$FastClassBySpringCGLIB$$71218ce9.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
at com.wgcloud.service.SystemInfoService$$EnhancerBySpringCGLIB$$97352e58.countByParams(<generated>)
at com.wgcloud.task.ScheduledTask.validateLicense(ScheduledTask.java:90)
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.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
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)
起因:
1、这个谬误是 wgcloud 数据库中没有创立表,也就是咱们没有导入 sql 脚本来初始化数据库,sql 脚本在安装包里,如下图所示,咱们导入对应的 sql 就能够了,一个是 mysql 的初始化脚本,一个是 postgresql 的初始化脚本
2、还有一种可能是 Linux 装置的 mysql,大小写敏感问题导致的问题
咱们通过批改 my.cnf 文件的参数来达到大小写不敏感
vi /etc/my.cnf
# 在 [mysqld] 退出上面参数
lower_case_table_names=1
而后保留退出,重启服务
systemctl restart mysqld
这个时候就曾经设置好表名称大小写不敏感了
正文完