aspose file tools*
The moose likes Spring and the fly likes Null pointer exception:could not get value from bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Null pointer exception:could not get value from bean" Watch "Null pointer exception:could not get value from bean" New topic
Author

Null pointer exception:could not get value from bean

jas preet
Ranch Hand

Joined: Mar 31, 2010
Posts: 78


The above is my bean class .. and i have use bean.xml to inject the values


And i want to get the password value as in below class



The run time exception[Null Pointer Exception] is thrown in 8th line of the above code ..What should i do.


Thanks Jaspreet ----- Nothing is permanent
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Line 8? I doubt it. Line 9, probably.

You're just instantiating a new UserDetail--you're not using Spring at all, so there won't be any value in the password, hence the NPE.
jas preet
Ranch Hand

Joined: Mar 31, 2010
Posts: 78

Thanks !!! resolved
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Null pointer exception:could not get value from bean