[Advanced-java] jdk122;iplanet41; sol26: Get MethodNotFound unless calling getDeclaredMethods()

David M. Karr dmkarr at earthlink.net
Wed Apr 30 02:51:41 2003


I have a small web application that I've tested with Tomcat 4.1.18 on Windows
XP, with JDK 1.2.2.  It works fine in this environment.  It has a couple of
servlets and a couple of JSP pages.

When I package it up for iPlanet 4.1 on Solaris 2.6 (still using JDK 1.2.2) I
see a very weird symptom.

(Don't bother telling me to upgrade any of these versions.  I live in legacy
hell.)

As iPlanet 4.1 doesn't support the web application parts of Servlet 2.2, I have
to do manual packaging of the application.  So, I put my servlet and directly
related classes in one jar file, and other classes in another jar file.  Both
jar files are in the webserver classpath.

What I see is that inside my servlet, after creating an instance of a class
that it got from the other jar file, it tries to call a method on that
instance, but instead gets a "MethodNotFound" exception.  This is very odd,
because I took the same classes that worked fine on WinXP.

I then thought that I would just try to confirm the class was actually there by
adding code before the method call that calls "getDeclaredMethods()" on the
class that I just instantiated, so I can print out the methods in the class.

After I redeployed this to iPlanet 4.1, I saw that it gave me the information I
expected.  The debug output showed me that the method WAS there.  What I didn't
expect is that it also was able to find and call the method!  The output I got
showed that it got into the called method and got further (and threw another
exception, which I actually expected).

So, another demonstration of the Heisenberg Principle.  Does anyone know what
could be going on here?

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net   ; SCJP; SCWCD