| Author |
persist() null pointer exception
|
Alan Smith
Ranch Hand
Joined: Oct 19, 2011
Posts: 150
|
|
Hi,
I have yet been able to insert a record into a table using the Entitymanager. Everytime I use the persist method I get a null pointer exception. I have a person entity with id(auto incrememted), name, job, salary,description, countyId(foreign key) in a MySql table call Person. My servlet creates a Manager class and passes in parameters submitted representing Person information.
The manager class looks like this:
The PersonFacade class i am using is a netbeans generated session bean:
and AbstractFacade is as follows:
edit: Person entity class
I can read person entries from the database using the personFacades findAll() method but I can't write to it using the create() method without a null pointer exception showing up. All the objects I use are not pointing to a null reference so I can't get my head around it! I have seen examples all over the net that use the persist method. Could someone please help?
Thanks
|
 |
James Sutherland
Ranch Hand
Joined: Oct 01, 2007
Posts: 550
|
|
Please include the exception stack trace.
|
TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
|
 |
 |
|
|
subject: persist() null pointer exception
|
|
|