Re: Problems with Tomcat4, Reflection Classloading

2002-01-04 Thread Remy Maucherat

 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:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Problems with Tomcat4, Reflection Classloading

2002-01-03 Thread Jiger Java

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)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
at java.lang.reflect.Method.invoke(Method.java:327)
at com.co.util.FormUtil.populateBean(FormUtil.java:66)
at com.co.util.FormUtil.populateBean(FormUtil.java:18)
at DomcnoEtppServlet.doGet(Unknown Source)
at DomcnoEtppServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at MVCServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown 
Source)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
at org.apache.catalina.valves.CertificatesValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
at org.apache.catalina.valves.AccessLogValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
at org.apache.catalina.connector.http.HttpProcessor.process(Unknown Source)
at org.apache.catalina.connector.http.HttpProcessor.run(Unknown Source)
at java.lang.Thread.run(Thread.java:539)

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.
  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)
at java.security.AccessController.doPrivileged(Native Method)
at 
sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:380)
at 
sun.reflect.MethodAccessorGenerator.generateMethod(MethodAccessorGenerator.java:62)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:31)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
at java.lang.reflect.Method.invoke(Method.java:327)
at com.co.util.FormUtil.populateBean(FormUtil.java:66)
at com.co.util.FormUtil.populateBean(FormUtil.java:18)
at AuthenticationServlet.doGet(Unknown Source)
at AuthenticationServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at MVCServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(Unknown Source)
at org.apache.catalina.servlets.InvokerServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at