Starting the runtime failed (An error occurred while initializing modules) - Input $ could not be parsed

0
Hi, I'm seeing an error on trying to run our app through the modeller after making some local changes, and haven't yet tracked down the reason.   1) No Java actions have been changed 2) I've tried cleaning the deployment directory 3) I've tried using the default built-in database with the same results 4) I've tried restarting the modeller and the computer running it 5) Due to the quantity of local changes I can't easily revert them, and no recent changes seem to be likely to have caused this (microflow and domain model changes) 6) (Obviously) no errors show in the modeller "Errors" tab    The problem seems to be whilst initializing modules, that some  parameter is missing or empty.  I'm investigating further and searching for clues, but if anyone has any pointers I'd be grateful.   Stack trace and error info: --------------------------------------     An error occurred while initializing modules -------- com.mendix.m2ee.api.AdminException: An error occurred while initializing modules     at com.mendix.core.impl.MxRuntimeImpl.initializeModules(MxRuntimeImpl.java:546) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: Input '$' could not be parsed Error on line 1 character 1: mismatched character '<EOF>' expecting set null     at com.mendix.languages.ASTBuilder$class.processRecognitionExceptions(ASTBuilder.scala:33)     at com.mendix.languages.ASTBuilder$class.process$1(ASTBuilder.scala:14)     at com.mendix.languages.ASTBuilder$$anonfun$processRecognitionExceptions$1.apply(ASTBuilder.scala:17)     at com.mendix.languages.ASTBuilder$$anonfun$processRecognitionExceptions$1.apply(ASTBuilder.scala:16)     at scala.collection.immutable.List.foreach(List.scala:383)     at com.mendix.languages.ASTBuilder$class.processRecognitionExceptions(ASTBuilder.scala:16)     at com.mendix.languages.mxexpressions.MxExpressionASTBuilder.processRecognitionExceptions(MxExpressionASTBuilder.scala:9)     at com.mendix.languages.mxexpressions.MxExpressionASTBuilder.buildMxExpressionAST(MxExpressionASTBuilder.scala:18)     at com.mendix.languages.LanguageParser$.parseMxExpression(LanguageParser.scala:16)     at com.mendix.languages.LanguageParser.parseMxExpression(LanguageParser.scala)     at com.mendix.modules.microflowengine.microflowstructure.MicroflowStructureFactory.processEventWithIncomingFlows(MicroflowStructureFactory.java:225)     at com.mendix.modules.microflowengine.microflowstructure.MicroflowStructureFactory.createMicroflowStructure(MicroflowStructureFactory.java:128)     at com.mendix.modules.microflowengine.internal.MicroflowEngineModuleImpl$$anonfun$2.apply(MicroflowEngineModuleImpl.scala:34)     at com.mendix.modules.microflowengine.internal.MicroflowEngineModuleImpl$$anonfun$2.apply(MicroflowEngineModuleImpl.scala:33)     at scala.collection.TraversableLike$WithFilter$$anonfun$map$2.apply(TraversableLike.scala:728)     at scala.collection.Iterator$class.foreach(Iterator.scala:743)     at scala.collection.AbstractIterator.foreach(Iterator.scala:1174)     at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)     at scala.collection.AbstractIterable.foreach(Iterable.scala:54)     at scala.collection.TraversableLike$WithFilter.map(TraversableLike.scala:727)     at com.mendix.modules.microflowengine.internal.MicroflowEngineModuleImpl.initMicroflowStructures(MicroflowEngineModuleImpl.scala:33)     at com.mendix.modules.microflowengine.internal.MicroflowEngineModuleImpl.initialize(MicroflowEngineModuleImpl.scala:28)     at com.mendix.core.impl.MxRuntimeImpl.initializeModules(MxRuntimeImpl.java:538)     at com.mendix.core.impl.MxRuntimeImpl.doFire(MxRuntimeImpl.java:488)     at com.mendix.core.impl.MxRuntimeImpl.fireZeeMissile(MxRuntimeImpl.java:455)     at com.mendix.core.impl.MxRuntimeImpl.start(MxRuntimeImpl.java:310)     at com.mendix.core.impl.MxRuntimeImpl.start(MxRuntimeImpl.java:246)     at com.mendix.m2ee.appcontainer.actions.StartAction.startRuntime(StartAction.java:50)     at com.mendix.m2ee.appcontainer.actions.StartAction.execute(StartAction.java:31)     at com.mendix.m2ee.appcontainer.server.handler.HttpAdminHandler.handle(HttpAdminHandler.java:122)     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)     at org.eclipse.jetty.server.Server.handle(Server.java:368)     at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)     at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)     at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)     at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:647)     at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)     at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)     at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)     at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)     at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)     at java.lang.Thread.run(Thread.java:745)  
asked
3 answers
1

I managed to track it down to the return value of one microflow. At a previous stage I'd had a return value for it, but removed the returned value, and set it to return Nothing (The microflow isn't currently called from anywhere but is work in progress.)

 

Changing it to return a value allowed the application to start up. Subsequently changing it back to return Nothing resolved the issue.

 

I think there's a possible bug in code generation in the modeller where after changing it, the return type or value of a microflow can get out of sync with the generated code. It appears this can cause runtime errors without showing modeller errors in some cases. 

 

For anyone else who comes across this issue, try the above solution.

answered
0

From the stacktrace it seems as if you have just a $ somewhere in your expression.  I don't know why the modeler wouldn't give a consistency error about this.

To resolve it I would try and search the modeler for the text '$ ' (so the dollar sign followed by a white space). Hopefully you have an expression somewhere that says $ > 5  which is obviously invalid. If that doesn't work I would recommend searching on just the $ sign without the whitespace, this is obviously a lot of work, but I can't thing of many other ways to find the issue.

 

As an alternative you could try and start your application with TRACE logging enabled, this might print which microflow it was evaluating just before it gives you this exception.

answered
0

Thanks Jasper, that's a great suggestion. I'd assumed that it would show as a consistency error if it were an issue in an expression I'd changed, but I can check that, as it's certainly possible I've made typos or failed to provide defaults properly whilst refactoring

 

So far, enabling TRACE debugging hangs with a spinner, and it doesn't show up with a search for "$ ". The search for "$" shows up 15000 results so that may not be feasible, but I can definitely check my recent changes.

 

 

answered