B use cases, Using jms from servlets and jsps, Pre-requisites – HP Integrity NonStop H-Series User Manual
Page 52: Building the application web archive (war) file

B Use cases
Being JMS compliant, NSMQ can be used from servlets and JSPs, Pathway server classes, and
other Java products like NonStop Server for Java Server Pages (NSJSP). This section describes the
following use case scenarios:
•
“Using JMS from servlets and JSPs” (page 52)
•
“Using JMS from Pathway Server Classes” (page 56)
Using JMS from servlets and JSPs
This section illustrates with a sample how JMS is used from servlets and JSPs.
Pre-requisites
The following applications must be present on your system before using JMS from JSPs or servlets:
•
Apache Tomcat server 6.0 - For more information on setting up Tomcat, see
.
OR
NSJSP - For more information, see NonStop Servlets for JavaServer Pages (NSJSP) 7.0 System
Administrator's Guide.
•
Apache ANT - For more information, see
•
NSMQ must be installed and running on a HP NonStop system.
The following JAR files are required for compiling and running the samples provided with NSMQ.
These JAR files are available in the <NSMQ-Installation-folder>/lib and
<NSMQ-Installation-folder>/lib/optional
folders. The build.xml file automatically
picks up these files to form the CLASSPATH.
•
activemq-all-5.6.0.jar
•
aopalliance.jar
•
commons-logging-1.1.1.jar
•
geronimo-jms_1.1_spec-1.1.1.jar
•
geronimo-j2ee-management_1.1_spec-1.0.1.jar
•
servlet-api-2.5-6.1.14.jar
•
log4j-1.2.16.jar
•
slf4j-api-1.6.4.jar
•
slf4j-log4j12-1.6.4.jar
Building the application Web Archive (WAR) file
1.
In META-INF folder, edit the context.xml file.
Locate the Resource element and change the value for the brokerURL attribute to the
corresponding system on which NSMQ is running.
For example, brokerURL="tcp://15.154.112.85:61616"
2.
Set the environmental variables JAVA_HOME and ANT_HOME, and add them to the path
variable.
3.
Go to the
execute the following command:
$ ant all
This creates the servlets-jsp.war file in the dist folder.
52
Use cases