Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Null pointer exception:could not get value from bean

 
jas preet
Ranch Hand
Posts: 78
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 78
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks !!! resolved
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic