ServiceLayer on TomEE
The shared folder should be created with two folders namely conf and where the necessary configuration files required for running the Service Layer application will be placed.
The conf folder should be placed with config and properties files required for Service Layer application namely, service-coherence-cache-config.xml, service-coherence-config.xml, Service.properties.
The lib folder should be populated with all the necessary third party jars like
- Download aspectj 1.8.10.jar from http://www.eclipse.org/downloads/download.php?file=/tools/aspectj/aspectj-1.8.10.jar
- Open aspectj-1.8.10.jar with an unzipping software and retrieve aspectjrt.jar and aspectjweaver.jar from the lib folder.
- Copy aspectjrt.jar and aspectjweaver.jar into libs sub-directory.
- Download log4j-1.2.17.jar from https://archive.apache.org/dist/logging/log4j/1.2.17/log4j-1.2.17.jar and copy it to libs sub-directory and rename it to log4j.jar.
- Copy the database drivers for your database into this directory.
- Oracle - The necessary driver, ojdbc8-12.2.0.1.jar, is included in the libs directory of the OIPA Media Pack.
- Microsoft SQL Server– download the sqljdbc4.jar library version 4.0 from https://mvnrepository.com/artifact/com.microsoft.sqlserver/sqljdbc4/4.0
- IBM DB2 – The necessary .jar files (db2jcc4) are included with the purchase of the DB2 software. These files are not available for download. Contact your IT department if you need assistance locating these files.
- Download Coherence Stand-Alone Install of version 12.2.1.3.0 from http://www.oracle.com/technetwork/middleware/coherence/downloads/coherence-archive-165749.html and upon execution of the jar file coherence will get installed and coherence.jar can be found in $ORACLE_HOME/coherence/lib, copy the same into libs folder.
- Use a text editor to open the Service.properties file that you just copied to the server. The Service.properties file contains properties for Oracle, SQL Server and DB2 database types, with the Oracle settings active by default. The inactive settings are commented out with a '#' character at the start of each line. To change a setting, remove the '#' from the required property setting, and insert it at the beginning of the setting you want to de-activate.
- The properties setting must match the type of database being used. Please refer to the System Properties document in the Oracle Insurance Policy Administration in OHC for a complete list of all properties and allowed values.
- application.databaseType
- jpa.databasePlatform
-
Use a text editor to open the logging.properties file that you just copied to the server.
- Edit the path mention for property "java.util.logging.FileHandler.pattern" with new application log location, For example, if application log location is /home/ServiceLayer/logs then set this value as java.util.logging.FileHandler.pattern = %h/ServiceLayer/logs/servicelayer%u.log. At the same time make sure that the directory created and has read/write permission.
setenv configuration
For Windows deployment we need to create setenv.bat file in the bin folder of extracted TomEE directory.
For Linux deployment we need to create setenv.sh file in the bin folder of extracted TomEE directory.
The following configuration needs to be placed in the setenv.bat file for Windows environment
For Linux environment in setenv.sh
Creating Data Sources
tomee.xml is the file where all the data sources, JMS configurations are made. Any data source, which is needed by an application to run, has to be configured in this file. ServiceLayer requires SERVICEDATASOURCE datasource to be created.
Sample configuration of all the data sources which are required for ServiceLayer to run:
Deploying ServiceLayer
Rename the ServiceLayer war from the distribution to ServiceLayer.war.
Deploy ServiceLayer war in webapps folder of TomEE application server.
Finally start the server and test the deployment with the following url: http://hostname:port/PASService/rest/services/resourcename ( resourcename : policies/clients etc)
Note: If you change the context name, use that name in the URL instead of PASService.