NutzCN Logo
问答 关于用nutz开发restful api遇到的问题
发布于 3124天前 作者 qq_6b8e56db 2873 次浏览 复制 上一个帖子 下一个帖子
标签:

使用了demo的框架,在shiro里面设置了/json/** = anon

@IocBean
@At("/json/areaInfoModel")
public class AreaInfoModelModuleJSON {

@Inject
private AreaInfoModelService areaInfoModelService;

/**
 * 
 * @description 根据主键查询Bean
 * 
 */
@At
@Ok("json")
@POST
public Long saveOrUpdate(@Param("..") AreaInfoModel obj) {
    return areaInfoModelService.saveOrUpdate(obj);
}

}

然后用restclient发送post请求http://localhost:8080/hlqxs/json/areaInfoModel/saveOrUpdate
{
"areaFatherId": null,
"areaId": "289",
"areaName": "中东",
"areaRemark": "",
"addUnitId": "9bc2dc100fb4487a8828791dedb5fb05",
"addUser": 2

}

报了如下错误
2016-06-03 14:28:07,887 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:92) DEBUG - Found mapping for [POST] path=/json/areaInfoModel/saveOrUpdate : AreaInfoModelModuleJSON.saveOrUpdate(...)
2016-06-03 14:28:07,887 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:145) DEBUG - Get 'areaInfoModelModuleJSON'<class cn.wizzer.modules.lock.model.json.AreaInfoModelModuleJSON>
2016-06-03 14:28:07,888 cn.wizzer.common.mvc.processor.LogTimeProcessor.process(LogTimeProcessor.java:26) DEBUG - [POST]URI=/hlqxs/json/areaInfoModel/saveOrUpdate 1ms
2016-06-03 14:28:07,888 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) WARN - Error@/json/areaInfoModel/saveOrUpdate :
org.nutz.lang.born.BorningException: Fail to born 'cn.wizzer.modules.lock.model.AreaInfoModel' becasue: java.lang.NullPointerException
at org.nutz.lang.born.EmptyArgsConstructorBorning.born(EmptyArgsConstructorBorning.java:19)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:967)
at org.nutz.mvc.adaptor.injector.ObjectPairInjector.get(ObjectPairInjector.java:57)
at org.nutz.mvc.adaptor.AbstractAdaptor.adapt(AbstractAdaptor.java:247)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:28)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:40)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at cn.wizzer.common.mvc.processor.NutShiroProcessor.process(NutShiroProcessor.java:54)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:113)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at cn.wizzer.common.mvc.processor.XSSProcessor.process(XSSProcessor.java:49)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at cn.wizzer.common.mvc.processor.GlobalsSettingProcessor.process(GlobalsSettingProcessor.java:32)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at cn.wizzer.common.mvc.processor.LogTimeProcessor.process(LogTimeProcessor.java:21)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:183)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at cn.wizzer.common.mvc.filter.XssFilter.doFilter(XssFilter.java:22)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at cn.wizzer.modules.lock.entities.BaseBean.getCurrentUserId(BaseBean.java:71)
at cn.wizzer.modules.lock.entities.BaseBean.(BaseBean.java:36)
at cn.wizzer.modules.lock.entities.AreaInfo.(AreaInfo.java:13)
at cn.wizzer.modules.lock.model.AreaInfoModel.(AreaInfoModel.java:12)
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:423)
at org.nutz.lang.born.EmptyArgsConstructorBorning.born(EmptyArgsConstructorBorning.java:16)
... 60 more

11 回复

其实你多@一次反而看不到的,有新帖的时候,手机客户端有推送的,刷网站的时候看到有人回过,优先级反而低了(所以一次性把问题说清楚很重要)

你这个,就去缺了适配器,加上这个即可

@AdaptBy(type=JsonAdaptor.class)

另外,POJO必须有默认构造方法(无参数构造方法)

@wendal @AdaptBy(type=JsonAdaptor.class) 这个JsonAdaptor.class是指我的POJO是吧

不是啊, 那个注解就原样标在入口方法上

然后我说的pojo指的是AreaInfoModel这个类

@wendal 原来是我开始导错了,我加了无参构造方法还是报同样的错误呢。

贴现在的报错信息,用菜单里面代码块啊

2016-06-03 15:40:51,504 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:92) DEBUG - Found mapping for [POST] path=/json/areaInfoModel/saveOrUpdate : AreaInfoModelModuleJSON.saveOrUpdate(...)
2016-06-03 15:40:51,508 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:145) DEBUG - Get 'areaInfoModelModuleJSON'<class cn.wizzer.modules.lock.model.json.AreaInfoModelModuleJSON>
2016-06-03 15:40:51,508 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165) DEBUG - 	 >> Load definition
2016-06-03 15:40:51,509 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:144) DEBUG - Found IocObject(areaInfoModelModuleJSON) in IocLoader(AnnotationIocLoader@748382644)
2016-06-03 15:40:51,509 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:195) DEBUG - 	 >> Make...'areaInfoModelModuleJSON'<class cn.wizzer.modules.lock.model.json.AreaInfoModelModuleJSON>
2016-06-03 15:40:51,509 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:84) DEBUG - class cn.wizzer.modules.lock.model.json.AreaInfoModelModuleJSON without AOP
2016-06-03 15:40:51,510 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:59) DEBUG - Save object 'areaInfoModelModuleJSON' to [app] 
2016-06-03 15:40:51,510 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:145) DEBUG - Get 'areaInfoModelService'<>
2016-06-03 15:40:51,511 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165) DEBUG - 	 >> Load definition
2016-06-03 15:40:51,511 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:144) DEBUG - Found IocObject(areaInfoModelService) in IocLoader(AnnotationIocLoader@748382644)
2016-06-03 15:40:51,511 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:195) DEBUG - 	 >> Make...'areaInfoModelService'<>
2016-06-03 15:40:51,512 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:84) DEBUG - class cn.wizzer.modules.lock.service.AreaInfoModelService without AOP
2016-06-03 15:40:51,512 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:59) DEBUG - Save object 'areaInfoModelService' to [app] 
2016-06-03 15:40:51,512 org.nutz.service.EntityService.<init>(EntityService.java:36) DEBUG - Get TypeParams for self : cn.wizzer.modules.lock.model.AreaInfoModel
2016-06-03 15:40:51,512 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:145) DEBUG - Get 'dao'<>
2016-06-03 15:40:51,514 cn.wizzer.common.mvc.processor.LogTimeProcessor.process(LogTimeProcessor.java:26) DEBUG - [POST]URI=/hlqxs/json/areaInfoModel/saveOrUpdate 8ms
2016-06-03 15:40:51,516 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) WARN  - Error@/json/areaInfoModel/saveOrUpdate :
org.nutz.lang.born.BorningException: Fail to born 'cn.wizzer.modules.lock.model.AreaInfoModel' becasue: java.lang.NullPointerException
	at org.nutz.lang.born.EmptyArgsConstructorBorning.born(EmptyArgsConstructorBorning.java:19)
	at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
	at org.nutz.lang.Mirror.born(Mirror.java:967)
	at org.nutz.mapl.impl.convert.ObjConvertImpl.injectObj(ObjConvertImpl.java:186)
	at org.nutz.mapl.impl.convert.ObjConvertImpl.inject(ObjConvertImpl.java:81)
	at org.nutz.mapl.impl.convert.ObjConvertImpl.convert(ObjConvertImpl.java:65)
	at org.nutz.mapl.Mapl.maplistToObj(Mapl.java:34)
	at org.nutz.mvc.adaptor.injector.JsonInjector.get(JsonInjector.java:34)
	at org.nutz.mvc.adaptor.AbstractAdaptor.adapt(AbstractAdaptor.java:247)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:28)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:40)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.common.mvc.processor.NutShiroProcessor.process(NutShiroProcessor.java:54)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:113)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.common.mvc.processor.XSSProcessor.process(XSSProcessor.java:49)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.common.mvc.processor.GlobalsSettingProcessor.process(GlobalsSettingProcessor.java:32)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.common.mvc.processor.LogTimeProcessor.process(LogTimeProcessor.java:21)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:183)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at cn.wizzer.common.mvc.filter.XssFilter.doFilter(XssFilter.java:22)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at cn.wizzer.modules.lock.entities.BaseBean.getCurrentUserId(BaseBean.java:75)
	at cn.wizzer.modules.lock.entities.BaseBean.<init>(BaseBean.java:36)
	at cn.wizzer.modules.lock.entities.AreaInfo.<init>(AreaInfo.java:31)
	at cn.wizzer.modules.lock.model.AreaInfoModel.<init>(AreaInfoModel.java:18)
	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:423)
	at org.nutz.lang.born.EmptyArgsConstructorBorning.born(EmptyArgsConstructorBorning.java:16)
	... 64 more

@wendal

2016-06-03 15:40:51,504 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:92) DEBUG - Found mapping for [POST] path=/json/areaInfoModel/saveOrUpdate : AreaInfoModelModuleJSON.saveOrUpdate(...)
2016-06-03 15:40:51,508 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:145) DEBUG - Get 'areaInfoModelModuleJSON'<class cn.wizzer.modules.lock.model.json.AreaInfoModelModuleJSON>
2016-06-03 15:40:51,508 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165) DEBUG - 	 >> Load definition
2016-06-03 15:40:51,509 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:144) DEBUG - Found IocObject(areaInfoModelModuleJSON) in IocLoader(AnnotationIocLoader@748382644)
2016-06-03 15:40:51,509 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:195) DEBUG - 	 >> Make...'areaInfoModelModuleJSON'<class cn.wizzer.modules.lock.model.json.AreaInfoModelModuleJSON>
2016-06-03 15:40:51,509 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:84) DEBUG - class cn.wizzer.modules.lock.model.json.AreaInfoModelModuleJSON without AOP
2016-06-03 15:40:51,510 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:59) DEBUG - Save object 'areaInfoModelModuleJSON' to [app] 
2016-06-03 15:40:51,510 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:145) DEBUG - Get 'areaInfoModelService'<>
2016-06-03 15:40:51,511 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:165) DEBUG - 	 >> Load definition
2016-06-03 15:40:51,511 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:144) DEBUG - Found IocObject(areaInfoModelService) in IocLoader(AnnotationIocLoader@748382644)
2016-06-03 15:40:51,511 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:195) DEBUG - 	 >> Make...'areaInfoModelService'<>
2016-06-03 15:40:51,512 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:84) DEBUG - class cn.wizzer.modules.lock.service.AreaInfoModelService without AOP
2016-06-03 15:40:51,512 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:59) DEBUG - Save object 'areaInfoModelService' to [app] 
2016-06-03 15:40:51,512 org.nutz.service.EntityService.<init>(EntityService.java:36) DEBUG - Get TypeParams for self : cn.wizzer.modules.lock.model.AreaInfoModel
2016-06-03 15:40:51,512 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:145) DEBUG - Get 'dao'<>
2016-06-03 15:40:51,514 cn.wizzer.common.mvc.processor.LogTimeProcessor.process(LogTimeProcessor.java:26) DEBUG - [POST]URI=/hlqxs/json/areaInfoModel/saveOrUpdate 8ms
2016-06-03 15:40:51,516 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) WARN  - Error@/json/areaInfoModel/saveOrUpdate :
org.nutz.lang.born.BorningException: Fail to born 'cn.wizzer.modules.lock.model.AreaInfoModel' becasue: java.lang.NullPointerException
	at org.nutz.lang.born.EmptyArgsConstructorBorning.born(EmptyArgsConstructorBorning.java:19)
	at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
	at org.nutz.lang.Mirror.born(Mirror.java:967)
	at org.nutz.mapl.impl.convert.ObjConvertImpl.injectObj(ObjConvertImpl.java:186)
	at org.nutz.mapl.impl.convert.ObjConvertImpl.inject(ObjConvertImpl.java:81)
	at org.nutz.mapl.impl.convert.ObjConvertImpl.convert(ObjConvertImpl.java:65)
	at org.nutz.mapl.Mapl.maplistToObj(Mapl.java:34)
	at org.nutz.mvc.adaptor.injector.JsonInjector.get(JsonInjector.java:34)
	at org.nutz.mvc.adaptor.AbstractAdaptor.adapt(AbstractAdaptor.java:247)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:28)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:40)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.common.mvc.processor.NutShiroProcessor.process(NutShiroProcessor.java:54)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:113)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.common.mvc.processor.XSSProcessor.process(XSSProcessor.java:49)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.common.mvc.processor.GlobalsSettingProcessor.process(GlobalsSettingProcessor.java:32)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at cn.wizzer.common.mvc.processor.LogTimeProcessor.process(LogTimeProcessor.java:21)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:183)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at cn.wizzer.common.mvc.filter.XssFilter.doFilter(XssFilter.java:22)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at cn.wizzer.modules.lock.entities.BaseBean.getCurrentUserId(BaseBean.java:75)
	at cn.wizzer.modules.lock.entities.BaseBean.<init>(BaseBean.java:36)
	at cn.wizzer.modules.lock.entities.AreaInfo.<init>(AreaInfo.java:31)
	at cn.wizzer.modules.lock.model.AreaInfoModel.<init>(AreaInfoModel.java:18)
	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:423)
	at org.nutz.lang.born.EmptyArgsConstructorBorning.born(EmptyArgsConstructorBorning.java:16)
	... 64 more

@wendal 找到问题了,解决啦,多谢大师

额,那倒是说一下什么原因啊

“at cn.wizzer.modules.lock.entities.BaseBean.getCurrentUserId(BaseBean.java:75)” 这个原因?

添加回复
请先登陆
回到顶部