一、该问题的重现步骤是什么?
1. 官方提供的sql导入数据后配置完成达梦数据库
2. 启动项目
3.报错
二、你期待的结果是什么?实际看到的又是什么?
正常运行
运行报错
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
四、请提供详细的错误堆栈信息,这很重要。
2023-10-08 15:36:38.243 ERROR 9851 --- [ async-task-9] o.s.c.b.c.BladeExecutorConfiguration : Unexpected exception occurred invoking async method: public void org.springblade.common.event.ErrorLogListener.saveErrorLog(org.springblade.core.log.event.ErrorLogEvent)
org.springframework.dao.DataIntegrityViolationException:
### Error updating database. Cause: dm.jdbc.driver.DMException: 第1 行附近出现错误:
无效的表或视图名[BLADE_LOG_ERROR]
### The error may exist in org/springblade/modules/system/mapper/LogErrorMapper.java (best guess)
### The error may involve org.springblade.modules.system.mapper.LogErrorMapper.insert
### The error occurred while executing an update
### SQL: INSERT INTO blade_log_error (id, stack_trace, exception_name, message, file_name, line_number, service_id, server_ip, server_host, env, method_class, method_name, params, create_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
### Cause: dm.jdbc.driver.DMException: 第1 行附近出现错误:
无效的表或视图名[BLADE_LOG_ERROR]
; 第1 行附近出现错误:
无效的表或视图名[BLADE_LOG_ERROR]; nested exception is dm.jdbc.driver.DMException: 第1 行附近出现错误:
无效的表或视图名[BLADE_LOG_ERROR]
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:104)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:91)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)
at com.sun.proxy.$Proxy131.insert(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:59)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
at com.sun.proxy.$Proxy193.insert(Unknown Source)
at com.baomidou.mybatisplus.extension.service.IService.save(IService.java:63)
at com.baomidou.mybatisplus.extension.service.IService$$FastClassBySpringCGLIB$$f8525d18.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386)
at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:704)
at org.springblade.modules.system.service.impl.LogErrorServiceImpl$$EnhancerBySpringCGLIB$$271f9a08.save(<generated>)
at org.springblade.modules.system.service.impl.LogServiceImpl.saveErrorLog(LogServiceImpl.java:38)
at org.springblade.common.event.ErrorLogListener.saveErrorLog(ErrorLogListener.java:55)
at org.springblade.common.event.ErrorLogListener$$FastClassBySpringCGLIB$$d15d923a.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
at org.springblade.core.log.aspect.LogTraceAspect.around(LogTraceAspect.java:41)
at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:634)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:624)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:72)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.springblade.core.context.BladeRunnableWrapper.run(BladeRunnableWrapper.java:54)
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)
Caused by: dm.jdbc.driver.DMException: 第1 行附近出现错误:
无效的表或视图名[BLADE_LOG_ERROR]
at dm.jdbc.driver.DBError.throwException(DBError.java:696)
at dm.jdbc.b.b.o.E(MSG.java:560)
at dm.jdbc.b.b.o.B(MSG.java:520)
at dm.jdbc.b.b.o.A(MSG.java:501)
at dm.jdbc.b.a.a(DBAccess.java:230)
at dm.jdbc.b.a.a(DBAccess.java:690)
at dm.jdbc.driver.DmdbPreparedStatement.prepareSql(DmdbPreparedStatement.java:267)
at dm.jdbc.driver.DmdbPreparedStatement.allocateHandle(DmdbPreparedStatement.java:224)
at dm.jdbc.driver.DmdbPreparedStatement.<init>(DmdbPreparedStatement.java:126)
at dm.jdbc.driver.DmdbPreparedStatement.<init>(DmdbPreparedStatement.java:176)
at dm.jdbc.driver.DmdbConnection.do_prepareStatement(DmdbConnection.java:712)
at dm.jdbc.driver.DmdbConnection.do_prepareStatement(DmdbConnection.java:698)
at dm.jdbc.driver.DmdbConnection.prepareStatement(DmdbConnection.java:1317)
at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:535)
at com.alibaba.druid.filter.FilterAdapter.connection_prepareStatement(FilterAdapter.java:908)
at com.alibaba.druid.filter.FilterEventAdapter.connection_prepareStatement(FilterEventAdapter.java:116)
at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:531)
at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.prepareStatement(ConnectionProxyImpl.java:326)
at com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:369)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:86)
at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:88)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:59)
at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)
at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62)
at com.sun.proxy.$Proxy266.prepare(Unknown Source)
at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:87)
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)
at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62)
at com.sun.proxy.$Proxy265.update(Unknown Source)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:194)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:181)
at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427)
... 39 common frames omitted
五、若有更多详细信息,请在下面提供。
一样的问题, 不过我我之前别的项目也是这个框架,弄好过, 我把配置 复制过来也不行, 现在之前项目也不敢动
这个好像是通病, 都有这个问题, 不知道是版本问题还是啥, 这个我倒是看过, 说的是因为 咱们链接填写的账号是sysdba然后他就自动连接到了 sysdba哪个库下面, 因为下边没有咱们表 所以报错,所以sql执行的时候 需要加上"数据库名称"."表名"才能执行成功。网上看的一种解决方式, 创建一个只有业务库的账号, 这样链接只有业务库 也就没办法链接其他库了,
测试了一下网上的方法
第一步
创建一个管理用户
用户名最好是数据库名称例如GRADUATIO
密码自己写吧。
然后迁移数据
数据库名称跟用户名一样GRADUATIO
: jdbc:dm://127.0.0.1:5237/GRADUATIO?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 : GRADUATIO : weike@123
这是配置,启动 访问就OK了
亲测
1. 引入达梦的驱动包
2. 修改yml配置,指定达梦驱动类
3. 使用达梦的数据源配置
配置没问题 改了依赖驱动和数据库三个地方 跑起来没问题 但是一打开登录页就开始疯狂报错
和这个问题一样https://sns.bladex.cn/q-10542.html
看看达梦区分大小写问题
达梦设置不区分大小写了 还是报一样的error
扫一扫访问 Blade技术社区 移动端