冷朴承 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 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置