Navigation
Academic Area Reservations
Academic Areas
Academic Classifications
Academic Sessions
Add Academic Session
Add Application Setting
Add Building
Add Course Credit Type
Add Course Credit Unit
Add Course Offering
Add Course Type
Add Curriculum
Add Date Pattern
Add Default Manager Setting
Add Department
Add Designator
Add Distribution Preference
Add Event
Add Event Date Mapping
Add Event Info
Add Event Meetings
Add Examination
Add Examination Distribution Preference
Add Examination Period
Add Examination Type
Add Instructional Type
Add Instructor
Add Instructor Attribute
Add Instructor Attribute Type
Add Instructor Role
Add Logging Level
Add Non-University Location
Add Position Type
Add Reservation
Add Role
Add Room
Add Room Feature
Add Room Feature Type
Add Room Group
Add Room Type
Add Solver Configuration
Add Solver Group
Add Solver Parameter
Add Solver Parameter Group
Add Special Use Room
Add Sponsoring Organization
Add Standard Event Note
Add Status Type
Add Student Accommodation
Add Student Group
Add Student Group Type
Add Student Scheduling Status Type
Add Subject Area
Add Teaching Responsibility
Add Time Pattern
Add Timetable Manager
Add User
Additional Distribution Constraints
Administration Reports
Alternatives for Class
Application Configuration
Application Of Preferences
Application.properties
Assign Instructors
Assigned Classes
Assigned Examinations
Assigned Teaching Requests
Assignment History
Attachment Types
Banner Academic Sessions
Banner Message Responses
Banner Offering Detail
Banner Offering Edit
Banner Offerings
Banner Term CRN Properties
Bugs
Building UniTime
Buildings
CAS Authentication
CPSolver
Chameleon
Change Log for Student
Change Message for Student
Changes
Class Assignment
Class Assignment Properties
Class Assignments
Class Detail
Class Duration Types
Class Schedule
Class Timetable
Classes
Classes for Student
Conflict-Based Statistics
Constraint Solver Howto
Contact Us
Course Credit
Course Credit Formats
Course Credit Types
Course Credit Units
Course Finder
Course Reports
Course Reservations
Course Timetabling Solver
Course Timetabling Solver Log
Course Types
Credits
Current User
Curricula
Curriculum Detail
Curriculum Projection Rules
Curriculum Requested Enrollments
Curriculum Schedule
Curriculum Timetable
Custom Room Availability
Customizations
Data Exchange
Date Patterns
Default Academic Session
Default Manager Settings
Departmental Schedule
Departmental Timetable
Departments
Designator List
Distribution Preferences
Distribution Types
Eclipse
Edit Academic Session
Edit Application Setting
Edit Building
Edit Class
Edit Course Credit Format
Edit Course Credit Formats
Edit Course Credit Type
Edit Course Credit Types
Edit Course Credit Unit
Edit Course Credit Units
Edit Course Offering
Edit Course Type
Edit Course Types
Edit Curriculum
Edit Date Pattern
Edit Default Manager Setting
Edit Department
Edit Designator
Edit Distribution Preference
Edit Distribution Type
Edit Event
Edit Event Date Mapping
Edit Event Date Mappings
Edit Event Status
Edit Event Statuses
Edit Examination
Edit Examination Distribution Preference
Edit Examination Period
Edit Examination Type
Edit Examination Types
Edit Instructional Type
Edit Instructor
Edit Instructor Attribute
Edit Instructor Attribute Type
Edit Instructor Attribute Types
Edit Instructor Role
Edit Instructor Roles
Edit Logging Level
Edit Logging Levels
Edit Manager Setting
Edit Offering Consent Type
Edit Offering Consent Types
Edit Permission
Edit Permissions
Edit Point In Time Data Snapshot
Edit Point In Time Data Snapshots
Edit Position Type
Edit Position Types
Edit Reservation
Edit Role
Edit Roles
Edit Room
Edit Room Availability
Edit Room Departments
Edit Room Event Availability
Edit Room Feature
Edit Room Feature Type
Edit Room Feature Types
Edit Room Features
Edit Room Group
Edit Room Groups
Edit Room Preference
Edit Room Type
Edit Scheduling Subpart
Edit Solver Configuration
Edit Solver Group
Edit Solver Parameter
Edit Solver Parameter Group
Edit Sponsoring Organization
Edit Standard Event Note
Edit Status Type
Edit Student Accommodation
Edit Student Accommodations
Edit Student Group
Edit Student Group Type
Edit Student Group Types
Edit Student Groups
Edit Student Scheduling Status Type
Edit Student Scheduling Status Types
Edit Subject Area
Edit Teaching Responsibilities
Edit Teaching Responsibility
Edit Time Pattern
Edit Timetable Manager
Edit User
Email
Enrollment Audit PDF Reports
Enrollments of Class or Course
Event Date Mappings
Event Detail
Event Reports
Event Room Availability
Event Room Selection
Event Schedule
Event Service Providers
Event Statuses
Event Timetable
Events
Exact Time Pattern
Exam Naming Convention
Exam Timetable
Examination Assignment
Examination Assignment Changes
Examination Conflict-Based Statistics
Examination Detail
Examination Distribution Preferences
Examination PDF Reports
Examination Periods
Examination Reports
Examination Schedule
Examination Solution Properties
Examination Solver
Examination Solver Log
Examination Solver Status
Examination Statuses
Examination Timetable
Examination Timetabling
Examination Types
Examinations
Exporting Solver XML
Frequently Asked Questions
Hibernate Statistics
Instructional Methods
Instructional Offering Configuration
Instructional Offering Cross Lists
Instructional Offering Detail
Instructional Offerings
Instructional Types
Instructor Assignment Preferences
Instructor Attribute Types
Instructor Attributes
Instructor Detail
Instructor Preferences
Instructor Roles
Instructor Scheduling
Instructor Scheduling Solver
Instructor Scheduling Solver Log
Instructors
LDAP Authentication / Lookup
Last Changes
Limit and Projection Snapshot
Localization
Logging Levels
Lookup Classes
Lookup Examinations
Main Page
Majors
Manage Instructor List
Manage Solvers
Manager Settings
Mass cancel...
Meetings
Minors
Multiple Class Setup
Not-Assigned Classes
Not-Assigned Examinations
Not-Assigned Teaching Requests
Offering Consent Types
Online Student Scheduling Dashboard
OpenStreetMap
Page Statistics
People
People Lookup
Permissions
Personal Examination Schedule
Personal Schedule
Personal Timetable
Point In Time Data Reports
Point In Time Data Snapshots
Position Types
PostgreSQL
Published Schedule Runs
Reservations
Roles
Roll Forward Banner Session
Roll Forward Session
Room Availability
Room Detail
Room Feature Types
Room Features
Room Groups
Room Schedule
Room Timetable
Room Types
Rooms
SVN
Saved Timetables
Scheduling Dashboard Filter
Scheduling Subpart Detail
Scripts
Select Academic Session
Select User Role
Send email...
Setup Examination Periods
Setup Teaching Requests
Solution Properties
Solution Reports
Solver
Solver Configurations
Solver Groups
Solver Load Balancing
Solver Log
Solver Parameter Groups
Solver Parameters
Solver Status
Solver Warnings
Sponsoring Organizations
Standard Event Notes
Status Types
Structure of Distribution Preferences
Student Accommodations
Student Advisors
Student Conflicts
Student Course Requests
Student Group Types
Student Groups
Student Luch Break
Student Scheduling Assistant
Student Scheduling Status Types
Student Sectioning Dashboard
Student Sectioning Reports
Student Sectioning Solution Properties
Student Sectioning Solver
Student Sectioning Solver Log
Subject Areas
Subject Schedule
Subject Timetable
Suggestions
Task Details
Task Scheduler
Teaching Assignment Changes
Teaching Assignment Detail
Teaching Assignments
Teaching Request Detail
Teaching Responsibilities
Test HQL
Time Patterns
Timetable
Timetable Managers
Timetables
Timetabling
Timetabling Benchmarks
Timetabling CVS Access
Timetabling Development using MyEclipse
Timetabling Development using NetBeans
Timetabling Installation FAQ
Tips and Tricks
Types of Distribution Preferences
UniTime 4.4 Online Documentation
UniTime Installation
Update Meetings
Users (Database Authentication)
 

UniTime Installation

Contents

  1. 1 For simplified step by step installation notes, seeSetting up UniTime on LinuxSetting up UniTime on WindowsSetting up UniTime on Mac 
  2. 2 Prerequisites
    1. 2.1 Java Development Kit
  3. 3 If you do not have Java SE (Standard Edition) Development Kit 8.0 or later already installed, you will need to download and install it from Java SE Downloads first.OpenJDK 8 and 11 (using HotSpot JVM) are being used in the development and/or testing.
    1. 3.1 Apache Tomcat
  4. 4 Download Apache Tomcat.Both versions 8.5 and 9.0 are used for development and/or testing.Install Apache TomcatFor more information about Tomcat setup see this Tomcat 8.5 Setup User GuideYou might want to set up SSL (HTTPS) access to your tomcat. See SSL Configuration HOW-TO for more details.
    1. 4.1 MySQL
  5. 5 Download MySQL from MySQL DownloadsMySQL version 5.7 and Oracle version 19c are currently being used in development and testing.MySQL 8.0 is supported as well, though you may need to add serverTimezone parameter in the connection string (see MySQL Time Zone Support for more details).Install MySQLSee MySQL 5.7 Reference Manual for more details about installationInstall MySQL JDBC driverThe driver can be downloaded from the Download Connector/J page. Please make sure you use the same version as your MySQL database.Unzip the downloaded driver if needed and place the mysql-connector-java-5.7.x.jar under the Tomcat/lib folder.
  6. 6 Installation
  7. 7 Download the latest UniTime 4.4 distribution from UniTime DownloadsAll distributions are platform-independent, distributed in either .zip or .tar.gz formatAlternatively, you can download the most recent nightly build from UniTime Nightly BuildsUnzip the archivetar -xvzf unitime-4.4_bld148.tar.vz Install timetable databaseMySQL installation scripts are located in doc/mysql folder of the distributionFile schema.sql contains the database schema, file woebegon-data.sql contains test data (Woebegon College Test Suite, see Online Demo for more details).If you want to change the default user name/password, edit the file schema.sql first. The user is created at the very beginning of the script.Timetable database can be created and populated using the mysql command-line toolAfter running "schema.sql", you need to populate the database either using "woebegon-data.sql" or "blank-data.sql" fileWhen woebegon-data are used, you will be able to login into the application using the same credentials as described on our online demo pageWhen blank-data are used, there is only administrator account created. Both username and password are admin.mysql -uroot -p -f <schema.sql mysql -uroot -p <woebegon-data.sql Deploy UniTime applicationCopy web/UniTime.war to Tomcat/webapps, where Tomcat is the folder where Tomcat is installed.On unix based systems (including Mac OS X), java virtual machine that is running tomcat needs to be switched to headless mode. You can do that using JAVA_OPTS environment variable prior to starting tomcat: export JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true" Also, you might need to give Tomcat more memory to work with by changing the upper limit on the memory that it can allocate (especially if you are planning not to run any remote solver servers -- see below; default is 64MB). You can do that using JAVA_OPTS environment variable as well: export JAVA_OPTS="${JAVA_OPTS} -Xmx2048m" Start tomcatIf everything goes well, you should be able to see UniTime application at http://localhost:8080/UniTime or https://localhost:8443/UniTime when SSL connector is enabled.If not, please check the tomcat log for any potential problems -- it is located at Tomcat/logs/catalina.outPlease refer to for a solution Installation FAQ and/or write us an email to support@unitime.orgTip: If you have installed Tomcat on a Linux based machine from a package (e.g., by running apt-get install tomcat8), you will need to make sure that there is a data folder available within the tomcat directory and that Tomcat has enough permissions to write files in there. This can be accomplished with something like:mkdir /var/lib/tomcat8/datachown tomcat8 /var/lib/tomcat8/data Tomcat configuration (including the  JAVA_OPTS variable) is located in the /etc/default/tomcat8 file in this case.
  8. 8 Upgrade
  9. 9 To upgrade an existing UniTime installation, only the new UniTime.war file should be placed in the Tomcat/webapps folder instead of the existing one. All the necessary changes to the database are done automatically during the first deployment. The safest way to do so is as follows:Stop tomcatBackup the existing database (e.g., using mysqldump on MySQL or exp on Oracle)In Tomcat/webapps, remove UniTime folder and replace the existing UniTime.war with the new oneDelete the content of Tomcat/work folder.Start the tomcatIf you are using remove solver servers, the appropriate JARs need to be updated as well.If upgrading from UniTime 3.3If you are using LDAP for authentication, some configuration properties will need to be changed. See LDAP Authentication / Lookup page for details.If upgrading from UniTime 3.4If you are using remote solver servers and/or multiple tomcats, see below how to setup a cluster.If upgrading from UniTime 3.5If you are using MySQL, place the MySQL JDBC driver in the Tomcat/lib folder (the driver can be downloaded from the Download Connector/J page, see above).See UniTime 4.4 release notes for other changes.
  10. 10 Customization
  11. 11 Custom PropertiesThere are a lot of properties that are defined in file application.properties that is located in timetable.jar that is located in UniTime.war at WEB-INF/lib. These properties can be changed in one of the following ways:By providing custom property file, this file should be named custom.properties and located in UniTime.war at WEB-INF/classes.Alternatively, custom property file can be located somewhere else, with system property tmtbl.custom.properties pointing to it.By adding and/or changing the appropriate properties directly in the UniTime application -- see Administration / Defaults / Configuration menu item when logged in as administrator.By adding these properties in Tomcat/conf/catalina.propertiesBy providing JVM that is running tomcat with the appropriate system properties, for instance:export JAVA_OPTS="${JAVA_OPTS} -Dtmtbl.title=Timetabling Demo" export JAVA_OPTS="${JAVA_OPTS} -Dtmtbl.custom.properties=/etc/default/unitime.propertiesTip: Name the custom properties file Tomcat/conf/unitime.properties and put all the properties you need in there. For UniTime to use the file, add the following line to Tomcat/conf/catalina.propertiestmtbl.custom.properties=${catalina.base}/conf/unitime.propertiesIf the same property is defined on multiple places, the first one from the following order will be taken:UniTime Configuration (Administration / Defaults / Configuration menu item)System property (-Dproperty=value, or defined in Tomcat/conf/catalina.properties)File custom.properties (UniTime.war/WEB-INF/classes/custom.properties or as defined by tmtbl.custom.properties system property)File application.properties (UniTime.war/WEB-INF/lib/timetable.jar/application.properties)Database ConnectionThe database connection can be changed using custom properties. However, please note that these properties cannot be defined using the UniTime application (Administration / Defaults / Configuration menu item) since the database connection needs to be configured before the database can be accessed. For instance, custom.properties file can contain: # MySQL Configuration Example  connection.url=jdbc:mysql://localhost:3306/timetable?serverTimezone=Europe/Prague connection.username=timetable connection.password=unitime connection.driver_class=com.mysql.jdbc.Driver dialect=org.hibernate.dialect.MySQLInnoDBDialect tmtbl.uniqueid.generator=org.hibernate.id.TableHiLoGenerator default_schema=timetableSee LDAP Authentication / Lookup page for notes about LDAP integration.See Customizations page for notes about custom styling (branding) of the UniTime application.
  12. 12 Remote Solver Server(s)
  13. 13 By default, all timetabling problems are solved within the application (using the same Java Virtual Machine), however, especially for bigger institutions, it might be desired to solve the timetabling problems by one or more separate solver servers.All the necessary libraries are in the solver folder of the distribution except the JDBC driver. For MySQL download mysql-connector-java-5.1.36.jar , for Oracle download ojdbc7.jar and name it ojdbc7-12.1.0.2.jar.Place the JDBC driver in the solver directory (same location as the timetable.jar), for instance:curl https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.46/mysql-connector-java-5.1.46.jar --output solver/mysql-connector-java-5.1.36.jarTo run a remote solver, do:java -Xmx2g -Dtmtbl.custom.properties=custom.properties -jar solver/timetable.jarFile custom.properties should contain all the custom parameters needed for the starting up the server (e.g., database connection properties, if different from the defaults). It is usually the same as the one used on the Tomcat, except the jgroups.tcp.address property (see below). The load is automatically and seamlessly balanced between the remote solvers. The remote solver server also automatically reconnects itself when the web server is restarted. When the remote solver is shut down, all active timetabling instances are backed up and restored when the solver server is started again. The following properties need to be set in the custom.properties file. Please note that all these properties need to be set on the Tomcat side as well.jgroups.tcp.address=127.0.0.1IP address of the machine that is using this configuration file. This property should be different on each machine, the ramining properties are usually the same for all the UniTime instances (Tomcats as well as remote solver servers). If the property is set to 127.0.0.1 or localhost, the server will not be able to accept remote connections -- use only if all the instances are running on the same machine!unitime.solver.cluster=trueThis property enables the Solver cluster. This cluster is used for RPCs between the Tomcat(s) and the remote solver server(s). Communication between UniTime instances is done using JGroups.unitime.solver.port=7800Default communication port for the Solver cluster. If the given port is taken (e.g., there are running multiple remote solver server(s) on the same machine), the next one available will be used instead.unitime.solver.initial_hosts=127.0.0.1[7800]By default, TCP ping discovery is used to form a cluster. The above parameter defines a comma separated list of machines (and their communication ports) on which a UniTime instance may be running. It does not necessary need to have all the possible IP addresses, usually it is set to the IP addresses of the Tomcat server(s) running UniTime.unitime.solver.jgroups.config=solver-jgroups-tcp.xmlAn alternative JGroups configuration file can be provided with this property. The default configuration file is available here.unitime.enrollment.server.replicated=falseThis property enables replication of online student scheduling servers. If enabled, there is an additional Enrollment cluster is formed and the same instance (academic session) of an online student scheduling server can be spawn by each of the servers (with the data replicated among them). By default, one of them will be elected as master and handle all the updates, while the others will assist in no-updating queries (e.g., computation of a student's schedule or suggestions) and step in in case of a failover. It is also possible to direct particular academic sessions to a particular UniTime instances (Tomcats or remote solver servers) using the unitime.enrollment.term, unitime.enrollment.year, unitime.enrollment.campus properties (containing a regular expression which has to match against academic session term, year and initiative respectively).unitime.enrollment.port=7866If online student scheduling server replication is enabled, additional Enrollment cluster is formed. It is used to replicate data between online student scheduling instances. This is the communication port for the Enrollment cluster.unitime.enrollment.initial_hosts=127.0.0.1[7866]List of initial hosts for the Enrollment cluster.unitime.enrollment.jgroups.config=sectioning-jgroups-tcp.xmlAn alternative JGroups configuration file can be provided with this property. The default configuration file is available here.The remote solvers can be managed in the UniTime application, see Administration > Solver > Manage Solvers menu item when logged in as an administrator.Tip:  If you use a different version of the JDBC driver, it needs to be added to the classpath. For example:java -Xmx2g -Dtmtbl.custom.properties=custom.properties -cp solver/timetable.jar:solver/mysql-connector-java-5.1.46.jar org.unitime.timetable.solver.jgroups.SolverServerImplementation
  14. 14 Having Multiple Tomcats (Clustering)
  15. 15 With UniTime 4.0, it is possible to run multiple instances of UniTime on a cluster of Tomcats and/or remote solver servers. Besides of the Solver cluster and Enrollment cluster, it is also possible to form a Hibernate cluster that is used to replicate Hibernate L2 cache. The following properties can be used to configure the Hibernate cluster.unitime.hibernate.cluster=trueThis property enables the Hibernate cluster. This cluster is used for replication of Hibernate second level cache between multiple UniTime instances.unitime.hibernate.port=7833Default communication port for the Hibernate cluster. If the given port is taken (e.g., there are running multiple remote solver server(s) on the same machine), the next one available will be used instead.unitime.hibernate.initial_hosts=127.0.0.1[7833]By default, TCP ping discovery is used to form a cluster. The above parameter defines a comma separated list of machines (and their communication ports) on which a UniTime instance may be running. It does not necessary need to have all the possible IP addresses, usually it is set to the IP addresses of the Tomcat server(s) running UniTime.unitime.hibernate.jgroups.config=hibernate-jgroups-tcp.xmlAn alternative JGroups configuration file can be provided with this property. The default configuration file is available here.Please note that Hibernate cluster is only needed when there are two or more Tomcats running UniTime. Remote solver servers have the L2 cache disabled and hence no need to connect to the Hibernate cluster.
  16. 16 Using Oracle Database
  17. 17 Here are some notes about using Oracle DatabaseThe following custom properties need to be set (connection URL, username, password may vary)# Oracle Configuration Example connection.url=jdbc:oracle:thin:@localhost:1521:xe connection.username=timetable connection.password=unitime connection.driver_class=oracle.jdbc.driver.OracleDriver dialect=org.hibernate.dialect.Oracle10gDialect tmtbl.uniqueid.generator=org.hibernate.id.SequenceGenerator If the schema is different to timetable, the default_schema property needs to be changed as welldefault_schema=timetable File ojdbc7.jar (or later) needs to be copied either to Tomcat/lib or to Tomcat/webapps/UniTime/WEB-INF/lib. This file can be downloaded, e.g., from Oracle JDBC DriversOracle installation scripts are located in doc/oracle folder of the distributionAlternatively, the database can be imported using imp tool and the woebegon.dat from the GitHub.imp timetable/###### file=woebegon.dat full=y User timetable needs to be created first, e.g., using sqlplussqlplus systemcreate user timetable identified by ######; grant dba to timetable; exit  
  18. 18 Using PostgreSQL
  19. 19 Here are some notes about using PostgreSQL, for more details please see the Migrating to PostgreSQL document.Install PostgreSQL 12.0 or later from https://www.postgresql.org/download (using the default port 5432, and a custom password)Create timetable user and timetable database, using the same name and credentials as the default UniTime database:createuser --interactive --pwprompt -U postgresEnter name of role to add: timetableEnter password for new role: unitimeEnter it again: unitimeShall the new role be a superuser? (y/n) nShall the new role be allowed to create databases? (y/n) yShall the new role be allowed to create more new roles? (y/n) nPassword: <password provided during install>createdb timetable -U timetable -O timetablePassword: unitimePopulate the timetable database, using this timetable.sql file (Documentation/Database/PostgreSQL/timetable.sql in https://github.com/UniTime/unitime)psql -U timetable <timetable.sqlDownload JDBC Driver from https://jdbc.postgresql.org/download.html and place it to Tomcat/lib (e.g., postgresql-42.2.8.jar)Change UniTime connection properties. The following custom properties need to be set (connection URL, username, password may vary)# PostgreSQL Configuration Exampleconnection.url=jdbc:postgresql://localhost:5432/timetable connection.driver_class=org.postgresql.Driver dialect=org.hibernate.dialect.PostgreSQL9Dialect connection.username=timetable connection.password=unitime default_schema=timetable hibernate.dbcp.validationQuery=select 1 hibernate.globally_quoted_identifiers=trueStart UniTime, check the logs for any errors.
  20. 20 Notes
  21. 21 Here are the UniTime 4.x Installation Notes on LinuxHere are the UniTime 4.x Installation Notes on Windows

For simplified step by step installation notes, see

Prerequisites

Java Development Kit

Apache Tomcat

MySQL

  • Download MySQL from MySQL Downloads
    • MySQL version 5.7 and Oracle version 19c are currently being used in development and testing.
    • MySQL 8.0 is supported as well, though you may need to add serverTimezone parameter in the connection string (see MySQL Time Zone Support for more details).
  • Install MySQL
  • Install MySQL JDBC driver
    • The driver can be downloaded from the Download Connector/J page. Please make sure you use the same version as your MySQL database.
    • Unzip the downloaded driver if needed and place the mysql-connector-java-5.7.x.jar under the Tomcat/lib folder.

Installation

tar -xvzf unitime-4.4_bld148.tar.vz
  • Install timetable database
    • MySQL installation scripts are located in doc/mysql folder of the distribution
    • File schema.sql contains the database schema, file woebegon-data.sql contains test data (Woebegon College Test Suite, see Online Demo for more details).
      • If you want to change the default user name/password, edit the file schema.sql first. The user is created at the very beginning of the script.
    • Timetable database can be created and populated using the mysql command-line tool
      • After running "schema.sql", you need to populate the database either using "woebegon-data.sql" or "blank-data.sql" file
        • When woebegon-data are used, you will be able to login into the application using the same credentials as described on our online demo page
        • When blank-data are used, there is only administrator account created. Both username and password are admin.
mysql -uroot -p -f <schema.sql
mysql -uroot -p <woebegon-data.sql
  • Deploy UniTime application
    • Copy web/UniTime.war to Tomcat/webapps, where Tomcat is the folder where Tomcat is installed.
    • On unix based systems (including Mac OS X), java virtual machine that is running tomcat needs to be switched to headless mode. You can do that using JAVA_OPTS environment variable prior to starting tomcat:
export JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true"
    • Also, you might need to give Tomcat more memory to work with by changing the upper limit on the memory that it can allocate (especially if you are planning not to run any remote solver servers -- see below; default is 64MB). You can do that using JAVA_OPTS environment variable as well:
export JAVA_OPTS="${JAVA_OPTS} -Xmx2048m"
  • Start tomcat
  • Tip: If you have installed Tomcat on a Linux based machine from a package (e.g., by running apt-get install tomcat8), you will need to make sure that there is a data folder available within the tomcat directory and that Tomcat has enough permissions to write files in there. This can be accomplished with something like:
mkdir /var/lib/tomcat8/data
chown tomcat8 /var/lib/tomcat8/data
    • Tomcat configuration (including the  JAVA_OPTS variable) is located in the /etc/default/tomcat8 file in this case.

    Upgrade

    Customization

    • Custom Properties
      • There are a lot of properties that are defined in file application.properties that is located in timetable.jar that is located in UniTime.war at WEB-INF/lib. These properties can be changed in one of the following ways:
        1. By providing custom property file, this file should be named custom.properties and located in UniTime.war at WEB-INF/classes.
          • Alternatively, custom property file can be located somewhere else, with system property tmtbl.custom.properties pointing to it.
        2. By adding and/or changing the appropriate properties directly in the UniTime application -- see Administration / Defaults / Configuration menu item when logged in as administrator.
        3. By adding these properties in Tomcat/conf/catalina.properties
        4. By providing JVM that is running tomcat with the appropriate system properties, for instance:
    export JAVA_OPTS="${JAVA_OPTS} -Dtmtbl.title=Timetabling Demo"
    export JAVA_OPTS="${JAVA_OPTS} -Dtmtbl.custom.properties=/etc/default/unitime.properties
      • Tip: Name the custom properties file Tomcat/conf/unitime.properties and put all the properties you need in there. For UniTime to use the file, add the following line to Tomcat/conf/catalina.properties
    tmtbl.custom.properties=${catalina.base}/conf/unitime.properties
      • If the same property is defined on multiple places, the first one from the following order will be taken:
        1. UniTime Configuration (Administration / Defaults / Configuration menu item)
        2. System property (-Dproperty=value, or defined in Tomcat/conf/catalina.properties)
        3. File custom.properties (UniTime.war/WEB-INF/classes/custom.properties or as defined by tmtbl.custom.properties system property)
        4. File application.properties (UniTime.war/WEB-INF/lib/timetable.jar/application.properties)
    • Database Connection
      • The database connection can be changed using custom properties. However, please note that these properties cannot be defined using the UniTime application (Administration / Defaults / Configuration menu item) since the database connection needs to be configured before the database can be accessed. For instance, custom.properties file can contain:
    # MySQL Configuration Example
     connection.url=jdbc:mysql://localhost:3306/timetable?serverTimezone=Europe/Prague
    connection.username=timetable
    connection.password=unitime
    connection.driver_class=com.mysql.jdbc.Driver
    dialect=org.hibernate.dialect.MySQLInnoDBDialect
    tmtbl.uniqueid.generator=org.hibernate.id.TableHiLoGenerator
    default_schema=timetable

    Remote Solver Server(s)

    curl https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.46/mysql-connector-java-5.1.46.jar --output solver/mysql-connector-java-5.1.36.jar
    • To run a remote solver, do:
    java -Xmx2g -Dtmtbl.custom.properties=custom.properties -jar solver/timetable.jar
    • File custom.properties should contain all the custom parameters needed for the starting up the server (e.g., database connection properties, if different from the defaults). It is usually the same as the one used on the Tomcat, except the jgroups.tcp.address property (see below). The load is automatically and seamlessly balanced between the remote solvers. The remote solver server also automatically reconnects itself when the web server is restarted. When the remote solver is shut down, all active timetabling instances are backed up and restored when the solver server is started again. The following properties need to be set in the custom.properties file. Please note that all these properties need to be set on the Tomcat side as well.
    jgroups.tcp.address=127.0.0.1
    IP address of the machine that is using this configuration file. This property should be different on each machine, the ramining properties are usually the same for all the UniTime instances (Tomcats as well as remote solver servers). If the property is set to 127.0.0.1 or localhost, the server will not be able to accept remote connections -- use only if all the instances are running on the same machine!
    unitime.solver.cluster=true
    This property enables the Solver cluster. This cluster is used for RPCs between the Tomcat(s) and the remote solver server(s). Communication between UniTime instances is done using JGroups.
    unitime.solver.port=7800
    Default communication port for the Solver cluster. If the given port is taken (e.g., there are running multiple remote solver server(s) on the same machine), the next one available will be used instead.
    unitime.solver.initial_hosts=127.0.0.1[7800]
    By default, TCP ping discovery is used to form a cluster. The above parameter defines a comma separated list of machines (and their communication ports) on which a UniTime instance may be running. It does not necessary need to have all the possible IP addresses, usually it is set to the IP addresses of the Tomcat server(s) running UniTime.
    unitime.solver.jgroups.config=solver-jgroups-tcp.xml
    An alternative JGroups configuration file can be provided with this property. The default configuration file is available here.

    unitime.enrollment.server.replicated=false

    This property enables replication of online student scheduling servers. If enabled, there is an additional Enrollment cluster is formed and the same instance (academic session) of an online student scheduling server can be spawn by each of the servers (with the data replicated among them). By default, one of them will be elected as master and handle all the updates, while the others will assist in no-updating queries (e.g., computation of a student's schedule or suggestions) and step in in case of a failover. It is also possible to direct particular academic sessions to a particular UniTime instances (Tomcats or remote solver servers) using the unitime.enrollment.term, unitime.enrollment.year, unitime.enrollment.campus properties (containing a regular expression which has to match against academic session term, year and initiative respectively).

    unitime.enrollment.port=7866
    If online student scheduling server replication is enabled, additional Enrollment cluster is formed. It is used to replicate data between online student scheduling instances. This is the communication port for the Enrollment cluster.
    unitime.enrollment.initial_hosts=127.0.0.1[7866]
    List of initial hosts for the Enrollment cluster.
    unitime.enrollment.jgroups.config=sectioning-jgroups-tcp.xml
    An alternative JGroups configuration file can be provided with this property. The default configuration file is available here.
    • The remote solvers can be managed in the UniTime application, see Administration > Solver > Manage Solvers menu item when logged in as an administrator.
    • Tip:  If you use a different version of the JDBC driver, it needs to be added to the classpath. For example:

    java -Xmx2g -Dtmtbl.custom.properties=custom.properties -cp solver/timetable.jar:solver/mysql-connector-java-5.1.46.jar org.unitime.timetable.solver.jgroups.SolverServerImplementation

    Having Multiple Tomcats (Clustering)

    With UniTime 4.0, it is possible to run multiple instances of UniTime on a cluster of Tomcats and/or remote solver servers. Besides of the Solver cluster and Enrollment cluster, it is also possible to form a Hibernate cluster that is used to replicate Hibernate L2 cache. The following properties can be used to configure the Hibernate cluster.

    unitime.hibernate.cluster=true
    This property enables the Hibernate cluster. This cluster is used for replication of Hibernate second level cache between multiple UniTime instances.
    unitime.hibernate.port=7833
    Default communication port for the Hibernate cluster. If the given port is taken (e.g., there are running multiple remote solver server(s) on the same machine), the next one available will be used instead.
    unitime.hibernate.initial_hosts=127.0.0.1[7833]
    By default, TCP ping discovery is used to form a cluster. The above parameter defines a comma separated list of machines (and their communication ports) on which a UniTime instance may be running. It does not necessary need to have all the possible IP addresses, usually it is set to the IP addresses of the Tomcat server(s) running UniTime.
    unitime.hibernate.jgroups.config=hibernate-jgroups-tcp.xml
    An alternative JGroups configuration file can be provided with this property. The default configuration file is available here.
    Please note that Hibernate cluster is only needed when there are two or more Tomcats running UniTime. Remote solver servers have the L2 cache disabled and hence no need to connect to the Hibernate cluster.

    Using Oracle Database

    Here are some notes about using Oracle Database

    • The following custom properties need to be set (connection URL, username, password may vary)
    # Oracle Configuration Example
    connection.url=jdbc:oracle:thin:@localhost:1521:xe
    connection.username=timetable
    connection.password=unitime
    connection.driver_class=oracle.jdbc.driver.OracleDriver
    dialect=org.hibernate.dialect.Oracle10gDialect
    tmtbl.uniqueid.generator=org.hibernate.id.SequenceGenerator
    • If the schema is different to timetable, the default_schema property needs to be changed as well
    default_schema=timetable
    imp timetable/###### file=woebegon.dat full=y
    • User timetable needs to be created first, e.g., using sqlplus
    sqlplus system
    create user timetable identified by ######; grant dba to timetable; exit
     

    Using PostgreSQL

    • Install PostgreSQL 12.0 or later from https://www.postgresql.org/download (using the default port 5432, and a custom password)
    • Create timetable user and timetable database, using the same name and credentials as the default UniTime database:
    createuser --interactive --pwprompt -U postgres

    Enter name of role to add: timetable

    Enter password for new role: unitime

    Enter it again: unitime

    Shall the new role be a superuser? (y/n) n

    Shall the new role be allowed to create databases? (y/n) y

    Shall the new role be allowed to create more new roles? (y/n) n

    Password: <password provided during install>


    createdb timetable -U timetable -O timetable

    Password: unitime

    psql -U timetable <timetable.sql
    • Download JDBC Driver from https://jdbc.postgresql.org/download.html and place it to Tomcat/lib (e.g., postgresql-42.2.8.jar)
    • Change UniTime connection properties. The following custom properties need to be set (connection URL, username, password may vary)
    # PostgreSQL Configuration Example
    connection.url=jdbc:postgresql://localhost:5432/timetable connection.driver_class=org.postgresql.Driver dialect=org.hibernate.dialect.PostgreSQL9Dialect connection.username=timetable connection.password=unitime default_schema=timetable hibernate.dbcp.validationQuery=select 1 hibernate.globally_quoted_identifiers=true
    • Start UniTime, check the logs for any errors.

    Notes

    • Here are the UniTime 4.x Installation Notes on Linux
    • Here are the UniTime 4.x Installation Notes on Windows


    Updated on Pro 1, 2020 by Tomáš Müller (Version 2)