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

Nikolaos Giannopoulos nikolaos at solmar.ca
Wed Apr 30 18:38:13 2003


> -----Original Message-----
> From: advanced-java-bounces@lists.xcf.berkeley.edu
> [mailto:advanced-java-bounces@lists.xcf.berkeley.edu]On Behalf Of David
> M. Karr
>
>
> 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.

It's been a while since I have dev'd with iPlanet 4.1 but doesn't it expect
your servlets in a directory called 'servlets' in the 'docs' folder?


> 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.

We experienced some odd testing with iPlanet 4.1 so much so that we didn't
even jar anything up (because we knew we would be moving to web app
supported web servers down the road... like Tomcat).

So what we did was keep the servlet classes un-jarred AND any time we made a
change to those classes we would stop and start iPlanet.



> 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?

The only guess that I have is that iPlanet may be caching some parts of
certain classes that are not necessarily compatible with your latest
compiled set of classes i.e. if you stop and start iPlanet and still have an
issue then I'm wrong.

Also keep in mind that static final variables are typically inlined and that
may impact your app if you change a class but don't change other
(re-compiled) classes that used the static final variable.

In the end - since you have not mentioned anything about starting/stopping
iPlanet - I can only guess that dynamic reloading of slightly incompatible
classes is causing you the grief.

Without further info though this is just a wild guess ;-)

--Nikolaos