在我搜索期间,我想对我的问题有所帮助:
所以这是我的错误,跟踪:
VelocityView : Error processing a template for path '/comptes/affilies.html.vtl'
Invocation of method 'getRemunerationVendeur' in class model.User threw exception java.lang.NullPointerException at /comptes/affilies.html.vtl[line 28, column 20]
java.lang.NullPointerException
at model.User.getListRemunerationVendeur(User.java:238)
at model.User.getRemunerationVendeur(User.java:268)
at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.velocity.runtime.parser.node.PropertyExecutor.execute(PropertyExecutor.java:127)
at org.apache.velocity.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:523)
at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:198)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:271)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:561)
at org.apache.velocity.runtime.directive.VelocimacroProxy.handleArgValues(VelocimacroProxy.java:325)
at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:189)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:300)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.directive.Foreach.renderBlock(Foreach.java:281)
at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:258)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.apache.velocity.Template.merge(Template.java:356)
at org.apache.velocity.Template.merge(Template.java:260)
at org.apache.velocity.tools.view.VelocityView.performMerge(VelocityView.java:942)
at org.apache.velocity.tools.view.VelocityView.merge(VelocityView.java:902)
at org.apache.velocity.tools.view.VelocityViewServlet.mergeTemplate(VelocityViewServlet.java:318)
at org.apache.velocity.tools.view.VelocityViewServlet.doRequest(VelocityViewServlet.java:220)
at org.apache.velocity.tools.view.VelocityViewServlet.doGet(VelocityViewServlet.java:182)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:120)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:97)
at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:109)
at filter.AuthFilter.doRedirect(AuthFilter.java:54)
at velosurf.web.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:392)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
at filter.DateFilter.doFilter(DateFilter.java:309)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:156)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:289)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:838)
at com.caucho.network.listen.TcpSocketLink.dispatchRequest(TcpSocketLink.java:1345)
at com.caucho.network.listen.TcpSocketLink.handleRequest(TcpSocketLink.java:1301)
at com.caucho.network.listen.TcpSocketLink.handleRequestsImpl(TcpSocketLink.java:1285)
at com.caucho.network.listen.TcpSocketLink.handleRequests(TcpSocketLink.java:1193)
at com.caucho.network.listen.TcpSocketLink.handleAcceptTaskImpl(TcpSocketLink.java:992)
at com.caucho.network.listen.ConnectionTask.runThread(ConnectionTask.java:117)
at com.caucho.network.listen.ConnectionTask.run(ConnectionTask.java:93)
at com.caucho.network.listen.SocketLinkThreadLauncher.handleTasks(SocketLinkThreadLauncher.java:169)
at com.caucho.network.listen.TcpSocketAcceptThread.run(TcpSocketAcceptThread.java:61)
at com.caucho.env.thread2.ResinThread2.runTasks(ResinThread2.java:173)
at com.caucho.env.thread2.ResinThread2.run(ResinThread2.java:118)
Normally the class User.java works.
This is a piece of my class java (User.java) that corresponds to my error :
Instance service = (Instance)db.get("service_by_code");
vendeur.put("ope_code", operateur.get("ope_code"));
vendeur.put("srv_code", service.get("srv_code"));
我的变量服务对应于我的数据库中的结果行。
我认为我的行在数据库中是NULL(因为nullPointerException主要是...一个对象设置为NULL!)但我不知道在我的数据库中解决问题:更改行中的值我的数据库。
我试了但是没有改变。
如果您有任何建议,请。
啤酒。
答案 0 :(得分:0)
看起来,就像你的对象Instance为NULL,因为你使用DB。 无论如何,如果您给出异常的堆栈跟踪,那么应该很好,所以没有人会尝试猜测。