Info

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.

...

Expand
titleWhat are the changes to be done when context root of the application is changed?

Let’s assume that the following are the details of the application: 

  • DATA_SOURCE_NAME : DliteCTDS
  • SCHEMA_NAME : CT_MIG
  • SCHEMA_NAME_PWD : CT_MIG
  • CONTEXT_ROOT : dliteweb
  • WAR_NAME : dliteweb
  • WORK_FOLDER : D:/Canvas19/dliteweb

The As a sample reference, the following steps indicate the changes that are to be applied required for the JBoss app server and Oracle database environments. For other app server and database combinations, appropriate changes need to be appropriately applied to done in the relevant files in accordance with the modified changes
Context Root changes

1. In the application WAR, in the JBoss folder (e.g. 'WEB-INF\jboss-web.xml’), specify the context root in the \WEB-INF\jboss-web.xml file, as shown in the following code snippet:

Code Block
languagexml
<context-root> <CONTEXT_ROOT> </context-root>
<!-- For example -->
<context-root> dliteweb </context-root>

2. In the CTResources.jar folder (e.g. ‘Ctweb, in the ....\Ctweb\Dependencies\Canvas\CTResources.jar\CanvasApplicationContext.json’)json file, specify the context root in CanvasApplicationContext.json file, as shown in the following code snippet:

Code Block
languagebash
{
	"contextRoot": "<CONTEXT_ROOT>",
	"applicationId": "MODELHOUSE",
	"displayName": "CTWEB",
	"isService": "Y"
}
# For example
{
	"contextRoot": "dliteweb",
	"applicationId": "MODELHOUSE",
	"displayName": "CTWEB",
	"isService": "Y"
}

3. In the application Resource.jar folder (e.g. , in the ....\Ctweb\CtwebResources\src\main\resource\Ctwebsecurityconfig.properties)properties file, specify the default context root in Ctwebsecurityconfig.properties file,  as as shown in the following code snippet: 

Code Block
languagexml
DEFAULT_CONTEXT_ROOT=/<CONTEXT_ROOT>
ALL_CONTEXT_ROOTS=<CONTEXT_ROOT>
<!-- For example -->
DEFAULT_CONTEXT_ROOT=dliteweb
ALL_CONTEXT_ROOTS=dliteweb

4. In the application Resource.jar folder (e.g. Ctweb\CTWebResources, in the ....\CtwebResources\src\main\resource\ctwebexportconfigCtwebexportconfig.properties) file, specify the context root as the context path in Ctwebexportconfig.properties file, as , as shown in the following code snippet:

Code Block
languagexml
SESSION_TIMEOUT_URL=/<CONTEXT_ROOT>/index.jsp 
CONTEXT_PATH=/<CONTEXT_ROOT>
<!-- For example -->
SESSION_TIMEOUT_URL=dliteweb/index.jsp 
CONTEXT_PATH=dliteweb


JNDI Data source name change

1. In the application Resource.jar folder (e.g. , in the ....\CtwebResources\src\main\resource\databaseconfigCtwebdatabaseconfig.properties )file, specify the JNDI data source name in Ctwebdatabaseconfig.properties file,  as as shown in the following code snippet:

Code Block
languagexml
CT_FW_DATASOURCE=java:/<DATA_SOURCE_NAME>
CT_FW_FILEIMPORT_DATASOURCE=java:/<DATA_SOURCE_NAME>
<!-- For example -->
CT_FW_DATASOURCE=java:/DliteCTDS 
CT_FW_FILEIMPORT_DATASOURCE=java:/DliteCTDS

2. In the  (e.g. 'standalone\configuration\standalone.xml’)application WAR, in the JBoss folder, specify the JNDI data source name in the ..../standalone/configuration/standalone.xml file, as shown in the following code snippet:

Code Block
languagexml
<datasource jndi-name="java:jboss/datasources/<DATA_SOURCE_NAME" pool-name="<DATA_SOURCE_NAME>" 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>
<!-- For example -->
<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>

3. In the the application WAR JBoss folder (e.g. 'standalone\deployments\ctmodelhouse.war \WEB-INF\jboss-web.xml’), in the JBoss folder, specify the JNDI data source name in the \WEB-INF\jboss-web.xml file, as shown in the following code snippet:

Code Block
languagexml
<resource-ref>
            <res-ref-name>jdbc/CTwebCanvasDataSource</res-ref-name>
            <jndi-name>java:jboss/datasources/<DATA_SOURCE_NAME></jndi-name>
</resource-ref>
<!-- For example -->
<resource-ref>
            <res-ref-name>jdbc/CTwebCanvasDataSource</res-ref-name>
            <jndi-name>java:jboss/datasources/DliteCTDS</jndi-name>
</resource-ref>


Work Folder Changes

1. In the application Resource.jar folder (e.g. , in the ....\CtwebResources\src\main\resource\MyImplementationCtwebImplementation.properties) file, specify the work folder and centralized work folder paths in CtwebImplementation.properties file, as shown in the following code snippet:

Code Block
languagexml
CT_WORK_FOLDER_PATH=<WORK_FOLDER>                
CT_WORK_CENTRALIZED_FOLDER_PATH=<WORK_FOLDER>   
<!-- For example -->
CT_WORK_FOLDER_PATH=D:/Canvas19/dliteweb                
CT_WORK_CENTRALIZED_FOLDER_PATH=D:/Canvas19/dliteweb   

2. Specify the Web Application Resource (WAR) file name in build.xml file, as shown in the following code snippet: 

Code Block
languagexml
<property name="WAR_FILE_NAME" value="${DIST_ROOT}/<WAR_NAME>.war" />
<!-- For example -->
<property name="dliteweb" value="${DIST_ROOT}/dliteweb.war" />


...