BellaDati supports GlassFish 4.1.1 and above (including GlassFish 5.0.1). Please download and install the Glassfish 5 Web Profile. (https://download.oracle.com/glassfish/5.0.1/release/index.html).
Before You Begin
Please read the following important notes before you begin installing BellaDati on GlassFish:
Make sure you have the right version of Java. See Installing Java for more details.
For installing GlassFish 5.0.1 as Application server, Java 8 1.8.0_202 is recommended now. If you want to use Glassfish 5.0. It supports Java 8 up to 1.8.0_144 and has been tested also with Java 8 up to build 1.8.0_152-b16
- Install GlassFish application server
- Deploying multiple BellaDati WAR application in a single GlassFish application server is not supported. We do not test this configuration and updating any of the applications (even for point releases) is likely to break it.
- We recommend not deploying any other applications in the same GlassFish container that runs BellaDati, especially if these other applications have large memory requirements or require additional libraries in GlassFish's lib sub-directory. Multiple applications in a container can impact stability as a crash in one application could make the entire container inaccessible. Additionally, in order to update or reconfigure any of the applications, you'll need to restart the whole container.
Watch the video tutorial and or follow guidelines below
1. Setup data warehouse
Please follow the instructions on the Setting up the PostgreSQL Database page.
2. Download and extract BellaDati WAR Archive
Download the BellaDati WAR distribution as a ZIP archive from the BellaDati download page and extract its content using a tool such as 7-Zip for Windows or Linux's GNU tar tools. Only one of the files in the ZIP archive is used for this setup -
Avoid using Windows' built-in file extraction tool! This tool silently fails to extract files with long names. Other users have also reported problems with WinRAR.
Avoid using Solaris' default tar utility! Please use GNU tar on this operating system to extract BellaDati, as GNU tar handles long file names better.
3. Configure BellaDati WAR
Since version 2.7.14 there is no special configuration change needed, however, there are several advanced settings (e.g. enforcing the SSL), which are configurable in application.properties only.
Configuration settings are explained in detail in the BellaDati WAR Configuration Overview.
4. Configure GlassFish
4.1 Configure Memory Settings in GlassFish
BellaDati requires more memory than what GlassFish provides by default. This may lead to
OutOfMemory errors when running BellaDati if these memory settings are not increased.
To increase the available memory, log in into the GlassFish Administration console (by default available at port 4848). Open the Application server's JVM Settings menu and click on JVM Options. Change the setting for -XX:MaxPermSize to 512m and -Xmx to 2048m and change -client to -server as shown in the screenshot below. If any of these options doesn't exist yet, create it. Please make sure you don't have set a -server and -client option at the same time.
If you are using the command line, execute the following commands instead:
4.2 Configure Thread Pool Settings in GlassFish
We highly recommend to increase maximum thread pool size for thread pools called "http-thread-pool" and "thread-pool-1" in thread pool settings.
- Login to Administration console.
- Open Configurations->server-config-> Thread Pools
- Click on "http-thread-pool", set Max Thread Pool Size to 512 and save this change
- Click on "thread-pool-1", set Max Thread Pool Size to 512 and save this change
4.3 Configure the GlassFish's JDBC resource
BellaDati uses JDBC resources which connect to the database subsystem. Although BellaDati can connect to the database directly using its own JDBC setup (see JDBC settings in BellaDati Application Properties for a list of JVM options to add to GlassFish), we recommend using GlassFish's JDBC resources for better performance and more control over the database transaction management. You can set up the JDBC connection pool and JDBC resource following these steps:
4.3.1 Using GlassFish's Administration console
You can use the GlassFish's Administration console as described in the previous step:
1. Login to Administration console.
Resources->JDBC->Connection Pools and click the
3. Fill the Name, Type and Database Vendor fields and click Next.
4. Specify the database pool settings. The defaults may be fine, but we recommend to set values as shown on the right (see table Recommended connection parameters).
Good idea is to enable ping during pool creation;When enabled, the pool is pinged during creation or reconfiguration to identify and warn of any erroneous values for its attributes
5. In the property list, enter the values matching your system configuration for DatabaseName, User, Password, ServerName and Port. Remove all other properties.
6. After the connection pool was created, select it on the left side and click on tab
Advanced. Set Connection Settings and turn on Connection Validation using the settings shown on the right (see table Recommended connection parameters).
7. Please test connection by Ping button on the top of Edit JDBC Connection Pool page. You should see Ping Succeeded message.
If the ping message is with error: "Classname is wrong or classpath is not set for: org.postgresql.ds.PGConnectionPoolDataSource"
- Delete JDBC settings done in previous steps.
- Add suitable JDBC driver to ... /glassfish/domain/domain1/lib (see https://jdbc.postgresql.org/download.htmlhttps://jdbc.postgresql.org/download.html)
(For example, if JAVA 8 installed , driver postgresql-42.2.2.jar https://mvnrepository.com/artifact/org.postgresql/postgresql/42.2.2 is valid).
- Restart glassfish and start new JDBC setting up.
Resources->JDBC->Resources and click the
9. For JNDI Name, enter the value from jdbc.resource in BellaDati's
application.properties. As Pool Name, select the connection pool created during the previous steps.
4.3.2 Using the
1. Start GlassFish
2. Create a JDBC connection pool:
For DatabaseName, User, Password and ServerName, enter the values matching your system configuration.
3. Create a JDBC resource:
The jdbc/belladati_db corresponds to the parameter jdbc.resource from BellaDati's
4.4 Configure location for logs
The default location for logs generated by BellaDati (see Configure logging for more details) is relative to the exploded belladati.war which is not suitable for long term storage.
To change the logs directory, log in into the GlassFish Administration console (by default available at port 4848), open the Application server's JVM Settings menu and click on JVM Options. Add new option -Dlogs.location=<location> where <location> is the desired absolute path to the parent directory in which logs will be stored.
If you are using the command line, execute the following commands instead:
5. Deploying BellaDati into GlassFish
5.1 Using GlassFish's Administration console
You can use the Admin Console to deploy BellaDati into GlassFish.
- Log in to
- Click on the
Browseand select the
5.2 Using the
In order to deploy BellaDati, execute this command:
This command deploys the BellaDati WAR file under the
6. Run the Setup Wizard
7. Starting/Stopping GlassFish
GlassFish application server can be started/stopped from the command line or by using the service. This differs depending on the operating system used:
7.1 Windows command line
7.2 Windows service
If you want to install GlassFish as Windows service, you can either execute the following script or create it using the sc command manually:
Please note, that this script requires the Administrator privileges and .NET 3.5 installed on the machine.