- Created by Ravikumar Babu CTOO (Unlicensed) , last modified by Lakshminarayanan1 S CTOO (Unlicensed) on Jul 09, 2020
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 17 Next »
Not all the questions on this page are directly related to Canvas deployment, e.g. questions on Oracle database. Some of these questions were asked by participants during the Canvas training sessions. We have answered those here for the larger benefit of the Canvas Developer community.
- At command prompt, type sqlplus and press ENTER.
- Enter the DBA User ID and press ENTER.
- Enter the DBA User Password and press ENTER.
If the credentials are correct the connection to Oracle database will be successful.
After successfully connecting to the Oracle database at the command prompt as suggested in previous question, enter the following command:
show parameter service_name
- In the result, the VALUE column displays the Oracle SID.
The ‘config.txt’ file contains the configuration details to connect to the database and execute the schema scripts of Canvas Technology framework. It is essential that you provide the correct DBA user ID and password in the ‘config.txt’ file to connect to the Oracle database. The Canvas schema scripts are executed on the connected database.
It is because, by default the ‘run.bat’ file executes the schema scripts of CT ModelHouse, Expert Studio, and Wizard Studio. However, you can specify which scripts to be executed in the APP_LIST parameter in the 'config.txt' file by removing the unwanted schemas:
APP_LIST=ctmodelhouse, ctstudio/Expert, ctstudio/Wizard # Here, ctmodelhouse is the schema for the sample application, ModelHouse, that is packaged with Canvas Framework. # ctstudio/Expert is the schema for Canvas Expert Studio (Canvas Studio). # ctstudio/Wizard is the schema for Canvas Wizard Studio.
To export a schema from Oracle 12c database, perform the following:
Connect to the Oracle 12c database and check the existing directories using the following SQL command:
select * from all_directories;
Export the required schema using the following SQL command:
expdp dumpfile=<DumpFilename>.dmp logfile=<LogFilename>.log directory=<DirectoryName> schemas=<SCHEMA_NAME>; --Example: expdp dumpfile=CMS.dmp logfile=CMS.log directory=LOG_FILE_DIR schemas=CMS;
Use the following syntax when prompted for user name:
sys/<Password>@<Servicename>as sysdba --Example: sys/Password@pdborcl as sysdba
- Open Oracle SQL Developer.
- In the Connections tab on the left-hand side, right-click Connections and select New Connection.
- In the New / Select Database Connection dialog box, enter the Connection Name. For example, to connect to Model schema, enter MODEL. (This value must be similar to the name of schema given in the ‘config.txt’ file)
- Enter the schema username and password in the Username and Password fields respectively. For example, for Model schema, enter MODEL / MODEL (These values must be similar to the values given in the ‘config.txt’ file)
- Ensure the correct Hostname, Port, and SID are given in the respective fields.
- Click Test. If the credentials are correct the connection to the schema will be successful.
- Click Connect.
- After schema connection is established, check if you are able to view the schemas contents.
- Open System Properties. (My Computer > Properties)
- In the Advanced tab, click Environment Variables.
- In the User variables for section of Environment Variables dialog box, click New to create new variables. Ensure you create new variables for Java, Ant, Oracle as shown in the following screenshot:
- Edit the path variable and map the environment variables of Java and Ant as shown in the following screenshot. Ensure that the variables are mapped to the folder that contains the installed files of Java, Oracle, and Ant.
- Click OK.
- Click OK on the Environment Variables dialog box.
To check if the environment variables are set correctly, at the command prompt check the version of Java installed on your system by entering the following command:
java –version
If the environment variables are set correctly, the version of Java installed on your system is displayed.
- To start the Tomcat server, double-click the startup.bat file in the Tomcat folder (e.g. ‘D:\Canvas\apache-tomcat-7.0.67\bin’).
- To stop the Tomcat server, press CTRL + C in the command prompt.
Let’s assume that the context root of the application is dliteweb.
In the JBoss EAP 7.x Installed folder (e.g. 'D:\Canvas\JBoss EAP 7.x Installed folder\standalone\deployments\ctmodelhouse.war \WEB-INF\jboss-web.xml’), specify the context root in the jboss-web.xml file, as shown in the following code snippet:
<context-root> <dliteweb> </context-root>
Note
This step is applicable only for the JBoss application server. If you use Tomcat or any other app server, proceed to step 2.
In the CTResources.jar folder (e.g. ‘D:\Canvas\ JBoss EAP 7.x Installed folder\CTWeb\Dependencies\Canvas\CTResources.jar\CanvasApplicationContext.json’), specify the context root in CanvasApplicationContext.json file, as shown in the following code snippet:
{ "contextRoot": "<dliteweb>", "applicationId": "MODELHOUSE", "displayName": "CTWEB", "isService": "Y" }
In the application Resource.jar folder (e.g. ‘D:\Canvas\ JBoss EAP 7.x Installed folder\CTWeb\CTWebResources\src\main\resource\securityconfig.properties’), specify the default context root in securityconfig.properties file, as shown in the following code snippet:
DEFAULT_CONTEXT_ROOT=/<dliteweb> ALL_CONTEXT_ROOTS=<dliteweb>
In the application Resource.jar folder (e.g. ‘D:\Canvas\ JBoss EAP 7.x Installed folder\CTWeb\CTWebResources\src\main\resource\exportconfig.properties’), specify the context root as the context path in exportconfig.properties file, as shown in the following code snippet:
For JNDI data sources, the data source name should be specified. Let's assume that the JNDI data source name is DliteCTDS.SESSION_TIMEOUT_URL=/<dliteweb>/index.jsp CONTEXT_PATH= /<dliteweb>
In the application Resource.jar folder (e.g. ‘D:\Canvas\ JBoss EAP 7.x Installed folder\CTWeb\CTWebResources\src\main\resource\databaseconfig.properties’), specify the JNDI data source name in databaseconfig.properties file, as shown in the following code snippet:
CT_FW_DATASOURCE =java:/<DliteCTDS> CT_FW_FILEIMPORT_DATASOURCE=java:/<DliteCTDS>
In the JBoss EAP 7.x Installed folder (e.g. 'D:\Canvas\JBoss EAP 7.x Installed folder\standalone\configuration\standalone.xml’), specify the JNDI data source name in standalone.xml file, as shown in the following code snippet:
<datasource jndi-name="java:jboss/datasources/<DliteCTDS>" pool-name="<DliteCTDS>" enabled="true"> <connection-url>jdbc:oracle:thin:@10.12.25.28:1521:SIR13714</connection-url> <driver-class>oracle.jdbc.driver.OracleDriver</driver-class> <driver>OracleJDBCDriver</driver> <security> <user-name><SCHEMA_NAME></user-name> <password><SCHEMA_NAME_PWD></password> </security> </datasource>
Note
Steps 6 and 7 are applicable only for the JBoss application server. If you use Tomcat or any other app server, proceed to step 8.
In the JBoss EAP 7.x Installed folder (e.g. 'D:\Canvas\JBoss EAP 7.x Installed folder\standalone\deployments\ctmodelhouse.war \WEB-INF\jboss-web.xml’), specify the JNDI data source name in the jboss-web.xml file, as shown in the following code snippet:
It is essential to specify the work folder path. Let's assume that the work folder path is D:/Canvas19/dliteweb.<resource-ref> <res-ref-name>jdbc/CTwebCanvasDataSource</res-ref-name> <jndi-name>java:jboss/datasources/<DliteCTDS></jndi-name> </resource-ref>
In the application Resource.jar folder (e.g. ‘D:\Canvas\ JBoss EAP 7.x Installed folder\CTWeb\CTWebResources\src\main\resource\MyImplementation.properties’), specify the work folder and centralized work folder paths in MyImplementation.properties file, as shown in the following code snippet:
It is essential to specify the WAR file name. Let's assume that the WAR file name is dliteweb.CT_WORK_FOLDER_PATH=D:/Canvas19/dliteweb CT_WORK_CENTRALIZED_FOLDER_PATH=D:/Canvas19/dliteweb
Specify the Web Application Resource (WAR) file name in build.xml file, as shown in the following code snippet:
<property name="dliteweb" value="${DIST_ROOT}/<dliteweb>.war" />
- No labels