Deploying Application
Assume your cache server IP is 20.200.20.54, then following is an example of how the 'client.conf' should look like.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<cache-server retry-interval="1" connection-retries="5" local-server-ip=" " port="9800" connection-timeout="5" client-request-timeout="90" retry-connection-delays="0"/>
<cache id="clusteredcache" default-readthru-provider=" " client-cache-id=" " load-balance="true" default-writethru-provider=" " client-cache-syncmode="optimistic">
<server name="20.200.20.54"/>
</cache>
</configuration>
Please follow the steps mentioned below to deploy an application on the respective server.
Apache Tomcat
Note
To use Maven packages for NCache Professional Edition, change the <artifactId>
as shown below:
<artifactId>ncache-professional-sessions</artifactId>
For Tomcat version 9, use J2EE and add the following Maven <dependency
> in the pom.xml
file.
<dependency>
<groupId>com.alachisoft.ncache</groupId>
<artifactId>ncache-javax-sessions</artifactId>
<version>5.2.0</version>
</dependency>
For Tomcat version 10 or later, use Jakarta and add the following Maven <dependency
> in the pom.xml
file.
<dependency>
<groupId>com.alachisoft.ncache</groupId>
<artifactId>ncache-sessions</artifactId>
<version>5.2.0</version>
</dependency>
Steps remain the same but the location of the files might change depending upon the version of tomcat. For the following steps %TOMCAT_HOME% refers to the location where Tomcat is installed.
Open the command prompt, change directory to
%TOMCAT_HOME%/bin
.NCache uses
log4j
for logging. Place thelog4j
at the following location.%TOMCAT_HOME%/lib.Create a new text document with the following contents and save it with the name of
log4j.properties
in the%TOMCAT_HOME%/lib
folder.log4j.rootLogger=DEBUG, R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=${catalina.home}/logs/tomcat.log log4j.appender.R.MaxFileSize=10MB log4j.appender.R.MaxBackupIndex=10 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
Open the command prompt, change directory to '%TOMCAT_HOME%/bin' and execute
startup.bat
. This will start the server.Move the
GuessGame.war
file to the directory %TOMCAT_HOME%/webapps.Open the web browser and try to access the following URL: http://host:port/GuessGame/index.jsp, where 'host' will be the address/IP of the machine where Tomcat is installed (in case of local machine it should be 'localhost'), and 'port' where Tomcat is listening to the request. The default port for Tomcat is 8080.
WildFly
For the following steps, %WILDFLY_HOME%
refers to the location where WildFly is installed.
NCache uses
log4j
for logging. WildFly by default useslog4j
for logging so no need to place it.Deploy the 'GuessGame.war' file, it must be copied into the correct directory so WildFly can find it. Then ove the file to the directory
%WILDFLY_HOME%/server/default/delpoy
or you can also directly deploy from the WildFly admin console.Open the web browser and try to access the following URL: http://host:port/GuessGame/index.jsp , where 'host' will be the address/IP of the machine where WildFly is installed (in case of local machine it should be 'localhost'), and 'port' where WildFly is listening for the request. The default port for WildFly is 8080.
WebLogic
For the following steps, %WEBLOGIC_HOME% refers to the location where WebLogic is installed.%DOMAIN_NAME%
is the domain already created on the server.
NCache uses
log4j
for logging. Place thelog4j
at the following location:%WEBLOGIC_HOME%/user_projects/domains/%DOMAIN_NAME%/lib
and restart server.Move the 'GuessGame.war' file to the directory
%WEBLOGIC_HOME%/user_projects/domains/%DOMAIN_NAME%/autodeploy
.Open the web browser and try to access the following URL: http://host:port/GuessGame/index.jsp, where 'host' will be the address/IP of the machine where WebLogic is installed (in case of local machine it should be 'localhost'), and 'port' where WebLogic is listening the request. The default port for WebLogic is 7001.
WebSphere
For the following steps, %WEBSPHERE_HOME% refers to the location where WebSphere is installed.
NCache uses 'log4j' for logging. Place the 'log4j' at the following location and restart server:'%WEBSPHERE_HOME%/AppServer/lib/ext'
If WebSphere is installed properly, you will be able to access the admin console through browser with the help of the following URL: http://ip-address:port/ibm/console/
By default, 9060 is the port used by WAS. Make sure that you are using the correct port if you changed it during installation.
You can go to Applications -> New Application -> New Enterprise Application.
Specify the path of the 'GuessGame.war' file and click Next. You can locate the 'GuessGame.war' at the following location: '%NC_HOME%/samples/sessions/dist'
Select Fast Path installation mode and click Next.
Specify the Application Name and Application Directory both as 'GuessGame'and click Next.
Map the application to the server, select 'GuessGame.war' from the list with the default settings and click Next.
Map the application to the virtual host, Select 'GuessGame.war' from the list with the default settings and click Next.
Map the context root to the application, type 'GuessGame' into the textbox resulting in '/GuessGame' as the contents of the textbox and click Next.
Click Finish to complete the deployment.
Go to Applications -> Application Types -> WebSphere Enterprise Applications.
You should see the GuessGame application in the list, select the GuessGame application by clicking on the checkbox.
Click Start at the top left. You should see a green icon indicating that the application has started.
Open the web browser and try to access the following URL: http://host:port/GuessGame/index.jsp, where 'host' will be the address/IP of the machine where WebSphere is installed (in case of local machine it should be 'localhost') and 'port' where WebSphere is listening for the request. Make sure that you are using the correct port. The default port for WebSphere is 9080.
See Also
Conceptual Overview
Adding Libraries
Multi-site Java Session Support
Error Logging