Menu

Problem: Persistence Tutorial 10

Rupert
2008-04-07
2013-04-09
  • Rupert

    Rupert - 2008-04-07

    This tutorial is excellent in all respects (as was the Total Beginners tutorial).

    But I have hit a bit of a problem in tutorial 10.  Prior to including newMyLibrary.printStatus() MyLibrary ran perfectly, but its inclusion resulted in the following output:

    Printing information from saved xml file.
    Status Report of MyLibrary:
    Test Drive Library: 2 books; 2 people.
    War and Peace by Tolstoy; Available
    Great Expectations by Charles Dickens; Checked out to Jim
    Exception in thread "main" java.lang.NullPointerException
        at org.persistence.tutorial.MyLibrary.getBooksForPerson(MyLibrary.java:76)
        at org.persistence.tutorial.MyLibrary.printStatus(MyLibrary.java:159)
        at org.persistence.tutorial.MyLibrary.main(MyLibrary.java:146)

    Also, on inspection, p1 in the getBooksForPerson method is shown to be null.

    Could anyone please assist?
    Rupert

    Regards,
    Rupert

     
    • Mark Dexter

      Mark Dexter - 2008-04-08

      Hi Rupert. Could you please paste in the entire MyLibrary and MyUtilities source code? Then I can try it here and see what the problem is. Thanks. Mark

       

Log in to post a comment.