Monthly Archives: March 2009

Understanding of Matrix

If you have read Indian holy Gita, you will find many similarities. In fact, Matrix is Modern way to convey the message of essence sung by God Himself in Shri Gita. Leo Tolstoy (one of the greatest Novelist of all times) danced with Gita on his head repenting why the heck did he not come across this great scripture before.

This SCI-FI movie that talks about AI (Artificial Intelligence) taking over humans in far future, is the beautiful code that could be understood only in its metaphorical terms with a broader perspective.  Put aside your urge for inclination towards all dramatic stunts & special effects for a moment & try to think out of the box. Let’s first assume these metaphors to see if it makes some sense.


Architect: You who constantly try to achieve perfection.

Matrix: Your Mind which has projection that is full of illusions where nothing is real.

AI: Your intellect. Agents represent the AI in matrix.

Humans: Your Heart (not in literal sense) which is full of emotions & qualities such as devotion, love, faith, belief & sacrifice that are beyond the logic & that even AI (who things of himself as superior) lacks. That’s the reason why Architect can’t see past the choices he makes. And that’s why the need to see beyond.

Frustrated by failures, Architect develops a vision (Oracle) that appreciates human qualities & hence sees beyond in order to achieve perfection.

Zion: Human body (collection of life).

Neo: Your Self. Whoever cares about the truth becomes the chosen one. Rest of all are just some or the other than Neo. Only chosen one seeks the answer.

The One: The Consciousness. Self eventually realizes it.

Smith: Your self: The Ego (mirror of the Self). He wants to get out of Matrix. Smith itself is a construct of Matrix & how can he be free from it? But he dislikes this compulsion. This clearly tells that he is ignorant. Being ignorant he’s directionless & therefore always malfunctions. He must disappear.

Ignorance: The real anomaly that is inherent into the Matrix program (Mind) which needs to be corrected.

Both (Neo & Smith) want to be free. That is the connection that drives them. But there is a difference. Because of Smith’s definition of freedom being different from that of Neo, Smith wants to be free from any kind of Compulsion. On the other hand, Neo doesn’t care about that. He wants freedom from the question that drives him crazy. He believes that only by finding the answer he can be free.

What question?
What is truth? It’s the question. Neo is restless & seeks the only thing throughout.

Another difference between Neo & Smith: Neo is guided by Oracle’s advice. As if Self guided by the Vision. Smith on the other hand, tries to forcefully steal the Vision (eyes of oracle).

Another difference: Smith is not ready to give himself up even though he wishes to see beyond. Neo, in the end is prepared to even give himself up.

Fear is another thing that makes them distinct. Neo is not afraid. Smith is afraid. Both seek freedom but only chosen one becomes the worthy of ultimate purpose.

What purpose?
Purpose is to achieve eternal happiness. In the end, Neo achieves Nirvana (the ultimate peace, the real happiness). The golden code that Neo sees is the enlightenment that he attains. He is physically blind but is still able to see. That’s because of his “inner eyes”. Truth is seen only with inner eyes. And that too only when he reaches the level where he is ready to let go of his Love. Love, again a rare highest quality in front of which (for Neo) nothing else matters. Remember Neo told Ramakandra at the train station that he would give up everything for his love?

Earlier versions of Neo hadn’t developed this kind of specific Love. That’s why re-incarnations.

Merovingian: (one of the earlier ones) is kind of characterless departed one. Very powerful yet immoral. The one who perhaps cared for neither Trinity (specific love) nor the people (generic love). And therefore he gets downgraded.

Oracle, while examining Neo in her first meeting, is happy to see that Neo’s in love. And she believes that this love would take him to highest point against all odds, (odds as in the ultimate defence system of machine city). This gives her a hope that he is really worthy of walking on the path. The path, that leads to the truth.

And what is truth?
Truth is the (Pure) Consciousness, THE ONE that is finally realized when calmed down everything else. When wars end between mind, body, heart & intellect so that they start to learn to live in harmony: When Ego is beaten down & disappeared: When highest qualities such as love are also sacrificed & left behind on the quest of truth: When one who has sacrificed anything & everything & yet stands: That is the state of perfection where Neo achieves Nirvana, the ultimate peace, the eternal real happiness. This is the golden code of the One. And this realization is the truth by attaining which Neo (Now the One) attains the real freedom.

Why war?
War between Matrix & Zion is like conflicts between intellect & emotions. The cause is ignorance which was the real anomaly. Except for the consciousness, nothing else is perfect. Neither mind nor body neither intelligence nor heart. As long as ignorance (anomaly) lies in the Mind (Matrix), there is a constant conflict (war) between heart (humans) & intellect (agents). And Ego (the victim of ignorance) is so pervaded (duplicate Smiths) in the mind that it causes the ultimate mental block which is not acceptable to you (Architect). And as you stand helpless, now the real problem is Ego.

Self comes to the rescue. But the deal is first to calm down emotions & intellect. Thank (machine) God for agreeing for “peace” & relying on the Self to solve the matter.

The ultimate fight between the Ego & the Self within the mind (Matrix)
Self (though at times is weak) is not giving up till the time when Ego realizes one truth that “Everything that has beginning has an end.” Even he was constructed in mind & therefore even he has to die. Smith is afraid of death. Self is not because all left of him is Self. This is the time when Neo reckons that Ego is ready to die & he then “chooses” to give up the fight. As he gives up, Smith childishly kills Neo in Matrix. As he kills Neo, this serves the purpose of Smith. And Smith object is no more required therefore deleted as per the Matrix rules.

So you see! Matrix is nothing but about the journey of Self to unite with the pure Consciousness.

When the Matrix Revolutions is ended, a careful viewer must have noticed a chanting of mantra:

This shloka is originally from one of the ancient & oldest Indian sacred scripture which means:

Lead me from the asat (unreal) to the sat (real).
Lead me from darkness to light.
Lead me from death to immortality.

(Brhadaranyaka Upanishad – I.iii.28)

Refer to this site for hearing the mantra.

Anup Jani
My profile:
My Blog:



This Hello World program demonstrates basic features of Spring IoC.
This program shows:
1. How to load configurations from a XML resource file that is residing in the file system.
2. How to load configurations from many XML resource files that are residing in the file system.
3. How to load configurations from a XML resource file sitting in the class path.

If you already know how to create a Java Project in Eclipse then here’s the project structure.
Make sure following JAR files fall into your Build Path.

Project Structure
|   .classpath
|   .project
|       HelloSpringIoC.class
|       MyBeansInClassPathHere.xml
|       OtherPojo.class
|       SpecialPojo.class
|       commons-logging-api-1.1.jar
|       spring-beans-2.0-m1.jar
|       spring-context-2.0-m1.jar
|       spring-core-2.0-m1.jar

Make sure following two files exist in your C:\> drive.
1. C:\config\MyOtherBeansHere.xml
2. C:\config\MySpecialBeansHere.xml

Notice MyBeansInClassPathHere.xml highlighted in yellow.
It’s into the class path being in “src” folder.
You will need ClassPathXmlApplicationContext for loading this configuration file.
See method: public void usingClassPathXmlApplicationContext(String myBeanResource)

Run HelloSpringIoc as Java Application once you have created following files.
public class SpecialPojo {

private String name;

public SpecialPojo() {


public String getName() {
return name;

public void setName(String name) { = name;

public class OtherPojo {

private String name;

public OtherPojo() {


public String getName() {
return name;

public void setName(String name) { = name;


<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE beans PUBLIC “-//SPRING//DTD// BEAN//EN” “”&gt;
<bean id=”specialPojo” class=”SpecialPojo”/>

<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE beans PUBLIC “-//SPRING//DTD// BEAN//EN” “”&gt;
<bean id=”otherPojo” class=”OtherPojo”/>

<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE beans PUBLIC “-//SPRING//DTD// BEAN//EN” “”&gt;
<bean id=”otherPojo” class=”OtherPojo”/>
import org.springframework.context.ApplicationContext;

* @author Anup Jani
* This Hello World program demonstrates basic features of Spring IoC.<br>
* This program shows:<br>
* 1. How to load configurations from a XML resource file that is residing in the file system.<br>
* 2. How to load configurations from many XML resource files that are residing in the file system.<br>
* 3. How to load configurations from a XML resource file sitting in the class path.<br>
public class HelloSpringIoC {

* Application Context pointing to the resource file in the file system location.
* @param myBeanResource
public void usingFileSystemXmlApplicationContext(String myBeanResource) {
//Create an application context.
ApplicationContext ctx = new FileSystemXmlApplicationContext(myBeanResource);
SpecialPojo pojo = (SpecialPojo)ctx.getBean(“specialPojo”);

//Start using your bean.
pojo.setName(“This is my special bean, obtained via FileSystemXmlApplicationContext.”);

* Application Context pointing to the multiple resource files in the file system location.
* @param myBeanResources
public void usingFileSystemXmlApplicationContext(String[] myBeanResources) {
//Create an application context.
ApplicationContext ctx = new FileSystemXmlApplicationContext(myBeanResources);

//Get beans from multiple configurations.
String[] beanNames = ctx.getBeanDefinitionNames();
SpecialPojo specialPojo = (SpecialPojo)ctx.getBean(beanNames[0]);
OtherPojo otherPojo = (OtherPojo)ctx.getBean(beanNames[1]);

//Start using your beans.
specialPojo.setName(“Special bean obtained  from one configuration.”);
otherPojo.setName(“Other bean obtained from other configuration.”);
System.out.println(specialPojo.getName() + “\n” + otherPojo.getName());

* Application Context pointing to the resource file in the class path.
* @param myBeanResource
public void usingClassPathXmlApplicationContext(String myBeanResource) {
//Create an application context.
ApplicationContext ctx = new ClassPathXmlApplicationContext(myBeanResource);

//Get bean from application context.
OtherPojo pojo = (OtherPojo)ctx.getBean(“otherPojo”);

//Start using your bean.
pojo.setName(“This is my bean that was configured in class path, \n\t ” +
“obtained via ClassPathXmlApplicationContext.”);

* Main method to test each method.
* @param args
public static void main(String[] args) {
//Single file in file system.
String file = “C:\\config\\MySpecialBeansHere.xml”;

//Multiple files in file system.
String files[] = new String[]{“C:\\config\\MySpecialBeansHere.xml”, “C:\\config\\MyOtherBeansHere.xml”};

//Single file in class path.
String fileInClassPath = “MyBeansInClassPathHere.xml”;

HelloSpringIoC hello = new HelloSpringIoC();



Recommended source:
Java Development with the Spring Framework
– Rod Johnson, Juergen Hoeller, Alef Arendsen, Thomas Risberg, Colin Sampaleanu
Professional Seires – Wrox publication.

Anup Jani
My profile:
My Blog:


This article takes reader step by step to build her/his own simplest program of Java Web Service.
If all steps are followed properly, then the  program should work.


Assuming that you have:

C:\Program Files\Apache Software Foundation\Tomcat 5.5

Make sure your AXIS has following JAR files:
C:\axis-1_4\webapps\axis\WEB-INF\lib>dir /b

If above highlighted files are missing, then download them separately.
And copy them in C:\axis-1_4\webapps\axis\WEB-INF\lib
NOTE: mail.jar or mailapi.jar should be fine.

set TOMCAT_HOME=C:\Program Files\Apache Software Foundation\Tomcat 5.5

AXIS enable your Tomcat:
Copy “C:\axis-1_4\webapps\axis” folder in %TOMCAT_HOME%\webapps
AXIS itself is an Apache application.
By copying this folder you deploy the AXIS application on Tomcat.
Doing this makes your Tomcat behave like a “Java Web Service” Server.

Verify AXIS Server on Tomcat
Start your Tomcat Server & hit following URL on browser.

You should get Hello! Welcome to Apache-Axis web page.
Click on List to see the list of web services deployed currently.

Set classpath
You need to bring those JAR files in your classpath too.
If not, then will give compilation errors on your command prompt when you try to compile/generate code.
Hence copy all these JAR files to C:\axis-1_4\lib
And set the classpath
C:\>set classpath


Write your Java Interface
package myapp;

public interface Hello {

public String sayHello(String name);


Write your Java Interface Implementation
package myapp;

public class HelloImpl {

public String sayHello(String name) {
return “Hello ” + name;


So that:

Compile interfaces & implementation code before generating WSDL
C:\practice>javac myapp\ -d .
C:\practice>javac myapp\ -d .

Generate WSDL
C:\practice>java org.apache.axis.wsdl.Java2WSDL -o hello.wsdl -l”http://localhost:8080/axis/services/hello&#8221; -n urn:hello -p”hello” urn:hello myapp.Hello
Notice that hello.wsdl got generated.

Generate glue code
C:\practice>java org.apache.axis.wsdl.WSDL2Java -o . -d Session -s -p hello.wsdl
So that:
C:\practice\myapp\ws>dir /b

Time to modify the glue code a bit
Notice ““.
It is the implementation that is automatically generated.
But you already have written your own implementation which is:
So, call your Impl method in generated Impl method,
Don’t forget to copy your in location C:\practice\myapp\ws\
And change its package form myapp to because now it’s been moved there.

* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.


public class HelloSoapBindingImpl implements{
public java.lang.String sayHello(java.lang.String in0) throws java.rmi.RemoteException {
System.out.println(“remote service invoked!”);
HelloImpl h = new HelloImpl();
return h.sayHello(in0);


Compile the glue code
C:\practice>javac myapp\ws\*.java
May show some warnings but that should be fine.

Package into JAR
C:\practice>jar cvf hello.jar myapp/*.class myapp/ws/*.class
Move hello.jar
C:\practice>move hello.jar “c:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\lib
Start Tomcat server before deploying

Deploy the service
C:\practice>java org.apache.axis.client.AdminClient myapp\ws\deploy.wsdd

Verify deployed service
Re-Start your Tomcat Server & hit following URL on browser.

You should get Hello! Welcome to Apache-Axis web page.
Click on List to see the list of web services deployed currently containing your hello service.

Write the Client
package myapp.client;

public class HelloServiceClient {
public static void main(String[] args){
try {
//Get the service. service = new;

// Get the stub. hello = service.gethello();

// Make the call.
System.out.println(hello.sayHello(“some name”));
catch(Exception e) {

Compile the client
javac myapp\*.java -d .

Execute the client
C:\practice>java myapp.client.HelloServiceClient

Output should be:
Hello some name

Recommended references:

Anup Jani
My profile:
My Blog:

The Matrix Architecture


Anup Jani (Bsc, MCP, GNIIT, SCJP, SCWCD, IBM OOAD/UML JCert.) My profile: My Blog: