tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jiger Java" <jigerj...@hotmail.com>
Subject Problems with Tomcat4, Reflection & Classloading
Date Fri, 04 Jan 2002 07:09:07 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)
	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 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.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)

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.

Can anyone help me to solve this problem.

Thanks in Advance,
Jiger



_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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