Uninitialized email address causes a null pointer exception
When I define an entity (e.g. Project) with an email field and create a new project without explicitly initializing the email field. I get a null pointer exception even when I check for null pointers in the application. The npe is caused by the following code:
if( !(org.webdsl.tools.Utils.equal(this.getEmail().length(), null) ||
org.webdsl.tools.Utils.equal(255, null)) &&
this.getEmail().length() > 255
)which is triggered by this call:
if(!ThreadLocalPage.get().isRollback())
{
ThreadLocalPage.get().validateEntitiesAfterAction();
}The stack trace:
Submitted by Sander Vermolen on 7 March 2011 at 12:43
java.lang.NullPointerException
at webdsl.generated.domain.Project.validateEmail_internal_(Project.java:591)
at webdsl.generated.domain.Project.validateSave_(Project.java:840)
at webdsl.generated.domain.Project.validateSave(Project.java:24)
at utils.AbstractPageServlet.validateEntitiesAfterAction(AbstractPageServlet.java:202)
at webdsl.generated.templates.createIssue_ta8_s_ad0StringProjectTagListTagIssueStringEmailTag_Template$1.run(createIssue_ta8_s_ad0StringPr
ojectTagListTagIssueStringEmailTag_Template.java:395)
at webdsl.generated.templates.createIssue_ta8_s_ad0StringProjectTagListTagIssueStringEmailTag_Template.handleActionsInternal(createIssue_t
a8_s_ad0StringProjectTagListTagIssueStringEmailTag_Template.java:292)
at utils.TemplateServlet.handleActions(TemplateServlet.java:55)
at webdsl.generated.templates.wrapsubmitString_Template.handleActionsInternal(wrapsubmitString_Template.java:414)
at utils.TemplateServlet.handleActions(TemplateServlet.java:55)
at webdsl.generated.templates.createIssue_ta8TagEmailStringIssueListTagTagProject_Template.handleActionsInternal(createIssue_ta8TagEmailSt
ringIssueListTagTagProject_Template.java:415)
at utils.TemplateServlet.handleActions(TemplateServlet.java:55)
at webdsl.generated.templates.par_Template.handleActionsInternal(par_Template.java:245)
at utils.TemplateServlet.handleActions(TemplateServlet.java:55)
at webdsl.generated.templates.createIssue_body0ListTagTagProject_Template.handleActionsInternal(createIssue_body0ListTagTagProject_Templat
e.java:1733)
at utils.TemplateServlet.handleActions(TemplateServlet.java:55)
at webdsl.generated.templates.main_Template.handleActionsInternal(main_Template.java:912)
at utils.TemplateServlet.handleActions(TemplateServlet.java:55)
at webdsl.generated.templates.createIssueProjectTag_Template.handleActionsInternal(createIssueProjectTag_Template.java:344)
at utils.TemplateServlet.handleActions(TemplateServlet.java:55)
at webdsl.generated.templates.createIssue_Template.handleActionsInternal(createIssue_Template.java:254)
at utils.TemplateServlet.handleActions(TemplateServlet.java:55)
at webdsl.generated.templates.CreateIssuePage.serve(CreateIssuePage.java:108)
at utils.DispatchServletHelper.handlePage(DispatchServletHelper.java:563)
at utils.DispatchServletHelper.doServe(DispatchServletHelper.java:522)
at utils.DispatchServlet.doPost(DispatchServlet.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:774)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:896)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
Log in to post comments