Month: December 2007

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)