Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.b.45转换为json时,报空指针 (getter方法调用失败) #343

Closed
for5million opened this issue Oct 31, 2012 · 12 comments
Closed

1.b.45转换为json时,报空指针 (getter方法调用失败) #343

for5million opened this issue Oct 31, 2012 · 12 comments
Milestone

Comments

@for5million
Copy link

错误信息

java.lang.RuntimeException: Fail to invoke getter org.nutz.el.opt.TwoTernary.'getLeft()' because [java.lang.NullPointerException]: null
    at org.nutz.lang.Lang.makeThrow(Lang.java:89) ~[nutz-1.b.45.jar:na]
    at org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:26) ~[nutz-1.b.45.jar:na]
    at org.nutz.json.entity.JsonEntityField.getValue(JsonEntityField.java:121) ~[nutz-1.b.45.jar:na]
    at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:227) ~[nutz-1.b.45.jar:na]
    at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) ~[nutz-1.b.45.jar:na]
    at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) ~[nutz-1.b.45.jar:na]
    at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) ~[nutz-1.b.45.jar:na]
    at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) ~[nutz-1.b.45.jar:na]
    at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) ~[nutz-1.b.45.jar:na]
    at org.nutz.json.impl.JsonRenderImpl.coll2Json(JsonRenderImpl.java:320) ~[nutz-1.b.45.jar:na]

错误产生:

public class IdEntity {
    @Id(auto = false)
    @Prev(els = @EL("$me.initId()"))
    @ColDefine(type = ColType.INT, width = 20)
    @Comment("主键")
    public long id;

    public long initId() {
             return 0L;
    }
}

这个idEntity只有进行json序列化就产生该异常。

@wendal
Copy link
Member

wendal commented Oct 31, 2012

把完整的堆栈贴出来,怎么我觉得不是id字段的错误

而是某个getXXX方法的问题

@for5million
Copy link
Author

完整的错误:
java.lang.RuntimeException: Fail to invoke getter org.nutz.el.opt.TwoTernary.'getLeft()' because [java.lang.NullPointerException]: null
at org.nutz.lang.Lang.makeThrow(Lang.java:89) ~[nutz-1.b.45.jar:na]
at org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:26) ~[nutz-1.b.45.jar:na]
at org.nutz.json.entity.JsonEntityField.getValue(JsonEntityField.java:121) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:227) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.coll2Json(JsonRenderImpl.java:320) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:79) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.coll2Json(JsonRenderImpl.java:320) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:79) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.map2Json(JsonRenderImpl.java:177) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:75) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.coll2Json(JsonRenderImpl.java:320) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:79) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.map2Json(JsonRenderImpl.java:177) ~[nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:75) ~[nutz-1.b.45.jar:na]
at org.nutz.json.Json.toJson(Json.java:171) ~[nutz-1.b.45.jar:na]
at org.nutz.json.Json.toJson(Json.java:141) ~[nutz-1.b.45.jar:na]
at org.nutz.json.Json.toJson(Json.java:127) ~[nutz-1.b.45.jar:na]
at org.nutz.dao.entity.Record.toString(Record.java:144) ~[nutz-1.b.45.jar:na]
at java.lang.String.valueOf(String.java:2826) ~[na:1.6.0_24]
at java.util.Arrays.toString(Arrays.java:4071) ~[na:1.6.0_24]
at org.nutz.log.impl.AbstractLog.makeInfo(AbstractLog.java:67) ~[nutz-1.b.45.jar:na]
at org.nutz.log.impl.AbstractLog.debugf(AbstractLog.java:79) ~[nutz-1.b.45.jar:na]
at org.nutz.aop.interceptor.LoggingMethodInterceptor.filter(LoggingMethodInterceptor.java:70) ~[nutz-1.b.45.jar:na]
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:59) ~[nutz-1.b.45.jar:na]
at cn.vko.webconsult.module.ConsultQueryModule$$NUTZAOP.go2Pub(ConsultQueryModule.java) ~[na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_24]
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:22) ~[nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33) ~[nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:40) ~[nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:85) ~[nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27) ~[nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15) ~[nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:36) ~[nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:66) [nutz-1.b.45.jar:na]
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:30) [nutz-1.b.45.jar:na]
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:97) [nutz-1.b.45.jar:na]
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) [jetty-6.1.6.jar:6.1.6]
at cn.vko.filter.RequestAttributeFilter.doFilter(RequestAttributeFilter.java:49) [classes/:na]
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) [jetty-6.1.6.jar:6.1.6]
at cn.vko.filter.NoSessionFilter.doFilter(NoSessionFilter.java:36) [classes/:na]
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) [jetty-6.1.6.jar:6.1.6]
at cn.vko.filter.SSOAuthFilter.doFilter(SSOAuthFilter.java:78) [classes/:na]
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) [jetty-6.1.6.jar:6.1.6]
at cn.vko.filter.EncodingFilter.doFilter(EncodingFilter.java:33) [classes/:na]
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.Server.handle(Server.java:324) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450) [jetty-util-6.1.6.jar:6.1.6]

@for5million
Copy link
Author

由此引发另一个错误:
2012-10-31 09:45:11 -Fail to value by getter
java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_24]
at org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:21) ~[nutz-1.b.45.jar:na]
at org.nutz.json.entity.JsonEntityField.getValue(JsonEntityField.java:121) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:227) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.coll2Json(JsonRenderImpl.java:320) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:79) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.coll2Json(JsonRenderImpl.java:320) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:79) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.map2Json(JsonRenderImpl.java:177) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:75) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:245) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:88) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.coll2Json(JsonRenderImpl.java:320) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:79) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.appendPair(JsonRenderImpl.java:126) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.writeItem(JsonRenderImpl.java:252) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.map2Json(JsonRenderImpl.java:177) [nutz-1.b.45.jar:na]
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:75) [nutz-1.b.45.jar:na]
at org.nutz.json.Json.toJson(Json.java:171) [nutz-1.b.45.jar:na]
at org.nutz.json.Json.toJson(Json.java:141) [nutz-1.b.45.jar:na]
at org.nutz.json.Json.toJson(Json.java:127) [nutz-1.b.45.jar:na]
at org.nutz.dao.entity.Record.toString(Record.java:144) [nutz-1.b.45.jar:na]
at java.lang.String.valueOf(String.java:2826) [na:1.6.0_24]
at java.util.Arrays.toString(Arrays.java:4071) [na:1.6.0_24]
at org.nutz.log.impl.AbstractLog.makeInfo(AbstractLog.java:67) [nutz-1.b.45.jar:na]
at org.nutz.log.impl.AbstractLog.debugf(AbstractLog.java:79) [nutz-1.b.45.jar:na]
at org.nutz.aop.interceptor.LoggingMethodInterceptor.filter(LoggingMethodInterceptor.java:70) [nutz-1.b.45.jar:na]
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:59) [nutz-1.b.45.jar:na]
at cn.vko.webconsult.module.ConsultQueryModule$$NUTZAOP.go2Pub(ConsultQueryModule.java) [na:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_24]
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:22) [nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33) [nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:40) [nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:85) [nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27) [nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) [nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15) [nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:36) [nutz-1.b.45.jar:na]
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:66) [nutz-1.b.45.jar:na]
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:30) [nutz-1.b.45.jar:na]
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:97) [nutz-1.b.45.jar:na]
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) [jetty-6.1.6.jar:6.1.6]
at cn.vko.filter.RequestAttributeFilter.doFilter(RequestAttributeFilter.java:49) [classes/:na]
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) [jetty-6.1.6.jar:6.1.6]
at cn.vko.filter.NoSessionFilter.doFilter(NoSessionFilter.java:36) [classes/:na]
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) [jetty-6.1.6.jar:6.1.6]
at cn.vko.filter.SSOAuthFilter.doFilter(SSOAuthFilter.java:78) [classes/:na]
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) [jetty-6.1.6.jar:6.1.6]
at cn.vko.filter.EncodingFilter.doFilter(EncodingFilter.java:33) [classes/:na]
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:404) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.Server.handle(Server.java:324) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) [jetty-6.1.6.jar:6.1.6]
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450) [jetty-util-6.1.6.jar:6.1.6]
Caused by: java.lang.NullPointerException: null
at org.nutz.el.opt.object.AccessOpt.calculate(AccessOpt.java:33) ~[nutz-1.b.45.jar:na]
at org.nutz.el.opt.TwoTernary.getLeft(TwoTernary.java:30) ~[nutz-1.b.45.jar:na]

@for5million
Copy link
Author

呵呵 兽兽麻烦你了!

@wendal
Copy link
Member

wendal commented Nov 1, 2012

getLeft()的返回值是什么呢?
不过,最新的代码里面,已经放弃这种无声明的getter调用,改为主动声明

so, 你可以试试最新的代码

@for5million
Copy link
Author

我们是用的 lombok来实现的自动产生get和set

@wendal
Copy link
Member

wendal commented Nov 4, 2012

你用了 @JsonField(getBy) ?? 贴出来?

@for5million
Copy link
Author

没有用啊,我就是定义了一个那样的实体
@DaTa
public class IdEntity {
@id(auto = false)
@Prev(els = @el("$me.initId()"))
@Coldefine(type = ColType.INT, width = 20)
@comment("主键")
public long id;

public long initId() {
         return 0L;
}
private String name;

}
然后使用LoggingMethodInterceptor,将日志调成debug,然后return new IdEntity();
就出现了

@for5million
Copy link
Author

我跟到最后发现,是调用了 MethodOpt对象的getLeft方法,但是MethodOpt根本没有getLeft方法。
我再问一个问题,如果设置了@el表达式,可不可以json的时候,不处理这个El表达式。
@id(auto = false)
@Prev(els = @el("$me.initId()"))
@Coldefine(type = ColType.INT, width = 20)
@comment("主键")
public long id;

@JsonField(getBy="xxx") 这个应该怎么填?

@wendal
Copy link
Member

wendal commented Nov 7, 2012

最后发现是Record.toString()过程中的异常

@zozoh
Copy link
Member

zozoh commented Nov 20, 2012

lombz ...

@wendal
Copy link
Member

wendal commented Mar 7, 2013

额? 没事了吧?我关掉了

@wendal wendal closed this as completed Mar 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants