定义方法
public List<Role> roleList() {
Object obj = dao.query(Role.class, null);
System.out.println(obj);
return new ArrayList<Role>();
}
调用此方法会有异常
DEBUG - SELECT * FROM t_role
[/*net.wendal.nutzbook.bean.Role@25061d99*/{"id":1,"name":"admin","createTime":"2015-11-19 10:06:24","updateTime":"2015-11-19 10:06:24"}]
2015-11-24 16:09:49,919 org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:193) DEBUG - SELECT * FROM t_permission
2015-11-24 16:09:49,942 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:123) ERROR - Error happend during start serivce!
org.nutz.castor.FailToCastObjectException: Fail to cast from <net.wendal.nutzbook.bean.Role> to <java.lang.Integer> for {/*net.wendal.nutzbook.bean.Role@85ec775*/{"id":1,"name":"admin","createTime":"2015-11-19 10:06:24","updateTime":"2015-11-19 10:06:24"}} because:
BorningException:Fail to born 'java.lang.Integer'
by args: [
@(/*net.wendal.nutzbook.bean.Role@85ec775*/{"id":1,"name":"admin","createTime":"2015-11-19 10:06:24","updateTime":"2015-11-19 10:06:24"})] becasue:
java.lang.NumberFormatException: For input string: "/*net.wendal.nutzbook.bean.Role@85ec775*/{"id":1,"name":"admin","createTime":"2015-11-19 10:06:24","updateTime":"2015-11-19 10:06:24"}"
at org.nutz.castor.Castors.cast(Castors.java:258)
at org.nutz.castor.Castors.castTo(Castors.java:320)
at org.nutz.castor.castor.Collection2Object.cast(Collection2Object.java:17)
at org.nutz.castor.castor.Collection2Object.cast(Collection2Object.java:9)
at org.nutz.castor.Castors.cast(Castors.java:252)
at org.nutz.castor.Castors.castTo(Castors.java:320)
at org.nutz.dao.impl.sql.NutStatement.getObject(NutStatement.java:117)
at org.nutz.dao.impl.sql.NutStatement.getInt(NutStatement.java:121)
at org.nutz.dao.impl.NutDao.each(NutDao.java:469)
at org.nutz.dao.impl.NutDao.each(NutDao.java:473)
at net.wendal.nutzbook.service.AuthorityServiceImpl.initFormPackage(AuthorityServiceImpl.java:69)
at net.wendal.nutzbook.MainSetup.init(MainSetup.java:147)
at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:270)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:119)
at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
at org.nutz.mvc.NutFilter.init(NutFilter.java:77)
at net.wendal.nutzbook.mvc.NutzBookNutFilter.init(NutzBookNutFilter.java:24)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NumberFormatException: For input string: "/*net.wendal.nutzbook.bean.Role@85ec775*/{"id":1,"name":"admin","createTime":"2015-11-19 10:06:24","updateTime":"2015-11-19 10:06:24"}"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:569)
at java.lang.Integer.<init>(Integer.java:867)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.nutz.lang.born.ConstructorCastingBorning.born(ConstructorCastingBorning.java:21)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:967)
at org.nutz.castor.castor.Object2Object.cast(Object2Object.java:12)
at org.nutz.castor.Castors.cast(Castors.java:252)
... 29 more
2015-11-24 16:09:49,942 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:125) ERROR - try to depose ioc
2015-11-24 16:09:49,942 org.quartz.core.QuartzScheduler.shutdown(QuartzScheduler.java:694) INFO - Scheduler NutzbookScheduler_$_NON_CLUSTERED shutting down.
2015-11-24 16:09:49,942 org.quartz.core.QuartzScheduler.standby(QuartzScheduler.java:613) INFO - Scheduler NutzbookScheduler_$_NON_CLUSTERED paused.
2015-11-24 16:09:49,942 org.quartz.core.QuartzScheduler.shutdown(QuartzScheduler.java:771) INFO - Scheduler NutzbookScheduler_$_NON_CLUSTERED shutdown complete.
2015-11-24 16:09:50,349 org.zbus.net.core.Dispatcher.stop(Dispatcher.java:138) INFO - Dispatcher(SelectorCount=1) stopped
2015-11-24 16:09:50,380 org.zbus.net.core.Dispatcher.stop(Dispatcher.java:138) INFO - Dispatcher(SelectorCount=1) stopped
2015-11-24 16:09:50,380 com.alibaba.druid.pool.DruidDataSource.close(DruidDataSource.java:1385) INFO - {dataSource-1} closed
十一月 24, 2015 4:09:50 下午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter nutz
org.nutz.mvc.LoadingException: org.nutz.castor.FailToCastObjectException: Fail to cast from <net.wendal.nutzbook.bean.Role> to <java.lang.Integer> for {/*net.wendal.nutzbook.bean.Role@85ec775*/{"id":1,"name":"admin","createTime":"2015-11-19 10:06:24","updateTime":"2015-11-19 10:06:24"}} because:
BorningException:Fail to born 'java.lang.Integer'
by args: [
@(/*net.wendal.nutzbook.bean.Role@85ec775*/{"id":1,"name":"admin","createTime":"2015-11-19 10:06:24","updateTime":"2015-11-19 10:06:24"})] becasue:
java.lang.NumberFormatException: For input string: "/*net.wendal.nutzbook.bean.Role@85ec775*/{"id":1,"name":"admin","createTime":"2015-11-19 10:06:24","updateTime":"2015-11-19 10:06:24"}"
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:17)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:967)
at org.nutz.lang.Lang.wrapThrow(Lang.java:164)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:133)
at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
at org.nutz.mvc.NutFilter.init(NutFilter.java:77)
at net.wendal.nutzbook.mvc.NutzBookNutFilter.init(NutzBookNutFilter.java:24)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.nutz.castor.FailToCastObjectException: Fail to cast from <net.wendal.nutzbook.bean.Role> to <java.lang.Integer> for {/*net.wendal.nutzbook.bean.Role@85ec775*/{"id":1,"name":"admin","createTime":"2015-11-19 10:06:24","updateTime":"2015-11-19 10:06:24"}} because:
BorningException:Fail to born 'java.lang.Integer'
by args: [
@(/*net.wendal.nutzbook.bean.Role@85ec775*/{"id":1,"name":"admin","createTime":"2015-11-19 10:06:24","updateTime":"2015-11-19 10:06:24"})] becasue:
java.lang.NumberFormatException: For input string: "/*net.wendal.nutzbook.bean.Role@85ec775*/{"id":1,"name":"admin","createTime":"2015-11-19 10:06:24","updateTime":"2015-11-19 10:06:24"}"
at org.nutz.castor.Castors.cast(Castors.java:258)
at org.nutz.castor.Castors.castTo(Castors.java:320)
at org.nutz.castor.castor.Collection2Object.cast(Collection2Object.java:17)
at org.nutz.castor.castor.Collection2Object.cast(Collection2Object.java:9)
at org.nutz.castor.Castors.cast(Castors.java:252)
at org.nutz.castor.Castors.castTo(Castors.java:320)
at org.nutz.dao.impl.sql.NutStatement.getObject(NutStatement.java:117)
at org.nutz.dao.impl.sql.NutStatement.getInt(NutStatement.java:121)
at org.nutz.dao.impl.NutDao.each(NutDao.java:469)
at org.nutz.dao.impl.NutDao.each(NutDao.java:473)
at net.wendal.nutzbook.service.AuthorityServiceImpl.initFormPackage(AuthorityServiceImpl.java:69)
at net.wendal.nutzbook.MainSetup.init(MainSetup.java:147)
at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:270)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:119)
... 16 more
Caused by: java.lang.NumberFormatException: For input string: "/*net.wendal.nutzbook.bean.Role@85ec775*/{"id":1,"name":"admin","createTime":"2015-11-19 10:06:24","updateTime":"2015-11-19 10:06:24"}"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:569)
at java.lang.Integer.<init>(Integer.java:867)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.nutz.lang.born.ConstructorCastingBorning.born(ConstructorCastingBorning.java:21)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:967)
at org.nutz.castor.castor.Object2Object.cast(Object2Object.java:12)
at org.nutz.castor.Castors.cast(Castors.java:252)
... 29 more
十一月 24, 2015 4:09:50 下午 org.apache.catalina.core.StandardContext startInternal
严重: Error filterStart