--- "Craig R. McClanahan"
<[EMAIL PROTECTED]> 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..
m.invoke(cfg,null);

> 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 <http://jakarta.apache.org/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!

Mel


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to