Spiritual java is an attempt to let me express my thoughts, my ideas, my views and my feelings about two topics which are very close to my heart. Vippasana and Java!!! I have been practicing Vipassana for more than 8 years now and in all these years the way this teqnuqie helped me in overcoming many ups and downs in my life is quite remarkable. Java on the other hand is my source of my materialistic existence. So I'll be sharing my views on J2EE technology and its relevance in web.

Monday 5 October 2009

An inspirational interview from Hrithik Roshan

This is another deviation from my normal posts. I just saw a talk show on youtube and thought it is worth keeping this in my compilation of posts. So here it is... A little preface, we all know Kritik Roshan. A Bollywood superstar who has delivered hits like Koi Mil gaya, Kaho na pyar hai, Dhoom 2 and Lakshya to name a few. From the energetic performance and the kind of dance that he do, a few people would know at one time he had twisted spine problem and stammering problem.
Kritik Roshan is one of the few Bollywood superstars who made his life's adversity as an opportunity. From birth he was born with bundles of problems; stammering problem, spinal problem; born with double thumb and all the emotional and social pressure that these problems brings with them. From the state of such an adversity to the current state of being a Bollywood star is some journey in itself.

This interview in itself captures the essence that if you wish something in life and you are determined to do it, then nothing is impossible. An old saying is true..."Nothing is impossible, even impossible say I'm possible"
Just to keep in mind that this interview is majority in Hindi language. What I really liked in this interview compared to others is that its not treated as just another celebrity talk show. It would be worth watching the last part of the video in which a physically challenged  girl plays a very good music composition.

Part 1. In this Kritik talks about his stammering problem and how he showed determination to overcome that weakness...




Part 2. Continues further with the introduction of another Bollywood celebrity Kangana Ranaught...




Part 3. Kritik and Kangana plays some fun games...




Part 4. In this part the physically challenged girl plays the musical composition...

Saturday 3 October 2009

"Letters from Mara..."

Few days back Vikas Ji shared an inspirational Article(sent to him from Prof Dhar) with Delhi Vipassana group meditators.
Got some time today and read it. Found it very interesting and engaging.
The article "Letters from Mara" has got 10 letters in it. The article is taken by Buddha's one of the Sutta's.
Each of the letters is written by Mara to its squadrons namely desires, craving, lust, boredom,...(the impurities in the mind).
Thought of something to be shared. http://bit.ly/1AkHrR

Thursday 1 October 2009

Deploying Simple Hellworld lift webapp on Google App Engine




In the previous post we deployed the sample HelloWorld lift app on tomcat. In this post we will take one step further and go ahead with our lift helloworld webapp and deploy it on Google App engine.
From whatever I have read on different blogs, lift framework 1.0 support seems unavailable on GAE. But in milestone 1.1 there seems to be a limited support for it. With the future release lift may become fully compatible with GAE.
So for this example we will deviate from our 1.0 version to 1.1-M4 version.


Steps to do the initial maven setup remain same as with the previous post.
 
Ok, lets get started; first go to your workspace and type in the following maven command

mvn archetype:generate -U \-DarchetypeGroupId=net.liftweb \-DarchetypeArtifactId=lift-archetype-blank \-DarchetypeVersion=1.1-M4 \-DremoteRepositories=http://scala-tools.org/repo-releases \-DgroupId=demo.helloworld \-DartifactId=helloworld \-Dversion=1.0-SNAPSHOT



Once executed it will dispaly a list of outputs in verbose mode. At one or two places you may be prompted, just press enter.


Go to the project directory.
suresh-sharmas-macbook-pro:Projects sureshsharma$ cd helloworld
suresh-sharmas-macbook-pro:helloworld sureshsharma$ ls
pom.xml src
suresh-sharmas-macbook-pro:helloworld sureshsharma$


Packaging of the scr code to the war file can be done with maven's package command. Staying at /Projects/helloworld/ folder give the following command
suresh-sharmas-macbook-pro:helloworld sureshsharma$mvn package


This will create a war file in /Projects/helloworld/target/helloworld-1.0-SNAPSHOT.war


To deploy the war locally, go to the helloworld project directory. Maven comes in with inbuilt jetty and tomcat plugin so give the following command for tomcat deploy the app using tomcat plugin for maven.


suresh-sharmas-macbook-pro:helloworld sureshsharma$ mvn tomcat:run


Ok now coming back to GAE deployment, the first step for Deployment of war file to GAE is to install the google app engine SDK for java. You can download it from here.
Unzip the files in a folder say /usr/local/appengine-java-sdk-1.2.5/


Now for preparing the war file to be deployed in GAE, first go to /Projects/helloworld/src/main/webapp/WEB-INF folder. Their you will see web.xml file. For GAE deployment we need to create another appengine-web.xml file and add the following entries in it.

<?xml version="1.0" encoding="utf-8"?>
 <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
 <application>surylifting</application>
 <version>3</version>
 <system-properties>
   <property name="in.gae.j" value="true" />
 </system-properties>
 <sessions-enabled>true</sessions-enabled>
 <static-files>
   <exclude path="/**" />
 </static-files>
</appengine-web-app>



Change application name with the name of your registered application id in GAE, in my case it is surylifting.
Now first we will deploy GAE locally and then if everything goes fine we will deploy it to GAE.
Staying at /Projects/helloworld/ give the following command 


suresh-sharmas-macbook-pro:helloworld sureshsharma$/usr/local/appengine-java-sdk-1.2.5/bin/dev_appserver.sh /Projects/helloworld/target/helloworld-1.0-SNAPSHOT

Note that .war extension is not present above for helloworld-1.0-SNAPSHOT

And here u go u will be able to see it running at http://localhost:8080/


Now finally to deploy this app on GAE give the following command


suresh-sharmas-macbook-pro:helloworld sureshsharma$/usr/local/appengine-java-sdk-1.2.5/bin/appcfg.sh update /Projects/helloworld/target/helloworld-1.0-SNAPSHOT


again note that helloworld-1.0-SNAPSHOT is without .war extension


Once the deployment starts  you will be prompted for email id and password with which you registered on app engine. Once deployment is done you are ready to see you helloworld app on GAE.


Click on the http://surylifting.appspot.com and you will see my application deployed there. Simple :-)