Bouncing back…soon!

Already one month turned past in the New Year.

This year I intentionally didn’t make any resolutions.But in my mind I am very much clear and aware of what one (yes…only one thing) thing I should do in this year for my own benefit.But I didn’t document it anywhere. After all, it is only one thing and my memory is not poor!

But if I review this year till now, I haven’t woke up at 5AM on any day. I am killing time like anything. I am getting too much into time-killing activities like playing computer games at home(I completely stopped touching book when at home), browsing too much on Internet.

BUT

Even if I make mistake and allow myself to be distracted, it is normal and natural and not the end of the world.Though it is painful that I have disappointed myself, I still can bounce back.

And I am bouncing back shortly to all my good habits which I paused temporarily.

As I read somewhere- Winners and losers will both stumble. The difference is, winners have learned to quickly get back up.

2007 in the hindsight

If there is one word which I can use to describe how 2007 was for me, it would be “UNCERTAIN” . 2007 was the year I spent much of time in uncertainty.

There were many good happenings like engagement(Feb-4) , marriage(Mar-29) , got new job offer(May-25) , started life with Sailu (Jun-24), role change(Oct-5) etc. Equally were the not-so-good things like couldn’t realize onsite dream, orthodontic treatment got discontinued, stuck at unwanted location etc.

I made few very good friends and happened to meet many assholes.Unfortunately number of assholes far exceeds number of good relations.

My Resolutions for 2007 were totally ignored, my onsite dream was shattered, my new job offer was expired and my wish to move to Hyderabad was unfulfilled.

My spending habits were positively changed and I became very disciplined spender.Started counting every rupee I spend.I have been able to keep my word to all my lenders and I got rid of most of my debt.

Personally 2007 has been a great year at least though I faced many unexpected debacles in my work life for which, I have to work for betterment in 2008.

Tirupathi Trip

Last weekend trip to Tirupathi has been a mix of emotions.

Here is why.

Tension : when we started at 6 PM to reach Majestic by 8PM. [Friday, 14-Dec-07]

Relief : when we reached Majestic at 7:55 PM and rushed to catch 8PM APSRTC bus to Tirupathi and finally got into it.[Friday, 14-Dec-07]

Excitement : when we started on pathway to wonderful Seven Hills.[1030hrs Saturday, 15-Dec-07]

Joy : when we finished all 3600 steps in 6 hrs.[1630hrs Saturday, 15-Dec-07]

Disappointment : when we counted on someone to get Kalyanam tickets for us.[1900hrs Saturday, 15-Dec-07]

Nervousness : when we were stuck in the queue for Free Darshan[2100hrs Saturday, 15-Dec-07 and through out the night]

Curious : when we waited in the queue from 5AM for the Arjitam counter to open at 8AM to buy Kalyanam tickets by ourselves.Uncle started waiting from 3 AM[0500hrs Sunday, 16-Dec-07]

Happiness : when we got the Kalyanam tickets.[0845hrs Sunday, 16-Dec-07], when we got return tickets to Hyderabad, when we had Darshan of Sri Kalahastiswara Swami, when we sold our Bangalore return tickets for 350/-, when we went out to shop in Tirumala.[1000hrs till 2200hrs Sunday, 16-Dec-07]

Excitement : when we started in queue at 8AM for Kalyanam.Reporting time is 10AM and actual performing time of Sri vari Kalyanam is 12PM.[0800hrs till 1230hrsMonday, 17-Dec-07]
Bliss : when I got the privilege to Darshan the Splendid and Magnificent Lord Venkateswara.Got 2 big and 5 small much-sought-after Prasadam Laddus and 2 vadas[1300hrs Monday, 17-Dec-07]

This is the third year in row I had the opportunity to visit the Holy Tirumala.In 2005, I went with mom and dad, in 2006 with Srihari and in 2007 with Sailu,uncle, aunt and bobby.

For all the above reasons, this trip will surely be memorable to me.

Found the solution for Tomcat Start up Issue.

At last, I cracked it!

Here is the story:

Sometime back when I deploy my web application( named: myApp) in Tomcat 5.5.23 installed on JDK 1.5 Update 14, I used to stuck with the following issue and I was not able to access my application.

Tomcat log will show something like below:

INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\myApp\WEB-INF\lib\servlet-api.jar) – jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

28/05/2006 21:03:39 org.apache.catalina.loader.WebappClassLoader validateJarFile

INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\myApp\WEB-INF\lib\servlet.jar) – jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

SEVERE: Error listenerStart
Dec 5, 2007 10:24:10 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/myApp] startup failed due to previous errors.

Today I found the solution for this issue.

Just delete the servlet.jar and servlet-api.jar files from C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\myApp\WEB-INF\lib.

These files, anyways will be in C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib folder of Tomcat.

I found this solution by little bit of Googling. Earlier also I Googled for this like anything but could not find any solution.I also posted it in popular forums at javaranch.com, thescripts.com, p2pwrox.com etc. but to my disappointment.

I also tested this solution in three of my team’s systems.It worked for two systems and it didn’t work for one system. But I am sure the above is the cause and fix of this issue.The reason for not working in one system is something else which I have to investigate further.

This issue consumed lot of my time/energy/hope and frustrated and depressed me a lot.I didn’t get help from anyone. Now I am glad that I found the solution all by myself.

weird naming convention of substring() method of java.lang.String class

The substring() method of java.lang.class is not inline with the Java naming conventions for methods.

As per Java naming conventions, all the methods will be in camelCase.But this does not bother substring() method.

To get sub string of any string in Java, we should use substring() NOT subString().

PS: I remember there are some other capitalization styles other than camelCase and PascalCase but could not recollect them at this moment.

The following Error related to JBoss Drools frustrated me because of Java Version mismatch.

The version of Drools we are using runs properly only with JDK 1.5 where as we are trying hard to make it run on JDK1.6 and ended up with the following issue.


java.lang.ClassNotFoundException: [Lorg.drools.rule.Declaration;

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa

der.java:1359)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa

der.java:1205)

at org.drools.rule.PackageCompilationData$PackageClassLoader.loadClass(U

nknown Source)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at org.drools.common.ObjectInputStreamWithLoader.resolveClass(Unknown So

urce)

at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:157

5)

at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)

at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1624)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)

at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:19

45)

at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1

753)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)

at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)

at java.util.HashMap.readObject(HashMap.java:1029)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974

)

at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1846)

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1

753)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)

at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)

at org.drools.rule.PackageCompilationData.readExternal(Unknown Source)

at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:179

2)

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1

751)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)

at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)

at org.drools.rule.Package.readExternal(Unknown Source)

at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:179

2)

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1

751)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)

at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)

at java.util.HashMap.readObject(HashMap.java:1029)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974

)

at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1846)

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1

753)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)

at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)

at org.drools.common.AbstractRuleBase.doReadExternal(Unknown Source)

at org.drools.reteoo.ReteooRuleBase.readExternal(Unknown Source)

at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:179

2)

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1

751)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)

at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)

at com.infosys.ipsp.ade.impl.RuleBaseRepositoryImpl.deSerializeRuleBase(

RuleBaseRepositoryImpl.java:73)

at com.infosys.ipsp.ade.impl.RuleBaseRepositoryImpl.deSerializeRuleBase(

RuleBaseRepositoryImpl.java:85)

at com.infosys.ipsp.ade.userinteraction.ConsultationServlet.doGet(Consul

tationServlet.java:108)

at com.infosys.ipsp.ade.userinteraction.ConsultationServlet.doPost(Consu

ltationServlet.java:70)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:269)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:188)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV

alve.java:210)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV

alve.java:174)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j

ava:127)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j

ava:117)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal

ve.java:108)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav

a:151)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java

:870)

at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p

rocessConnection(Http11BaseProtocol.java:665)

at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo

int.java:528)

at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol

lowerWorkerThread.java:81)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP

ool.java:685)

at java.lang.Thread.run(Thread.java:619)

MS SQL Server 2K and Win XP

MS SQL Server 2000 Enterprise Edition Server componentscan not be installed on Windows XP.

Only client components can be installed.

I am exploring how to install Personal Edition on Win XP.I thought I will post it after I successfully do it.But we again did not use it and got the work done with Enterprise Edition.So this is the end of Personal Edition.

At last, we successfully deployed ASP web application.Some interesting findings:

[1] Our application can be installed on MS SQL Server 2000 Enterprise Edition ( I did) or Developer Edition (I did) or Personal Edition(I saw Gaurav Deshmukh did).

[2] Deploying ASP Web Application in IIS is easy.

[3] The whole issue started because we were trying very hard to make the user we created own our tables instead of letting those tables owned by standard “dbo” user of SQL Server.And we tried to connect with the same user we created instead of connecting to SQL Query Analyzer tool with standard “sa” user of SQL Server.

so the guy who helped us did these:

[1] Run the table creation script by standard “sa” user.
[2] So that, all the created tables will be owned by “dbo” user.
[3] Now we can create any custom user of our choice and all that we have to do is just associate this custom user with the above created database. Then we can use this custom userid and password in our configuration files(in our case it is qdo.asp) to connect to the database.

This is my first encounter with Microsoft technologies like IIS, SQL Server 2000 and ASP.

Java’s Checked and Unchecked Exceptions- demystified

Until recently, I had hard time remembering what is the difference between checked and unchecked exceptions.

Finally Head First Java gave me the prompt explanation. Here it goes:

Checked Exceptions: Arise due to the reasons which are beyond control of programmer so complier mandates them to handle or declare.

Unchecked Exceptions: Arises due to logic flaws in the code.So these should be eliminated.Exception Handling mechanism is not supposed to take care of programmer injected logic flaws in the code.So complier wont bother.It is the responsibility of the programmer to eliminate them.

I am also looking for similar kind of prompt and clear explanation for the difference between Error and Exception.If you get to know, I appreciate if you can share with me.