Console error: unknown variable type and cant parse variable

We have a global boolean variable declared in a module for our web client solution. The variable ‘isNewUser’ defaults to false. After upgrading our server to 5.2.7, we began getting the following errors in the console on a regular basis. It appears to occur when the solution is being loaded, and the variables are being initialized. It does not appear to have a bad side effect.

Note the ‘ReferenceError: “falsefalse”’ and the “script(isNewUserisNewUser)”. I cannot find anywhere in our code where we inadvertently use ‘isNewUserisNewUser’ instead of’ ‘isNewUser’, nor anyplace where it might evaluate to that name.

The first error reports "unknown variable type 0 for variable isNewUserisNewUser reverting to previous or MEDIA type"
The second error reports “cant parse variable ‘isNewUserisNewUser’”

The two errors are listed below, with the earliest in sequence first.

Thoughts?

Thanks,

Guerry

Variable Declaration

/**
*

  • @properties={typeid:35,uuid:“86BC7AC9-1204-44AD-A9CF-BE741CDECA0A”,variableType:-4}
    */
    var isNewUser = false;

ERROR # 1

2011-04-12 21:04 main ERROR com.servoy.j2db.util.Debug unknown variable type 0 for variable isNewUserisNewUser reverting to previous or MEDIA type

java.lang.RuntimeException
at com.servoy.j2db.persistence.ScriptVariable.setVariableType(ScriptVariable.java:164)
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.servoy.j2db.server.Zc.Za.Za(Za.java:701)
at com.servoy.j2db.server.Zc.Za.Za(Za.java:206)
at com.servoy.j2db.server.Zc.Za.Za(Za.java:1478)
at com.servoy.j2db.server.Zc.Za.loadRootObject(Za.java:1234)
at com.servoy.j2db.persistence.RootObjectCache.getRootObject(RootObjectCache.java:202)
at com.servoy.j2db.persistence.RootObjectCache.getActiveRootObject(RootObjectCache.java:160)
at com.servoy.j2db.persistence.AbstractRepository.getActiveRootObject(AbstractRepository.java:413)
at com.servoy.j2db.server.ApplicationServer.loadAllSolutionsCompletelyInMem(ApplicationServer.java:76)
at com.servoy.j2db.server.ApplicationServer.main(ApplicationServer.java:562)

ERROR # 2 (recurring)

2011-04-12 21:35 http-443-6 WARN com.servoy.j2db.util.Debug cant parse variable ‘isNewUserisNewUser’

org.mozilla.javascript.EcmaError: ReferenceError: “falsefalse” is not defined.
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3663)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3657)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3719)
at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1754)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1679)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3752)
at script(isNewUserisNewUser)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3135)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:179)
at org.mozilla.javascript.Context.evaluateString(Context.java:1233)
at com.servoy.j2db.scripting.ScriptVariableScope.evalValue(ScriptVariableScope.java:169)
at com.servoy.j2db.scripting.ScriptVariableScope.put(ScriptVariableScope.java:135)
at com.servoy.j2db.scripting.ScriptVariableScope.put(ScriptVariableScope.java:74)
at com.servoy.j2db.scripting.GlobalScope.createVars(GlobalScope.java:54)
at com.servoy.j2db.scripting.GlobalScope.reloadVariablesAndScripts(GlobalScope.java:60)
at com.servoy.j2db.ClientState.solutionLoaded(ClientState.java:1439)
at com.servoy.j2db.server.headlessclient.SessionClient.solutionLoaded(SessionClient.java:473)
at com.servoy.j2db.ClientState.loadSolutionsAndModules(ClientState.java:1375)
at com.servoy.j2db.server.headlessclient.SessionClient.loadSolution(SessionClient.java:266)
at com.servoy.j2db.ClientState.selectAndOpenSolution(ClientState.java:416)
at com.servoy.j2db.ClientState.handleClientUserUidChanged(ClientState.java:394)
at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:515)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3977)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3865)
at com.servoy.j2db.FormController.executeFunction(FormController.java:3787)
at com.servoy.j2db.FormController$ScriptExecuter.executeFunction(FormController.java:3642)
at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:272)
at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:217)
at com.servoy.j2db.server.headlessclient.dataui.WebEventExecutor.onEvent(WebEventExecutor.java:363)
at com.servoy.j2db.server.headlessclient.dataui.WebEventExecutor$2.onEvent(WebEventExecutor.java:167)
at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:302)
at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:157)
at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
at com.servoy.j2db.server.servlets.Zl.doGet(Zl.java:10)
at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

END

do you also have this in the developer?
or only in the server?

If you really only have it in the server then it could be that somehow the repository is a bit corrupt and there you have some bad data for that specific variable (or you have a bad duplicate)

Can you try with another (test) server that has a clean repository where import just the developers export?

Hi Johan,

The problematic server was a 5.2.6 which was upgraded to a 5.2.7. We also have a test server running 5.2.4 (we’ll be upgrading that very soon). We’ve been importing the same solutions into both, and the errors have only shown up on the one server.

I’d worried that something might be wrong with the repository. We’re also getting an internal error on logging out of the solution. We use the pattern of:

application.showURL("http://www.mysite.com", "_self"); 
application.exit();

When executing that code, this one server has also begun to yield things like this (at least in IE):

ERROR [http-443-5] org.apache.wicket.RequestCycle - unexpected exception when handling another exception: Markup of type 'html' for component 'com.servoy.j2db.server.headlessclient.ServoyErrorPage' not found.

What is our best solution?

Thanks,

Guerry

make a case for that, i don’t know what exactly is the error (it says that it encounters an error in an error, when showing an error)
But that is not really the repository but maybe some configuration you have with your own error pages or redirect urls?

I’ll look into the redirects. I didn’t mean to fork the conversation.

How do I go about fixing the repository?

Thanks,

Guerry

fixing the repository is really just using a clean one some how
That is the fastest way

fixing the repository is really just using a clean one some how
That is the fastest way

Some how is exactly what I’d like to know. I’ve searched the forums and the documentation and not found a definitive answer unless I missed it.

Do I need to uninstall the server, drop the repository and reinstall the server, the reimport the solutions? Or, do I delete all the solutions so they are removed from the repository, and then reimport them? Or what?

To create a new repo, just make a new/empty database/database scheme and configure a connection to it in Servoy with the name “repository_server” and then start the Servoy Application Server with the flag -upgradeRepository.

This is documented in the wiki here: http://wiki.servoy.com/display/DOCS/Ser … ry+upgrade. I do see how this would be difficult to spot form the angle you’re searching now, will have a look how to improve that.

Paul