I’ve been dealing with a problem all afternoon and can’t find an answer or find a solution. I found on many places how to reach the xpages context objects in java (not SSJS) but i’m not able to successfully use it on my user/managed bean.
Inside my bean I’m trying to get viewScope object this way:
Object o = Context.getApplication().getVariableResolver().resolveVariable(context, “viewScope”);
The script stops right on first line throwing a ClassNotFoundException for FacesContext. It looks the class is not visible on the bean execution environment.
Is this supposed to happen? what am i missing here?
Well… after digging a bit more on the problem and searching for JSF documentation I realized the problem comes because the jsf/xsp environment runs different classpaths or threads. I was developing beans in Eclipse and pushing the jar’s into the servers ext folder like I always did in previous versions of domino. It looks like the FacesContext doesn’t run on the same thread as the classes deployed into ext folder. Something like that. I even tried to put the jsf jar’s containing the FacesContext class into ext folder. Calling FacesContext.getCurrentInstance() the method was returning null.
The only way to solve this problem is to develop the classes inside the domino database where the FacesContext can be reached in the same thread. Now sometimes I’m facing the internal class loader error when changing my classes in the database. It look’s like the server/database is not always aware of the changes in the classes. Sometime it runs the old code. Hope I can find why this is happening.
Thanks and hope this can help someone with same issues.