Skip to main content

Running the LionWeb JVM Server

The server module provides a self-contained LionWeb repository server distributed as a single shadow JAR. It requires no external database and exposes three services in a single process:

ServiceDefault PortPurpose
HTTP Bulk API9239REST endpoints for batch model operations
WebSocket Delta API9240Real-time incremental changes
Web UI Dashboard9241Browser-based inspection tool (optional)

The data store is held in memory, backed by InMemoryServer from the client module. The server is suitable for development, testing, and production workloads that fit in memory.

Getting the Server

Building from Source

./gradlew :server:shadowJar
# Output: server/build/libs/server-<version>-all.jar

Maven Central

// build.gradle.kts
dependencies {
implementation("io.lionweb:lionweb-2024.1-server:<version>")
}

The shadow JAR (server-<version>-all.jar) is the self-contained artifact for standalone deployment.

Starting the Server

Default (Bulk + Delta only)

java -jar server-<version>-all.jar

This starts the HTTP Bulk API on port 9239 and the WebSocket Delta API on port 9240.

With the Web UI Dashboard

java -jar server-<version>-all.jar --web-ui

Adds the browser-based dashboard on port 9241.

All CLI Flags

FlagDefaultDescription
--http-port9239HTTP Bulk API port
--ws-port9240WebSocket Delta API port
--web-ui(disabled)Enable the Web UI Dashboard
--web-port9241Web UI Dashboard port
--repositoryrepoDefault repository name

Example — custom ports with the Web UI:

java -jar server-<version>-all.jar \
--http-port 8080 \
--ws-port 8081 \
--web-ui \
--web-port 8082 \
--repository myproject

HTTP Bulk API (port 9239)

All endpoints accept POST requests (unless noted) and expect/return JSON serialized according to the LionWeb serialization format. Include ?repository=<name> as a query parameter to address a specific repository.

EndpointPurpose
POST /bulk/idsGenerate unique IDs
POST /bulk/listPartitionsList all partition nodes
POST /bulk/createPartitionsCreate new partitions from a serialization chunk
POST /bulk/deletePartitionsDelete partitions by ID
POST /bulk/storeStore or update nodes
POST /bulk/retrieveRetrieve nodes by ID and depth
GET /inspection/nodesByClassifierClassify node inventory by classifier
GET /inspection/nodesByLanguageGroup nodes by language
POST /createRepositoryCreate a named repository
POST /deleteRepositoryDelete a repository
POST /listRepositoriesList all repositories

GZIP-compressed request bodies are accepted. CORS headers are enabled for all endpoints.

Connecting a Java Client

import io.lionweb.LionWebVersion;
import io.lionweb.client.LionWebBulkClient;

LionWebBulkClient client = new LionWebBulkClient.Builder()
.withVersion(LionWebVersion.v2024_1)
.withHostname("localhost")
.withPort(9239)
.withRepository("repo")
.build();

WebSocket Delta API (port 9240)

The Delta API uses the LionWeb Delta protocol over WebSocket.

ws://localhost:9240

Clients sign on to receive a participationId, then subscribe to specific partitions to receive targeted event notifications. See the Delta Protocol Guide for the full message catalogue and code examples.

Web UI Dashboard (port 9241)

Enabled with --web-ui. Open http://localhost:9241 in a browser to see:

  • Live message log: all commands, queries, and events flowing through the server
  • Node inventory: nodes grouped by classifier, updated in real time
  • Repository overview: all repositories and their partitions

The dashboard is built with Svelte and bundled inside the shadow JAR — no separate installation is required.