问题描述
- 在 java se 中使用mybatis 用fatjar打包后出现错误、
-
在开发环境可以顺利运行,用fatjar打包后出现错误,
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.simontuffs.onejar.Boot.run(Boot.java:306)
at com.simontuffs.onejar.Boot.main(Boot.java:159)
Caused by: org.apache.ibatis.binding.BindingException: Type interface com.jtanco
der.mybatistest.mappers.PersonInfoMapper is not known to the MapperRegistry.
at org.apache.ibatis.binding.MapperRegistry.getMapper(MapperRegistry.jav
a:47)
at org.apache.ibatis.session.Configuration.getMapper(Configuration.java:
655)
at org.apache.ibatis.session.defaults.DefaultSqlSession.getMapper(Defaul
tSqlSession.java:222)
at com.jtancoder.mybatistest.service.PersonInfoService.getPersonInfoServ
iceInstance(PersonInfoService.java:26)
at com.jtancoder.mybatistest.main.AppMain.main(AppMain.java:20)
... 6 more
项目结构如下:
求高手解答
解决方案
PersonInfoMapper写的不正确,请检查一下。
时间: 2024-09-17 03:54:44