到目前为止,我有:Social Business Toolkit示例应用程序如何使用managed-beans.xml?
- 安装和我的WebSphere Application 服务器,
- 增加了一个URL资源的SBT属性文件启动
sbt.sample-1.0.0.20140125-1133.ear
。
Social Business Toolkit示例应用运行良好,我可以连接到IBM Connections并检索一些ActivityStream条目。
当我第一次加载应用程序,我注意到了这个错误:
Exception stack trace: com.ibm.websphere.naming.CannotInstantiateObjectException: A NameNotFoundException occurred on an indirect lookup on the name java:comp/env/url/ibmsbt-managedbeansxml. The name java:comp/env/url/ibmsbt-managedbeansxml maps to a JNDI name in deployment descriptor bindings for the application performing the JNDI lookup. Make sure that the JNDI name mapping in the deployment descriptor binding is correct. If the JNDI name mapping is correct, make sure the target resource can be resolved with the specified name relative to the default initial context.
在样本应用程序的ibm-web-bnd.xml
文件,我发现这行:
<resource-ref name="url/ibmsbt-managedbeansxml" binding-name="url/ibmsbt-managedbeansxml" />
而在web.xml
:
<resource-ref>
<description>Reference to a URL resource which points to the managed bean configuration for the Social Business Toolkit.</description>
<res-ref-name>url/ibmsbt-managedbeansxml</res-ref-name>
<res-type>java.net.URL</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
我想知道,为什么应该有一个URL资源的JSF应用程序配置资源文件(managed-beans.xml
)首先?根据Java EE文档,JavaServer Faces实现将在/WEB-INF/
文件夹中查找它。
SBT是否在某处使用JavaServer Faces技术?或者我可以选择不使用managed-beans.xml
文件在我自己的应用程序中使用SBT?
感谢您的快速回复! – magnetronnie
我要求马克验证答案,所以如果有任何更新,他会添加一个答案 –