冷朴承 2021-01-23 16:34 采纳率: 100%
浏览 25
已结题

非mabytis接口被ibatis代理并提示Invalid bound statement

非Mabytis接口,在实际运行过程中被 ibatis proxy 并提示Invalid bound statement (not found) 

具体的接口调用如下:

public interface LoginServer<T extends User> {}

@Service
public class DefaultLoginServer implements LoginServer {}


@Component
public class DefaultCoreRealmServer extends AuthorizingRealm {
    @Autowired
    private LoginServer loginServer;
 /..../
 @Override
    protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
 /..../
        loginServer.login(token.getUsername());
 /..../
}
        
 /..../
        
}

启动类如下

// cn.xxxx.xxx.core 为项目根包名
@SpringBootApplication(scanBasePackages = {"cn.xxxx.xxx.core"})
@ComponentScan({"cn.xxxx.xxx.core"})
@MapperScan({"cn.xxxx.xxx.core"})
public class CoreApplication {
    public static void main(String[] args) {
        SpringApplication.run(CoreApplication.class, args);
    }
}

需要说明的时候,如果注释掉 @MapperScan({"cn.xxxx.xxx.core"})  将不会出现此问题,目前core模块中并没有实际使用mabytis,但后续会扩展相关接口和类,因此不可能 一直 注释掉 @MapperScan({"cn.xxxx.xxx.core"}) 

 

在实际运行过程中,若注释掉 @MapperScan({"cn.xxxx.xxx.core"})  debug显示对象为 实际的实现类@id ,若不注释掉会显示为

ibatis.*.*proxy@id 因此可以肯定当前接口被其进行了代理,但是代码中并没有声明? 

  • 写回答

3条回答 默认 最新

  • Aganstrong 2021-01-23 18:40
    关注

    mybatis

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探