gpt4 book ai didi

java - 严重 : java. lang.NullPointerException GAE + PrimeFaces + Spring + Maven,BookList 应用程序

转载 作者:行者123 更新时间:2023-12-01 15:42:07 24 4
gpt4 key购买 nike

运行 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.

最佳答案

这表明 bookDAO 可能为 null。这是要检查的第一件事...您如何设置 bookDAO 字段?

关于java - 严重 : java. lang.NullPointerException GAE + PrimeFaces + Spring + Maven,BookList 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7889294/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com