Patrick-Dussault

Create a Sample Application to Test JBoss Agent

Blog Post created by Patrick-Dussault Employee on Feb 16, 2018

First have installed RedHat Jboss 5.1 on RedHat 5.5 64 bit

 

Then, create the application. 


# su - jboss
$ pwd
/opt/java/jboss
$ mkdir HelloWorld
$ cd HelloWorld
$ nano -w hi.jsp
<html><head><title>JSP Test</title>
<%!
String message = "Hello, World.";
%>
</head>
<body>
<h2><%= message%></h2>
<%= new java.util.Date() %>
</body></html>
$ mkdir WEB-INF
$ nano -w WEB-INF/web.xml
<web-app>
<display-name>Hello World</display-name>
</web-app>

 

Create its deployer :


$ nano -w deploy.sh
#!/bin/bash
SOA_HOME=/opt/CA/JbossAgent

JAVA_OPTS="${JAVA_OPTS} -DJAVA_AGENT_ROOT=${SOA_HOME} -Dlog.log-config-properties=${SOA_HOME}/config/log-config.properties"

JBOSS_CLASSPATH=${JBOSS_CLASSPATH}:${SOA_HOME}/config:${JBOSS_HOME}/server/default/lib/cryptojFIPS.jar

 

Create and deploy the .war


$ /opt/java/jdk/bin/jar -cvf helloworld.war *.jsp WEB-INF
$ cp helloworld.war $JBOSS_HOME/server/default/deploy
$ chmod 755 /opt/java/jboss/jboss-as/server/default/deploy/helloworld.war

 

Start JBoss and have fun


$ cd ..
$ ./jboss-as/bin/run.sh

NOTE : add any other jsp page in the same directory of hi.js in order to produce headers, etc.

Outcomes