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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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