严重:java.lang.NullPointerException GAE + PrimeFaces +春天 + Maven、图书列表应用程序
在运行 GAE + PrimeFaces + Spring + Maven 、BookList 应用程序时, 使用 JDO 将书名和作者保存到数据存储区时出现一些错误。 喜欢,
**Oct 25, 2011 11:10:24 AM javax.faces.event.MethodExpressionActionListener processAction
SEVERE: Received 'java.lang.NullPointerException' when invoking action listener '# {createBook.save}' for component 'j_idt11'
Oct 25, 2011 11:10:24 AM javax.faces.event.MethodExpressionActionListener processAction
SEVERE: java.lang.NullPointerException**
error with the highlighted line.Please give a solution.
public void save(ActionEvent actionEvent) {
System.out.println("in actionEvent");
**bookDAO.persist(book);** //getting values here correctly.But cannot save!
FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_INFO, "Info", "Book is saved");
FacesContext.getCurrentInstance().addMessage(null, facesMessage);
book = new MyBook();
}
thanks.
While running GAE + PrimeFaces + Spring + Maven ,BookList application,
got some errors on saving book title and author in to Datastore using JDO.
like,
**Oct 25, 2011 11:10:24 AM javax.faces.event.MethodExpressionActionListener processAction
SEVERE: Received 'java.lang.NullPointerException' when invoking action listener '# {createBook.save}' for component 'j_idt11'
Oct 25, 2011 11:10:24 AM javax.faces.event.MethodExpressionActionListener processAction
SEVERE: java.lang.NullPointerException**
error with the highlighted line.Please give a solution.
public void save(ActionEvent actionEvent) {
System.out.println("in actionEvent");
**bookDAO.persist(book);** //getting values here correctly.But cannot save!
FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_INFO, "Info", "Book is saved");
FacesContext.getCurrentInstance().addMessage(null, facesMessage);
book = new MyBook();
}
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这表明
bookDAO
可能为 null。这是要检查的第一件事...您如何设置bookDAO
字段?That suggests that
bookDAO
is probably null. That's the first thing to check... how are you setting thebookDAO
field?