Skip to Main Content

NullPointerException When trying to Get Session Scoped Bean data in another ManagedBean

sofianeJul 28 2013 — edited Jul 30 2013


i wont to access to some data in my session scoped bean from a request bean so when i try to get this data all i get is 

com.sun.faces.mgbean.ManagedBeanCreationException: An error occurred performing resource injection
on managed bean

in the end of the exception there is

Caused by: java.lang.NullPointerException at Hiber.discussionlaoder.init(

this is my code:

1-the request scoped bean

public class discussionlaoder {

  private MyadmninHelper halper;

     private ServicesBean  serviceBean;
    public void init() {
      halper=getServiceBean().getHalper();  // line 35


//seter and geter code


2-the sesions scoped bean

@ManagedBean (eager=true)
public class ServicesBean {

    private MyadmninHelper halper;

//seter and geter code


am using glassfish server 3.1

thank's for help

Post Details
Added on Jul 28 2013