Pertinent installation details:
Java 1.6.0_11
Servoy 5.1.4 -build 964
The errors 'm about to describe ONLY happen when running SmartClient launched from a running app server and NOT from a client running from inside Eclipse (I thought those days were over?)
The common thread between all of these errors is they are originating from methods that get called as the result of clicks in HTML areas. To further complicate the matter, however, it’s not ALL html click handlers that fail in this fashion, just some of them.
First two can’t find “forms” or “globals”
ReferenceError: "forms" is not defined. (htmlHandlerScheduleList#1434)
org.mozilla.javascript.EcmaError: ReferenceError: "forms" is not defined. (htmlHandlerScheduleList#1434)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3655)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3649)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3711)
at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1754)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1679)
at org.mozilla.javascript.gen.c149._c0(htmlHandlerScheduleList:1434)
at org.mozilla.javascript.gen.c149.call(htmlHandlerScheduleList)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:73)
at org.mozilla.javascript.gen.c103._c0(renderPage:2741)
at org.mozilla.javascript.gen.c103.call(renderPage)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:73)
at org.mozilla.javascript.gen.c453._c0(createListFromQuery:781)
at org.mozilla.javascript.gen.c453.call(createListFromQuery)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:81)
at org.mozilla.javascript.gen.c452._c0(findClientsSchedules:7865)
at org.mozilla.javascript.gen.c452.call(findClientsSchedules)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:73)
at org.mozilla.javascript.gen.c169._c0(toSchedules:2139)
at org.mozilla.javascript.gen.c169.call(toSchedules)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:65)
at org.mozilla.javascript.gen.c433._c0(navHandler:408)
at org.mozilla.javascript.gen.c433.call(navHandler)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127)
at org.mozilla.javascript.gen.c433.call(navHandler)
at com.servoy.j2db.scripting.Ztb.executeFunction(Ztb.java:196)
at com.servoy.j2db.Zwb.Za(Zwb.java:741)
at com.servoy.j2db.Zwb.Za(Zwb.java:1223)
at com.servoy.j2db.Zcc.Za(Zcc.java:1)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:27)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:18)
at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:16)
at com.servoy.j2db.dataui.Zh.mouseReleased(Zh.java:2)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
ReferenceError: "globals" is not defined. (htmlHandlerScheduleList#1400)
org.mozilla.javascript.EcmaError: ReferenceError: "globals" is not defined. (htmlHandlerScheduleList#1400)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3655)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3649)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3711)
at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1754)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1679)
at org.mozilla.javascript.gen.c149._c0(htmlHandlerScheduleList:1400)
at org.mozilla.javascript.gen.c149.call(htmlHandlerScheduleList)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:73)
at org.mozilla.javascript.gen.c103._c0(renderPage:2741)
at org.mozilla.javascript.gen.c103.call(renderPage)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:73)
at org.mozilla.javascript.gen.c453._c0(createListFromQuery:781)
at org.mozilla.javascript.gen.c453.call(createListFromQuery)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:73)
at org.mozilla.javascript.gen.c481._c0(findCurrentProposals:8127)
at org.mozilla.javascript.gen.c481.call(findCurrentProposals)
at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:111)
at org.mozilla.javascript.gen.c169._c0(toSchedules:2192)
at org.mozilla.javascript.gen.c169.call(toSchedules)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:65)
at org.mozilla.javascript.gen.c433._c0(navHandler:408)
at org.mozilla.javascript.gen.c433.call(navHandler)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127)
at org.mozilla.javascript.gen.c433.call(navHandler)
at com.servoy.j2db.scripting.Ztb.executeFunction(Ztb.java:196)
at com.servoy.j2db.Zwb.Za(Zwb.java:741)
at com.servoy.j2db.Zwb.Za(Zwb.java:1223)
at com.servoy.j2db.Zcc.Za(Zcc.java:1)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:27)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:18)
at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:16)
at com.servoy.j2db.dataui.Zh.mouseReleased(Zh.java:2)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
And here we can’t instantiate a new Object ( ie: var x = new Object())
ReferenceError: "Object" is not defined. (listClickAccount#1085)
org.mozilla.javascript.EcmaError: ReferenceError: "Object" is not defined. (listClickAccount#1085)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3655)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3649)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3711)
at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1754)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1679)
at org.mozilla.javascript.gen.c140._c0(listClickAccount:1085)
at org.mozilla.javascript.gen.c140.call(listClickAccount)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:73)
at org.mozilla.javascript.gen.c103._c0(renderPage:2741)
at org.mozilla.javascript.gen.c103.call(renderPage)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:73)
at org.mozilla.javascript.gen.c448._c0(sendToList:2016)
at org.mozilla.javascript.gen.c448.call(sendToList)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:81)
at org.mozilla.javascript.gen.c421._c0(accountMainMenuHandler:410)
at org.mozilla.javascript.gen.c421.call(accountMainMenuHandler)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127)
at org.mozilla.javascript.gen.c421.call(accountMainMenuHandler)
at com.servoy.j2db.scripting.Ztb.executeFunction(Ztb.java:196)
at com.servoy.j2db.Zwb.Za(Zwb.java:741)
at com.servoy.j2db.Zwb.Za(Zwb.java:1223)
at com.servoy.j2db.Zwb.Za(Zwb.java:644)
at com.servoy.j2db.plugins.ClientPluginAccessProvider$MethodExecutor.run(ClientPluginAccessProvider.java:37)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
My best guess is that I’m running into some sort of scoping problem. My framework for building our HTML lists is complicated, and does some tricky things, like assigning a form method to an object property and calling it from there
e.g.
var oControl = new Object();
oControl.clickHandler = forms._tasks.htmlClickHandler; //htmlClickHandler is a method on the form _tasks
oControl.clickHandler();
I haven’t had problems with this before, but I can see this potentially introducing scoping problems for things like forms and globals, but then it doesn’t really explain where “Object” went to. It also doesn’t do much to explain why this all works from an Eclipse launched client as opposed an app server one.
I’ve tried reinstalling the app server from scratch a couple of times just to be sure that nothing went wrong in that process, but to no avail. Not quite where to go from, any ideas?