我正在尝试设置一个基于JSF的XPage应用程序。在其中一个控制器中,我试图使用全局定义的bean:
<managed-bean>
<managed-bean-name>servicePositionBean</managed-bean-name>
<managed-bean-class>beans.ServicePositionBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
我认为它失败的地方:
FacesContext context = FacesContext.getCurrentInstance();
return context.getApplication().getVariableResolver().resolveVariable(context, "servicePositionBean");
我得到的错误:
javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: beans/ServicePositionBean
com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:142)
com.ibm.xsp.component.UIViewRootEx.initBeforeContents(UIViewRootEx.java:1621)
com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:333)
com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:256)
com.ibm.xsp.page.compiled.AbstractCompiledPage.createViewRoot(AbstractCompiledPage.java:167)
com.ibm.xsp.application.ViewHandlerExImpl._createViewRoot(ViewHandlerExImpl.java:521)
com.ibm.xsp.application.ViewHandlerExImpl.createViewRoot(ViewHandlerExImpl.java:567)
com.ibm.xsp.application.ViewHandlerExImpl.doCreateView(ViewHandlerExImpl.java:142)
com.ibm.xsp.application.ViewHandlerEx.createView(ViewHandlerEx.java:90)
我100%确定bean是在目录中正确定义的。