I have two beans:
@Named
@SessionScoped
public class Session implements Serializable {
private String temp;
+getter, setter
}
@Named
@RequestScoped
public class Test {
@Inject
private Session s;
@PostConstruct
public void init() {
this.sth = s.getTemp(); //here is exception
}
}
When I try to fetch in init same value from session I get NullPointerException. What am I doing wrong? Server is JBoss eap 6.0, JSF v2.1. Thanks in advance
Edit: I investigated that problem appears only when I have more than 11 items in primefaces submenu component. If I have less than 11 items every thinks work OK. I am using PrimeFaces v 3.5. Edit 2: On session bean only constructor is invoked. I have method annotated with PostConstruct but it is not called. I always get NullPointerException after invoking any method on session from Test bean.