JAR 文件中的 faces-config.xml 在两个 Domino 上的行为不同 [英] faces-config.xml in JAR file behaves differently on two Dominos

查看:22
本文介绍了JAR 文件中的 faces-config.xml 在两个 Domino 上的行为不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 bean 的分发包.为了为开发人员节省一些工作,它包含 faces-config.xml 声明 JAR 使用的 bean - 在 JAR 的 META-INF 目录中.

I have distribution package for beans. To save some work to developers it contains faces-config.xml declaring beans used by the JAR - inside META-INF directory of JAR.

JAR 位于 WebContent\WEB-INF\lib 中,并在 NSF 的构建路径中引用.

JAR is inside WebContent\WEB-INF\lib and referenced in build path of NSF.

开发服务器使用此设置,不需要对 NSF 内的 faces-config.xml 进行任何更改.但是通过开发服务器的模板复制或刷新的数据库不起作用 - 网页失败并出现错误:

Development server works with this setup and does not require any change to faces-config.xml inside NSF. But database made as copy or refreshed via template from development server does not work - web page fails with error:

Error while executing JavaScript computed expression
Script interpreter error, line=1, col=1: [ReferenceError] 'app' not found

其中 app 是应用程序作用域 bean 的名称.

where app is name of application scoped bean.

错误以完整的堆栈跟踪记录到 xpages_exc.log 中.

Error is logged into xpages_exc.log with full stacktrace.

两台服务器都是虚拟化的 Wintel、64 位 Windows、64 位 Domino.我查看了 xsp.properties、java.policy,它们是一样的.数据库由服务器签名.

Both servers are virtualized Wintels, 64bit Windows, 64bit Domino. I have looked into xsp.properties, java.policy, they are the same. Database is signed by server.

谁能解释一下?要检查什么?

Who can explain that? What to check?

堆栈跟踪:

Page Name: /home.xsp
Control id: _id2
Script interpreter error, line=1, col=1: **[ReferenceError] 'app' not found
->   1: app['fld_DbHomeKey'].getUrl() + 'icons.css'**
com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript computed expression
    at com.ibm.xsp.binding.javascript.JavaScriptValueBinding.getValue(JavaScriptValueBinding.java:132)
    at com.ibm.xsp.page.compiled.ExpressionEvaluatorImpl.getBindingValue(ExpressionEvaluatorImpl.java:151)
    at xsp.OneUILayout$OneUILayoutPage.initIncluderAsRoot(OneUILayout.java:113)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:249)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.addComponent(AbstractCompiledPage.java:389)
    at com.ibm.xsp.component.UIIncludeComposite.buildContents(UIIncludeComposite.java:453)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)
    at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildChildren(CompiledComponentBuilder.java:123)
    at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildAll(CompiledComponentBuilder.java:84)
    at com.ibm.xsp.component.UIViewRootEx.buildContents(UIViewRootEx.java:1649)
    at com.ibm.xsp.component.UIViewRootEx2.buildContents(UIViewRootEx2.java:246)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:256)
    at com.ibm.xsp.page.compiled.AbstractCompiledPage.createViewRoot(AbstractCompiledPage.java:167)
    at com.ibm.xsp.application.ViewHandlerExImpl._createViewRoot(ViewHandlerExImpl.java:511)
    at com.ibm.xsp.application.ViewHandlerExImpl.createViewRoot(ViewHandlerExImpl.java:557)
    at com.ibm.xsp.application.ViewHandlerExImpl.doCreateView(ViewHandlerExImpl.java:141)
    at com.ibm.xsp.application.ViewHandlerEx.createView(ViewHandlerEx.java:90)
    at com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:238)
    at com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:200)
    at com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
    at com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:137)
    at com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
    at com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
    at com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1267)
    at com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:847)
    at com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
    at com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
    at com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1251)
    at com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:598)
    at com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:421)
    at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:341)
    at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:297)
    at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
Caused by: com.ibm.jscript.InterpretException: Script interpreter error, line=1, col=1: [ReferenceError] 'app' not found
    at com.ibm.jscript.types.FBSReferenceByName$UndefinedVariable.getValue(FBSReferenceByName.java:49)
    at com.ibm.jscript.ASTTree.InterpretResult.getFBSValue(InterpretResult.java:70)
    at com.ibm.jscript.ASTTree.ASTArrayMember.interpret(ASTArrayMember.java:96)
    at com.ibm.jscript.ASTTree.ASTMember.interpret(ASTMember.java:106)
    at com.ibm.jscript.ASTTree.ASTCall.interpret(ASTCall.java:88)
    at com.ibm.jscript.ASTTree.binaryop.ASTBinaryAdd.interpret(ASTBinaryAdd.java:93)
    at com.ibm.jscript.ASTTree.ASTProgram.interpret(ASTProgram.java:119)
    at com.ibm.jscript.ASTTree.ASTProgram.interpretEx(ASTProgram.java:139)
    at com.ibm.jscript.JSExpression._interpretExpression(JSExpression.java:435)
    at com.ibm.jscript.JSExpression.access$1(JSExpression.java:424)
    at com.ibm.jscript.JSExpression$2.run(JSExpression.java:414)
    at java.security.AccessController.doPrivileged(AccessController.java:284)
    at com.ibm.jscript.JSExpression.interpretExpression(JSExpression.java:410)
    at com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:251)
    at com.ibm.jscript.JSExpression.evaluateValue(JSExpression.java:234)
    at com.ibm.xsp.javascript.JavaScriptInterpreter.interpret(JavaScriptInterpreter.java:221)
    at com.ibm.xsp.javascript.JavaScriptInterpreter.interpret(JavaScriptInterpreter.java:193)
    at com.ibm.xsp.binding.javascript.JavaScriptValueBinding.getValue(JavaScriptValueBinding.java:78)
    ... 33 more

app 是实现 Map 的 POJO bean,使用 getUrl 方法返回 POJO 对象,该方法返回应用程序资源的基本 url.无论如何,应用程序没有被定义——它没有被实例化,因为faces-config 有问题.

app is POJO bean implementing Map, returns POJO object with method getUrl which returns base url of application resources. Anyway, app is not defined - it is not instantiated, because of problem with faces-config.

推荐答案

您的 faces-config 和 xsp-config 文件应位于 src\META-INF 文件夹中,而不是插件的 META-INF 中.此外,您的插件应该有一个 Library 类.在那个类文件中应该有 2 个方法,称为 getXspConfigFiles() 和 getFacesConfigFiles().这两个方法应该包含一个字符串数组,列出您的所有 xsp-config 和 faces-config 文件,然后这些文件将可用于包含您的插件作为 Application Properties\Advanced\XPage Libraries 中资源的任何应用程序.如果您的插件没有出现在那里,请确保在 Domino Designer 中安装了该插件 jar 文件的副本,并且当您在服务器控制台上发出tell http ss osgi com.yournamespace"命令时,服务器可以识别您的插件.在服务器的结果输出中,它应该说<< LAZY >>"、ACTIVE"或RESOLVED"而不是INSTALLED",因为它只是说插件在服务器上但没有加载.

Your faces-config and xsp-config files should reside within the src\META-INF folder, not the META-INF of the plugin. Also, there should be a Library class for your plugin. In that class file there should be 2 methods there called getXspConfigFiles() and getFacesConfigFiles(). Those two methods should contain a String array listing all of your xsp-config and faces-config files which will then be available to any application which includes your plugin as a resource in Application Properties\Advanced\XPage Libraries. If your plugin doesn't show up there, ensure a copy of that plugin jar file in installed into Domino Designer and that the server recognizes your plugin when you issue the "tell http ss osgi com.yournamespace" command on the server console. In the resulting output from the server it should say "<< LAZY >>", "ACTIVE" or "RESOLVED" and not "INSTALLED" as that just says the plugin is on the server but not loaded.

这篇关于JAR 文件中的 faces-config.xml 在两个 Domino 上的行为不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆