Understanding errors
This section is devoted to explain some errors that can be raised by the interpreter which could be difficult to understand due to the service oriented model used by Jolie:
- If execution is not single, the body of main must be either an input choice or a sequence that starts with an input statement (request-response or one-way) :
In Jolie a service may have different execution modalities:
concurrent
,sequential
, andsingle
. If no execution modality is specified,single
is used by default, meaning that the service is going to be executed once (this is suitable for one-shot programs like scripts). If the execution modality is set toconcurrent
orsequential
, the service will start to listen for requests to be served. In this last case, the behaviour defined within scopemain
must either be aninput choice or a sequence of statements that starts with an input primitive. An input primitive can be a request-response or a one-way input. In all other cases, the engine will raise the errorIf execution is not single, the body of main must be either an input choice or a sequence that starts with an input statement (request-response or one-way)
. So if you get this error, check yourmain
definition and verify that it consists of either an input choice or a sequence that starts with an input statement.