tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mel Martinez <>
Subject Re: Bug?[Tomcat 3.2.1] Or am I missing something...
Date Thu, 08 Feb 2001 03:26:47 GMT

--- "Craig R. McClanahan"
<> wrote:
> Mel Martinez wrote:
> > com.g1440.naf.reflect.SimpleDecorator: illegal
> access
> > ...
> > Method.invoke(cfg,"getServletName",null);
> >

Oops! That should have been something like
Method m = ...getServletName method..

> This is exactly the cause of the problem.  When you
> use Java reflection
> to return a Method object from the implementation
> class, you'll get the
> access error exception if the class itself is not
> public (which is true
> in this case).

Oh duh-uh!  I knew this.  I really did know this. 
Okay, so I completely forgot this.  Why do I not have
a perfect memory?  Sigh...

Thanks a ton, Craig.  I can batten this down easily
enough, I think.

> The workaround is to use reflection to identify the
> interfaces that this
> class implements, and get the Method object from the
> interface instead of
> the implementation class.  We just went through this
> rigamarole on the
> Struts utility module that calls property getters
> and setters via
> reflection -- check out the
> org.apache.struts.util.PropertyUtils class in
> Struts <> for how we
> dealt with it.

I have a good idea on what to do here, but I'll
definitely take a look at the above.  There is always
more to learn, after all!


Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!

View raw message