2

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 is inside WebContent\WEB-INF\lib and referenced in build path of NSF.

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

where app is name of application scoped bean.

Error is logged into xpages_exc.log with full stacktrace.

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?

Edited:

Stacktrace:

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 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.

Per Henrik Lausten
  • 21,331
  • 3
  • 29
  • 76
Frantisek Kossuth
  • 3,524
  • 2
  • 23
  • 42
  • My current workaround is to copy content of JAR's faces-config into NSF's faces-config for production server :-(. – Frantisek Kossuth Mar 07 '12 at 16:10
  • what happens if you open the production Db in designer and do a 'clean project'? – Declan Lynch Mar 07 '12 at 20:34
  • "clean" in production has no effect – Frantisek Kossuth Mar 08 '12 at 07:22
  • another clue: somehow this happened on my local development server. application failed to construct beans, but on main development server everything was fine. in desperation I have deleted faces-config.xml and cleaned database - faces-config was recreated. from that moment my development server was cured. meaning it was constructing beans according to faces-config in JAR file. – Frantisek Kossuth Mar 22 '12 at 08:06
  • Could you supply the first 5 lines or so of the stack trace also, don't need the full thing, just edit your question to add it in. – Declan Lynch Mar 22 '12 at 11:57
  • Are the path\to\domino\jvm\lib\security\java.policy files the same on your development and production servers? Maybe the issue is java permissions? Specifically, do you have a line in your java.policy file on your development server that reads "permission java.security.AllPermission;" and that line is missing in your development server?

    If they are the same, like Declan asked, could you post the top portion of the stack trace?
    – keithstric Mar 23 '12 at 02:35
  • paths to Domino installation are DIFFERENT. java.policy files are THE SAME. java.policy does NOT grant all permissions, it is default file from server installation. – Frantisek Kossuth Mar 23 '12 at 08:19

2 Answers2

1

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.

keithstric
  • 1,053
  • 1
  • 11
  • 21
  • mentioned JAR is not a plugin, just bunch of POJOs used as beans. but I will try to make it a plugin and deploy it to server. thanks. – Frantisek Kossuth Mar 08 '12 at 07:25
  • 1
    For a lot of examples take a look at the XSP Starter Kit on OpenNTF here: http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=XSP%20Starter%20Kit – keithstric Mar 08 '12 at 20:51
0

I'm thinking it could be a line delimiter issue - don't know but just thinking out loud. Are the servers on different platforms?