my dog learned polymorphism
The moose likes JSF and the fly likes java.lang.NullPointerException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "java.lang.NullPointerException" Watch "java.lang.NullPointerException" New topic


leonardo ginting
Ranch Hand

Joined: Jul 25, 2011
Posts: 48
hi guys how do i could fix this error


thanks in advance
Bajrang Asthana
Ranch Hand

Joined: May 24, 2011
Posts: 32
When you try to access any property of an object that is null or have no instance attached with it.

for example:

Class Test{
int x;
public int getX(){
return x;
public void static main(String args[]){

Test test =null;
test.getX(); // Here you get java.lang.NullPointerException



to deal with this exception, you should first check the reference of object for null then access any method or property of associated to an object.

something similar-

if(null != test){
H Jetly
Ranch Hand

Joined: Aug 26, 2010
Posts: 41

I think you should post such questions in Java In General Forum

Harsh Jetly
leonardo ginting
Ranch Hand

Joined: Jul 25, 2011
Posts: 48
hi guys thanks for reply this is about jsf and richfaces so i post in this section
b.t.w this is my code please corect me
ok first this is error i' got
when i tried to click edit button so when popup panel is appear then i change the value in the field then i click save button then this error come out

this is my code

help me out please,...
if you think that im wrong please tell me what should i change or add the code

thanks guys
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

So which line in your sample code is "line 30"?

An IDE is no substitute for an Intelligent Developer.
leonardo ginting
Ranch Hand

Joined: Jul 25, 2011
Posts: 48
Tim Holloway wrote:So which line in your sample code is "line 30"?

hi tim thanks for reply in those line,,
line 30 is at line 14
Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 199
Check whether controller is null or whether getKelompokBiayaJpaController() method returns null. Based on your error message (I presume that you showed the root cause correctly) the controller object is null. So you have to find out why either MasterBiyanMbean is not present or why fetching the object does not work. Very basic stuff (null checks and all).
I agree. Here's the link:
subject: java.lang.NullPointerException
It's not a secret anymore!