java吧 关注:1,274,825贴子:12,786,447
  • 8回复贴,共1

求助大神,达梦+mp+shardingsphere报错

只看楼主收藏回复

问题描述:在代码中调用MP中Service方法getOne,list,page等方法时,会出现SQLParsingExceptin的报错,但是有的entity会报错,有的能正常使用(这里的entity所对应的表不涉及shardingsphere的分表)。达梦的数据是在mysql迁移的,使用mysql时能正常执行在百度和尝试调试以后猜测是shardingsphere的parser在初始化时没有加载mysql的parser导致的,求救java吧的各位大神应该怎么解决这个问题,最好能在不修改源码的情况下解决。
java版本1.8
达梦8,数据库驱动DmJdbcDriver18
shardingsphere版本:5.2.0


IP属地:广东来自Android客户端1楼2024-06-17 21:32回复
    样例源码:
    public R<BundleUser> detail(BundleUser bundleUser) {
    BundleUser detail = iBundleUserService.getOne(Condition.getQueryWrapper(bundleUser));
    return R.data(detail);
    }


    IP属地:广东2楼2024-06-17 21:34
    回复
      2025-08-21 03:06:36
      广告
      不感兴趣
      开通SVIP免广告
      报错:
      org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error preparing statement. Cause: org.apache.shardingsphere.sql.parser.exception.SQLParsingException
      at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:96)
      at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)
      at com.sun.proxy.$Proxy141.selectOne(Unknown Source)
      at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160)
      。。。。。
      Caused by: org.apache.ibatis.executor.ExecutorException: Error preparing statement. Cause: org.apache.shardingsphere.sql.parser.exception.SQLParsingException
      at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:97)
      at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:59)
      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.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)
      。。。。
      Caused by: org.apache.shardingsphere.sql.parser.exception.SQLParsingException: null
      at org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor.twoPhaseParse(SQLParserExecutor.java:65)
      at org.apache.shardingsphere.sql.parser.core.database.parser.SQLParserExecutor.parse(SQLParserExecutor.java:46)


      IP属地:广东3楼2024-06-17 21:36
      回复
        报错是在发不出来文字了


        IP属地:广东4楼2024-06-17 21:40
        收起回复


          IP属地:广东来自Android客户端5楼2024-06-17 22:18
          回复
            shardings-jdbc不支持达梦!我之前也是遇到这样,手写的mapper里面的sql就行


            IP属地:广东来自iPhone客户端6楼2024-10-29 22:01
            收起回复