tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remy Maucherat" <r...@apache.org>
Subject Re: Problems with Tomcat4, Reflection & Classloading
Date Fri, 04 Jan 2002 11:04:59 GMT
> Hi all,
>       I am using Tomcat 4.0 final, JDK 1.4 beta 3, Win98 for dev.
> I am using a automatic bean population class to automatically populate
bean
> based on request object just like in Struts.
>    Ok, now the problem comes during population when I receive the
following
> exception.
>
> java.lang.IllegalArgumentException: object is not an instance of declaring
> class
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42
)
>
> I notice this problem when Tomcat is left unused for sometime & also when
a
> class when compiled is re-loaded by tomcat. since some property is not set
> its validation fails & is sent back to form page with the errors
> highlighted.

I also get the error with the HEAD of Tomcat, and Slide (both during init,
and the error occurs all the time).

>   If I continue sending request or try to refresh the page it then gives
the
> the following error
>
> Root Cause:
> java.lang.NoClassDefFoundError: sun/reflect/MethodAccessorImpl
> at sun.misc.Unsafe.defineClass(Native Method)
> at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:49)
> at
>
sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:384)
>
> This seems to be a serious error in classloading mechanism or in
reflection.
> I am using exactly same logic as in struts so should not be wrong, coz the
> bean population etc works fine for a long time perfectly well until the
> server is kept idle for some time or reloading of classes.
>
>   Once again my config is Tomcat 4.0 final, Win98, JDK 1.4 beta 3.

There's also a tester failure with JDK 1.4, which doesn't happen with other
JDKs. Until proven wrong, I'll assume both are a JDK issue.
If I were you, I would try a different JDK (1.3.1 looks like a good choice).

Remy


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message