Cmobilecom AF 5.19 Developer Guide

3 Installation

Cmobilecom AF applications (not Cmobilecom AF itself) can be installed using docker image, gradle or zip archive (gui or silent).

Docker/Gradle

Build/install/test/run with docker or gradle, see Project Build.

Install from Zip Archive

The Cmobilecom installer will install a Cmobilecom AF application on windows or linux, initializing database schemas. The installer can optionally install Tomcat as the application server and deploy the application war into the Tomcat instance. Directory notations:

Preparations

Run Installer (GUI)

  1. Run setup.bat(Windows) or setup.sh(Linux) with administration privilege
                cd [app.unzip.dir]
                setup
            
  2. Welcome page: select language and install type. The language selected is for installation only. Install type: install.
  3. Accept License: read license carefully. It is required to accept the license for installation.
  4. Installation directory and system password. The installation directory, (e.g., /path/to/myapp-install), called "cmobilecom.home", must be empty if exists. If it does not exist, it will be created. The password is required to log into the system instance.
  5. Select database type. The supported databases are listed under [app.unzip.dir]/conf/db with XML descriptors. To support other databases, see the Database Support section.
  6. Database information. Make sure the database is running with transaction enabled and UTF-8 character set. The installer will create a schema for the system instance and create tables within the schema. If the schema exists, the installer will use the schema and will not change anything in the schema.

    Database and username consist of letters, digits and underscores. dash(-) is not allowed.

  7. Install application server. If the installation zip does not contain any application server installers, this step will be skipped.
  8. Confirm and Install: confirm everything is correct and start installation.
After installation is completed, open a web browser:
    http://localhost:port    (root context)
    http://localhost:port/context
For example,
    http://localhost:8080/myapp-1.0
Login with username "system" and the password that is set at Step 4.

If the application server is installed as a service, its default service name is tomcat9.

Start/stop on windows:
    sc start tomcat9
    sc stop tomcat9
Start/stop non-systemd service on Linux:
    sudo service tomcat9 start
    sudo service tomcat9 stop
Start/stop systemd service on Linux
    sudo systemctl start tomcat9.service
	sudo systemctl stop tomcat9.service

Silent Install

To install Cmobilecom AF application silently in text mode, uncomment the following lines in setup script file. for example, on windows:
    set "JAVA_OPTS=%JAVA_OPTS% -Dsilent=true -Dtext.mode=true -Dverbose=true"
    set "ANSWER_FILE=answer.properties"
or invoke Cmobilecom installer directly:
    java -Dsilent=true -Dtext.mode=true -jar installer/cmobilecom-install-version.jar answer.properties
An answer.properties file must be provided for silent install in text mode. Template answer files can be found under
    [app.unzip.dir]/cmobilecom-af-version/build-common/install
        answer_mysql.properties
        answer_oracle.properties
Make changes to one of the template answer file according to your environment, and put it under [app.unzip.dir] as answer.properties. For example,

MySql database:

    cmobilecom.home=C\:\\myapp-1.0-install
    system.username=system
    system.password=123456

    dbms.install=false
    dbms.type=mysql
    dbms.host=localhost
    dbms.port=3306
    db.rootUsername=root
    db.rootPassword=welcome8
    db.name=myapp_schema
    db.username=cmobilecom
    db.password=welcome
    db.userHost=localhost
    db.schemaName=myapp_schema

    theme=nova-colored

    as.install=true
    as.name=tomcat
    as.port.http=8080
    as.service.install=true
    as.service.name=tomcat9
    as.service.displayName=Tomcat9
    as.service.description=Tomcat9
    as.service.start=true
    as.emptyApps=true
Oracle database:
    cmobilecom.home=C\:\\myapp-1.0-install
    system.username=system
    system.password=123456

    dbms.install=false
    dbms.type=oracle
    dbms.host=localhost
    dbms.port=1521
    db.rootUsername=root
    db.rootPassword=welcome8
    db.name=XEPDB1
    db.username=myapp_schema
    db.password=welcome
    db.userHost=localhost
    db.schemaName=myapp_schema

    theme=nova-colored

    as.install=true
    as.name=tomcat
    as.port.http=8080
    as.service.install=true
    as.service.name=tomcat9
    as.service.displayName=Tomcat9
    as.service.description=Tomcat9
    as.service.start=true
    as.emptyApps=true
Change directories and database configuration according to your environment.

Pass through JVM system properties can be specified in answer file, which start with "jvm:". For example,

    jvm:test.automation=true
defines a JVM system property "test.automation" whose value is "true".

Install As Systemd Service

On linux, the installer uses chkconfig to configure services. To install app as a systemd service (e.g., on Ubuntu), uncheck "Install As Service" in GUI or set as.service.install=false in answer.properties. After installation completed, configure systemd service as followings:
    sudo cp tomcat9.service /usr/lib/systemd/system/tomcat9.service
    sudo systemctl daemon-reload
    sudo systemctl enable tomcat9.service
    sudo systemctl start tomcat9.service
tomcat9.service

    [Unit]
    Description=Tomcat 9
    After=network.target

    [Service]
    Type=forking

    ExecStart=/path/to/tomcat/bin/startup.sh
    ExecStop=/path/to/tomcat/bin/shutdown.sh
    SuccessExitStatus=143

    # Security
    User=tomcat
    Group=tomcat

    PrivateTmp=yes
    #AmbientCapabilities=CAP_NET_BIND_SERVICE
    NoNewPrivileges=true
    ProtectSystem=strict
    ReadWritePaths=/path/to/tomcat/webapps/
    ReadWritePaths=/path/to/tomcat/logs
    ReadWritePaths=/path/to/tomcat/work
    ReadWritePaths=/path/to/tomcat/temp

    [Install]
    WantedBy=multi-user.target
The installed Tomcat instance directory is [cmobilecom.home]/tomcat-[tomcat_version].

Manual Deployment

Application war can be manually deployed to a running application server.

Application Servers

Suppose cmobilecom.home (installation directory) is c:\path\to\myapp-1.0-install for Windows, and /path/to/myapp-1.0-install for Linux.

Install License

  1. Evaluation license can be fetched inside the system instance.
  2. Contact Cmobilecom for commercial license if needed.
  3. Copy Cmobilecom AF license file to [cmobilecom.home]/license/system/af.license.
  4. If any module requires license, copy module license file to [cmobilecom.home]/license/system/app.license. One license file covers all modules.
  5. Refresh licenses from system module, or restart server.

Database Support

Mysql and Oracle are supported out of box, and they also serve as examples to create XML db descriptors and seed sql files for other databases. See Cmobilecom JPA developer guide for supported databases.

To support a database, sqlserver for instance, its XML db descriptor sqlserver-descriptor.xml must be provided and put under [app.unzip.dir]/cmobilecom-af-<version>/conf/db. See the Database Descriptors of Cmobilecom AF Developer Guide for detail.

In addition, database seed sql files for all the modules must be provided for creating tables in schema. For installation, seed sql files need to be put under [app.unzip.dir]/install/seed, and their relative paths are: [moduleName_lowercase]/db/[dbmsType]/seed.sql. For example,

[app.unzip.dir]/install/seed
    system/db/sqlserver/seed.sql
    system/db/sqlserver/seed-sys.sql
    website/db/sqlserver/seed.sql
    hr/db/sqlserver/seed.sql
For runtime, seed sql files need to be packaged in a module jar inside war, and their entry names are the same as the relative paths under [app.unzip.dir]/install/seed. For example,
    system/db/sqlserver/seed.sql
    system/db/sqlserver/seed-sys.sql
    website/db/sqlserver/seed.sql
    hr/db/sqlserver/seed.sql
When building a module jar, seed sql files will be packaged inside the jar.

Troubleshooting

In case of errors, check [app.unzip.dir]/cmbilecom-af-version/log/install.log for detail.

Common Issues:

Uninstall

Miscellaneous

ArchitectureProject BuildFrames / No Frames