Saturday, November 21, 2009

Installing Apache Ant

Apache Ant is a software tool for automating software build processes. It is similar to make but is implemented using the java language, requires the Java platform, and is best suited to building Java projects.
The most immediately noticeable difference between Ant and Make is that Ant uses XML to describe the build process and its dependencies, whereas Make has its Makefile format. By default the XML file is named build.xml. For a example if your project consists of many java classes and you want to build them (make .class files) in to seperate destinations you can easily do that by configuring build.xml file.
Ant is an Apache project. It is open source software, and is released under the Apache Software License.


Apache Ant 1.7.1 is now available for download (This is in zip format and the binary distribution).

Installing Ant

  1. Before installing Ant make sure you have JDK1.3 or above installed on your machine and you can call javac or java -version from your command prompt.
  2. Unzip the downloaded Ant to a directory as you want. Though there are several folders in Ant Home you only need the bin and lib directories to run Ant.
  3. Now you have to set your environment variables of your machine. Those who have done this for java knows how to do it.
  • First right click on your mycomputer icon. go to advance system settings and click on the environment variable button in the advance tab of that window. Then Environment variable box will apear and under user variables select path and click edit.

  • If you have already set path for java you should see that path also under the value. Enter Your new path to the corner of your java path as below.
value C:\Program Files\Java\jdk1.6.0_05\bin;C:\apache-ant-1.7.1-bin\apache-ant-1.7.1\bin
~make sure to go deeper in to the bin of ant as in java

  • Then click ok button and you have to set new tow variables in addition to that.
  1. JAVA_HOME - click on the new button of user variables and type JAVA_HOME as variable name. For the value give C:\Program Files\Java\jdk1.6.0_05 (*not bin included) and click ok.
  2. ANT_HOME - click on the new button of user variables and type ANT_HOME as variable name. For the value give C:\apache-ant-1.7.1-bin\apache-ant-1.7.1 (* where you put your ant folder and not up to the bin) and click ok.
Now You have successfully configured settings for Apache Ant. To test it open cmd and type ant.
If you can see a out put
Buildfile: build.xml does not exist!
Build failed

Then it has successfully installed. If you come up with an error like can not find the location of ./././tool.jar, you haven not set your 3 environment variables properly.

If you are interested in building a simple java class and how to compile it using ant's build.xml file use this link.

Good Luck...!!!

Friday, November 20, 2009

Deploying Apache Axis2-1.5.1-war in jboss-5.1.0.GA

1. First Download the required distributions.
2. Extract the to a location on your hard drive. It is better not to put it in Programme Files in C drive.

3. Deploy Axis2 on JBoss.

Extract the axis2.war file in to /server/default/deploy directory in jboss server. By default it will be extracted to a directory named “axis2” and you need to rename it to “axis2.war”. Then delete xml-apis-1.3.04.jar and xercesImpl-2.8.1.jar from Axis2.war folder/WEB-INF/lib.

4. Deploy Rampart (You downloaded it in section 1).

Copy the jar libraries (there were six jars in my case) in lib directory of Rampart binary distribution to WEB-INF/lib directory of axis2.war and copy the bouncycastle library to WEB-INF/lib directory.
Copy the rampart-1.4.mar and rahas-1.4.mar in module directory of Rampart binary distribution to WEB-INF/modules directory of axis2.war.
(All these modifications happen after you deployed your axis.war folder in jboss)

That's all you have to do...

~Now simply stop any other servers if they are running. Run jboss server by clicking the run.bat in bin folder of jboss.
~Type http://localhost:8080/axis on your browser (In this case it is http://localhost:8080/axis2 coz mine i did not change the original name).

~...Boomed...You will be displayed the Axis home page and several links. Get the experience with axis (I my self tried this and it worked fine for me). So why not You.

Good Luck!!!