Installation and update of smartWeb platform

Installation and update of smartWeb platform

SmartWeb is an application built on Spring Boot 4.x and requires Java 21 to run. The entire runtime behaviour — the connection to D2000, authentication, exposure of the APIs (REST, CometD, gRPC, OData, OpenAPI, OAuth2), connectors and monitoring — is controlled by a single configuration file, application.yaml.

[!NOTE] This chapter describes the current way of deploying the SmartWeb platform. The installation procedure for older D2000 versions — deployment into the Wildfly application server, or the legacy smartweb.json configuration format — is described in the chapter Installation and configuration for older D2000 versions.

Deployment options

SmartWeb is distributed in two packages that contain an identical application:

Package

Artifact

Description

Package

Artifact

Description

Standalone JAR

smartweb.jar

An executable (fat) JAR with an embedded Apache Tomcat. The primary and recommended deployment option — it does not require a separate application server.

WAR

smartweb.war

A standard .war archive intended for deployment into a standalone Apache Tomcat (without the embedded Tomcat).

Optionally, a container (OCI) image is also available; it wraps the JAR package.

Both installation packages are located in the D2000 installation directory — D2000_EXE/web/.

Prerequisites

  • Java 21 (JRE or JDK) installed on the target server. For deployment as a standalone JAR or an OCI image no additional application server is required.

  • For WAR deployment, additionally Apache Tomcat 10.x or newer (compatible with Jakarta EE 10 / Servlet 6.0).

  • A running D2000 application (at least the kernel) and a configured D2Connector process — see Configuration of the D2Connector Process for SmartWeb.

Installation as a standalone JAR

This is the recommended deployment option. The application is started directly with the java -jar command, with Apache Tomcat embedded inside the JAR.

  1. Copy the file D2000_EXE/web/smartweb.jar into the chosen installation directory (e.g. /opt/smartweb or C:\smartweb).

  2. Start the application:

    java -jar smartweb.jar
  3. On the first start, SmartWeb automatically generates a default configuration file application.yaml in the config/ subdirectory next to the JAR. Stop the application (Ctrl+C).

  4. Edit config/application.yaml — at minimum set the connection to D2000 (smartweb.connections). For details see Configuration of the SmartWeb Application.

  5. Start the application again with java -jar smartweb.jar.

  6. Open the application in a browser — by default at http://localhost:8080/, the administration console at http://localhost:8080/admin/.

By default the application expects its configuration in the config/ directory next to the JAR. A different location can be specified with a Spring Boot parameter:

java -jar smartweb.jar --spring.config.location=file:/opt/smartweb/config/application.yaml

[!TIP] For production deployment it is advisable to run smartweb.jar as an operating-system service (a Windows Service or a systemd unit) so that the application starts automatically after the server boots.

Installation as a WAR into a standalone Tomcat

This option is suitable where a managed Apache Tomcat instance already exists, or where multiple applications need to run on a single server.

  1. Install Java 21 and set the system variable JAVA_HOME to the root directory of the installation.

  2. Download and install Apache Tomcat 10.x (or newer) according to the standard procedure.

  3. Copy the file D2000_EXE/web/smartweb.war into the webapps directory of Tomcat.

  4. Start Tomcat. On the first start, SmartWeb creates the directory <tomcat>/conf/applications/smartweb/ and generates a default application.yaml in it.

  5. Stop Tomcat, edit <tomcat>/conf/applications/smartweb/application.yaml (at minimum the connection to D2000) and start Tomcat again.

  6. Open the application in a browser — by default at http://localhost:8080/smartweb/, the administration console at http://localhost:8080/smartweb/admin/.

[!NOTE] With deployment into a standalone Tomcat, HTTPS is configured through the <Connector> element in Tomcat's server.xml file, not through the server.ssl.* properties in application.yaml (those apply only to the embedded Tomcat in the JAR package).

Deployment as a container (OCI) image

SmartWeb is also available as an OCI (Docker) image that contains the JAR package together with a Java 21 runtime:

docker run -p 8080:8080 ` -v /path/to/config:/config ` ipesoft/d2/smartweb:<version>

Inside the container the configuration file application.yaml is expected in the /config directory. It is advisable to mount this directory as a volume from the host system so that the configuration survives a restart and a container replacement.

Changing the URL context path

WAR deployment — the context path is derived from the name of the .war file. To change it from http://localhost:8080/smartweb to, for example, http://localhost:8080/myApp:

  1. Stop the Tomcat server.

  2. Rename the file webapps/smartweb.war to webapps/myApp.war.

  3. Start the Tomcat server.

Standalone JAR deployment — the context path is set in application.yaml via the server.servlet.context-path property:

server: servlet: context-path: /myApp

[!IMPORTANT] For the application to work correctly, the name of the .war file — or the context path — must be chosen using alphanumeric characters only and without diacritics.