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 |
|---|---|---|
Standalone 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 |
| A standard |
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.
Copy the file
D2000_EXE/web/smartweb.jarinto the chosen installation directory (e.g./opt/smartweborC:\smartweb).Start the application:
java -jar smartweb.jarOn the first start, SmartWeb automatically generates a default configuration file
application.yamlin theconfig/subdirectory next to the JAR. Stop the application (Ctrl+C).Edit
config/application.yaml— at minimum set the connection to D2000 (smartweb.connections). For details see Configuration of the SmartWeb Application.Start the application again with
java -jar smartweb.jar.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.
Install Java 21 and set the system variable
JAVA_HOMEto the root directory of the installation.Download and install Apache Tomcat 10.x (or newer) according to the standard procedure.
Copy the file
D2000_EXE/web/smartweb.warinto thewebappsdirectory of Tomcat.Start Tomcat. On the first start, SmartWeb creates the directory
<tomcat>/conf/applications/smartweb/and generates a defaultapplication.yamlin it.Stop Tomcat, edit
<tomcat>/conf/applications/smartweb/application.yaml(at minimum the connection to D2000) and start Tomcat again.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:
Stop the Tomcat server.
Rename the file
webapps/smartweb.wartowebapps/myApp.war.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.