• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

persist() null pointer exception

 
Ranch Hand
Posts: 185
Netbeans IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please include the exception stack trace.
 
And when my army is complete, I will rule the world! But, for now, I'm going to be happy with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic