• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF, the exception NullPointerException  RSS feed

 
Sophia sophia
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone!

I'm working with JPA,JSf, and i have a small problem: when I run this programm , l'exception NullPointerException is launched: here is my code
:

Please I need your help :)
 
Ashley Bye
Ranch Hand
Posts: 134
2
Java Mac
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Salut Sophie. Bienvenue à JavaRanch.

You don't need the main method inside a bean. Does the method membreFacade.findAll() exist, or are you trying to run a named query? I would suspect that nothing is being returned from the method, given the NullPointerException, which makes me think you are trying to find the size of null. Why do you assign:

only to then assign null on the following line?

If you are not sure that anything is being returned by the findAll() message to membreFacade you could try putting the println() statement from main in the init() method after the try/catch block - just make sure you remove the assignment to null first.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could mention a few other things as well. Once you've repaired your display name.
 
Ashley Bye
Ranch Hand
Posts: 134
2
Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:Once you've repaired your display name.


JavaRanch Naming Policy
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!