后台登录成功不显示页面报错如下

来源:4-3 细节优化

invictus丶

2020-04-21 22:08:51

Caused by: org.apache.ibatis.exceptions.PersistenceException: 

### Error querying database.  Cause: com.github.pagehelper.PageException: java.lang.reflect.InvocationTargetException

### The error may exist in com/imooc/icake/dao/CakeDao.java (best guess)

### The error may involve defaultParameterMap

### The error occurred while setting parameters

### SQL: SELECT count(0) FROM cake c JOIN catalog ca ON c.cid = ca.id

### Cause: com.github.pagehelper.PageException: java.lang.reflect.InvocationTargetException

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:111)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102)

at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:119)

at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63)

at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)

at com.sun.proxy.$Proxy16.selectAll(Unknown Source)

at com.imooc.icake.biz.impl.CakeBizImpl.getAll(CakeBizImpl.java:34)

at com.imooc.icake.controller.CakeController.list(CakeController.java:39)

... 33 more

Caused by: com.github.pagehelper.PageException: java.lang.reflect.InvocationTargetException

at com.github.pagehelper.util.MetaObjectUtil.forObject(MetaObjectUtil.java:59)

at com.github.pagehelper.dialect.helper.MySqlDialect.processPageParameter(MySqlDialect.java:61)

at com.github.pagehelper.dialect.AbstractHelperDialect.processParameterObject(AbstractHelperDialect.java:141)

at com.github.pagehelper.PageHelper.processParameterObject(PageHelper.java:88)

at com.github.pagehelper.util.ExecutorUtil.pageQuery(ExecutorUtil.java:166)

at com.github.pagehelper.PageInterceptor.intercept(PageInterceptor.java:104)

at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:60)

at com.sun.proxy.$Proxy15.query(Unknown Source)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:108)

... 40 more

Caused by: java.lang.reflect.InvocationTargetException

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:497)

at com.github.pagehelper.util.MetaObjectUtil.forObject(MetaObjectUtil.java:57)

... 48 more

Caused by: java.lang.NoSuchMethodError: org.apache.ibatis.reflection.MetaObject.forObject(Ljava/lang/Object;Lorg/apache/ibatis/reflection/factory/ObjectFactory;Lorg/apache/ibatis/reflection/wrapper/ObjectWrapperFactory;Lorg/apache/ibatis/reflection/ReflectorFactory;)Lorg/apache/ibatis/reflection/MetaObject;

at com.github.pagehelper.util.MetaObjectWithReflectCache.forObject(MetaObjectWithReflectCache.java:48)

... 53 more


写回答

2回答

好帮手慕阿满

2020-04-22

同学你好,查看同学贴出来的代码并没有什么问题,建议同学可以在执行方法时打上断点,查看具体是哪里报错。

另外配置监听器后项目启动不起来,是报什么错误呢?

祝:学习愉快~

0

好帮手慕阿满

2020-04-22

同学你好,报错提示没有forObject()方法,如:

http://img.mukewang.com/climg/5e9fb1e209e298f808850205.jpg

这里应该是同学参数类型不确定造成的。

在项目中并没有如下的sql,

SELECT count(0) FROM cake c JOIN catalog ca ON c.cid = ca.id

问一下同学是自己增加什么功能吗?

或者同学可以将pom文件中,pagehelper依赖的版本降到4.xx的版本再试试。

祝:学习愉快~

0
hnvictus丶
h 而且我配置监听器后项目就启动不起来,但运行老师的源码是没问题的
h020-04-22
共2条回复

0 学习 · 8016 问题

查看课程