Fork me on GitHub

Janus Command-line Launcher

Janus is the default SARL Run-time Environment (SRE). Its role is to provide all the libraries and plugins that are needed for running SARL agents.

For launching the Janus platform from a command-line shell, you could use the janus tool.

1. Usage

The janus tool takes arguments:

janus [OPTIONS] <agent_fully_qualified_name>

The agent_fully_qualified_name is the name of the agent to launch. This name is equal to the fully qualified name of the agent’s type.

Janus enables to launch only one agent from the command-line shell. If you want to launch more than one agent, you should launch a first agent, which will create the other agents.

You could change the behavior of the janus tool with the command-line options. For obtaining a list of the options, type:

janus -help

2. Command-Line Options

The Janus framework provides options on the command-line. The list of the options is displayed below. This list includes all the standard modules of Janus. If you add an extra module into the classpath of your application, more options may become available.

Option Description
-c yaml_location, --config=yaml_location Specifies YAML config location, which can be a file path or a URL.
-h, --help Prints this message.
-H, --help-config Prints information about application modules and their configuration options.

3. List of Errors and Warnings

This section provides the non-exhaustive list of error and warning messages that may be generated by Janus. Indeed, Janus code may generates errors and warnings that are documented below. However, several errors may occur because of one of the used library. In these errors are not necessary documented, and must be discussed on Gitter or Google Group with the SARL community.

The “N.” column provides a number that could be used in order to make easier your discussions with the SARL developers on the forums.

The column “Message and Description” contains information and details on each issue. The message gives a template of typical message that is given by the compiler. The cause describes the source of the issue, and provides a short explanation of the cause of the issue. The solving provides guidelines to fix the issue when it is possible.

The “Level” column indicates the level of importance for the issue. It may be:

The code of the issue, which is appended at the end of the messages, corresponds to the content of the “Code” column below. This code may have a short format (e.g., the one shown in the column), or a long format (e.g., if you move your mouse pointer on the code, you should see the long format of the code into a pop-up window). The long code is provided by the SARL compiler at the end of the issue messages.

N. Message and Description Level Code
1 Message: Already launched task
Cause: A task was launched two times. This error denotes of a problem of design of the agent software
Solving: Review your code to avoid the task to be launched too times
Error agent_task_already_launched
2 Message: Cannot emit the event ‘event-type’ with the scope ‘scope’: error
Cause: The given event cannot be emitted into a space because of an internal error
Error cannot_emit_in_space
3a Message: Not enough arguments. You have to provide the qualified name of the agent to be launched
Cause: This error is generated when the number of commend-line arguments that are passed to Janus is too small, in the case that Janus is supposed to launch an agent. The missed argument is the fully-qualified name of the agent to be launched
Solving: Add to the command-line the fully-qualified name of the agent to be launched
Error cli_argument_list_size
3b Message: Too many arguments. You must not provide arguments
Cause: This error is generated when the number of commend-line arguments that are passed to Janus is too big, in the case that Janus is not supposed to launch an agent.
Solving: Remove all the command-line arguments
Error cli_argument_list_size
4 Message: The spawning of the agents is disabled. The spawning of agent-type inside context is skipped
Cause: An agent spawn query was received, but rejected because the agent life-cycle service has disabled its spawning service. It is usually due to the fact that Janus has already started to shutdown
Solving: Review you code in order to avoid to spawn an agent after all the exisiting agents have been killed
Warning disabled_spawn
5a Message: Event guard evaluator method becomes inaccessible: {1}
Cause: Event guards are evaluated into dedicated Java functions by Janus. This error message is generated when the guard evaluation function cannot be called due to access restrictions. This error should never occur because it means that the Janus code itself is broken
Error event_guard_error
5b Message: Invalid argument for the event guard evaluator method: {1}
Cause: Event guards are evaluated into dedicated Java functions by Janus. This error message is generated when one of the arguments of the guard evaluation function is invalid. Usually, it is because the event cannot be passed to the function
Error event_guard_error
6 Message: The SARL specification version that was used for generating the type name is not compatible with the specification version supported by Janus
Cause: Internally, Janus checks if the provided class of an agent to be launched was generated with a version of the SARL compiler that is supported by the current version of Janus. This error message is generated when the class to be loaded is not compatible
Solving: Get agent’s binary files that are compiled with the compatible SARL compiler
Error invalid_sarl_specification
7 Message: Cannot kill agent id because it is not alive
Cause: The agent with the given id cannot be killed because it is already dead
Solving: Review your code to avoid the call to killMe too many times
Error not_alive_error
8 Message: Cannot kill agent id because it is considered as not killable
Cause: The agent with the given id cannot be killed. Usually, it is because it is a holon that contains sub-holons
Solving: Review your code to avoid the killing of the sub-holon when it is not empty
Error not_killable_error
9 Message: Agent task is null
Cause: The reference to an agent task is lost. This avoid the task to be run. This error should never occur
Error null_agent_task
10 Message: Failure in service name
Cause: An internal error into the Janus service manager has occurred. The error is related to the service with the given name
Error service_manager_error
11 Message: Cannot instantiate an agent of type type-name due to the following: error
Cause: An internal error avoid an agent of the given type-name to be created and launched
Solving: Review the given error and fix your agent software accordingly
Error spawn_error
12 Message: Task with the id ‘id’ and the name ‘name’ was cancelled
Cause: A task was detected as cancelled by the thread execution service. This error should never occur, except if you have manually cancelled an agent task during its execution
Warning task_cancel
13 Message: Uncaught exception: error
in thread #task-idtask-name’
Cause: This error message is displayed when an agent task has encountered an *error
.
Error task_error
14 Message: Task with the id ‘id’ and the name ‘name’ was interrupted
Cause: A task was detected as interrupted by the thread execution service. This error should never occur, except if the thread associated to the agent task was interrupted programmatically
Warning task_interrupt
15 Message: Rejected task due to lack of resources or service shutdown: task
Cause: This warning message is generated when an agent task is rejected by the internal thread execution service. Most of the time, the reason of the rejection is because there is not more space in the queue of tasks to be run. By default, when a task is rejected to be executed into a thread, Janus assumes that the tasks could be run into the current thread, and it is running the task. Consequently, this warning should be considered in order to detect internal bugs in your software
Solving: x
Warning task_reject
16a Message: Cannot create the universe context
Cause: Something avoid the Janus framework to be started and create the root context of the application. The cause of the error is unknown
Error universe_creation
16b Message: Cannot create the universe context: cause
Cause: Something avoid the Janus framework to be started and create the root context of the application. The cause of the error is provided
Error universe_creation

Copyright © 2014-2020 the original authors or authors.

Licensed under the Apache License, Version 2.0; you may not use this file except in compliance with the License. You may obtain a copy of the License.

You are free to reproduce the content of this page on copyleft websites such as Wikipedia.

Generated with the translator io.sarl.maven.docs.generator 0.12.0-SNAPSHOT.