Friday, July 10, 2009

Deploying JSP Web App on Jboss Application Server on Linux

Here is step by step procedure to deploy a Simple JSP Web App on JBoss Application Server:

The steps are designed for Linux OS. For windows version please check here


1) Install Java

Obtain Java by clicking the "Download" button for Java SE Development Kit (JDK) 6 Update 14 at:
http://java.sun.com/javase/downloads/

Unzip the file into "~/java/" directory.

2) Install JBoss Application Server
Go to the JBoss download page at:
http://www.jboss.org/jbossas/downloads
Locate version 4.2.2.GA, and follow the "Download" link to get the "jboss-5.1.0.GA.zip" file.

Unzip the file into "~/java/" directory.


cd ~/java/
ls
jboss-4.2.2.GA jdk1.5.0_19


3) Create Work Folder in your personal projects directory


cd ~/projects
mkdir Helloworld


4) Create JBoss Startup Script: Just copy the below content into jboss file and make it executable.


#!/bin/bash
#
# Starts the jboss application server

# JAVA HOME
JAVA_HOME="/home/sheeju/java/jdk1.5.0_19/"
JBOSS_HOME="/home/sheeju/java/jboss-4.2.2.GA"

prog="jboss"

start() {
echo -n $"Starting $prog: "
$JBOSS_HOME/bin/run.sh
}

case "$1" in
start)
start
;;
*)
echo $"Usage: $0 {start}"
exit 1
esac

exit $?



This script will launch JBoss.

5) Write JSP File
Also in the "HelloWorld" folder, create a file named "index.jsp" as:
index.jsp



<html><head><title>JSP Test</title>
<%!
String message = "Hello, World.";
%>
</head>
<body>
<h2><%= message%></h2>
<%= new java.util.Date() %>
</body></html>


This JSP simply displays a greeting along with the current date and time.

6) Create Deployment Descriptor
In the "HelloWorld" folder, create a sub folder called "WEB-INF", and in that folder create a file named "web.xml" as:
web.xml


<web-app>
<display-name>Hello World</display-name>
</web-app>



The deployment descriptor provides information to JBoss about your web application.

8) Create WAR Builder & Deployer
In the "HelloWorld" folder, create a shell script named "deploy" as:



#!/bin/bash
#
# Starts the jboss application server

# JAVA HOME
JAVA_HOME="/home/sheeju/java/jdk1.5.0_19/"
JBOSS_HOME="/home/sheeju/java/jboss-4.2.2.GA"

prog="jboss"

start() {
echo -n $"Starting $prog: "
$JBOSS_HOME/bin/run.sh
}

case "$1" in
start)
PROJECT=$2
echo -n $"Deploying Project $PROJECT "
$JAVA_HOME/bin/jar -cvf $PROJECT.war *
cp $PROJECT.war $JBOSS_HOME/server/default/deploy/
;;
*)
echo $"Usage: $0 {start} {}"
exit 1
esac

exit $?


This script uses Java's JAR utility to zip up the appropriate contents into a WAR file.

9) execute deploy command

10) Test Your Web Page
In a browser, open "http://localhost:8080/HelloWorld/index.jsp" to see your web application run.

Now explore the JBoss console at "http://localhost:8080". Click on "JBoss Web Console" and expand "J2EE Domains", "jboss.management.local", and "JBoss". Select "helloworld.war" to see information about your web application.

Thursday, July 9, 2009

Analyzing VoIP with Wireshark

Nice tutorial to Analyzing VOIP with Wireshark, if you are familiar with tcpdump it is childs's play. Just get .cap dump using tcpdump

tcpdump -w dump.cap -p -n -s 0 "udp”

This will capture all udp data, you can filter the data according to you requirement. Which can be filtering by port etc..

For more read here
Panoramisk » Analyzing VoIP with Wireshark

Wednesday, July 8, 2009

Torch on Sony Ericksson K790i

Installing Torch application on K790i




This feature is not by default in K790i. A must have feature when there is lot of power cuts.

After googling around found a forum who talked about this feature http://forums.se-nse.net/index.php?showtopic=4489, read this forum some nice funny statement by Richard :)

"But most of the people I meet who are drunk can't even find their house let alone the key or the hole!!!!! :P"

Here is another site which gives damn neat on how to install Torch application.

http://torchk800.matlista.se/

Torch.jar direct download link - here