commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank W. Zammetti" <fzli...@omnytex.com>
Subject [beanutils] Problem with MethodUtils.invokeExactMethod
Date Tue, 08 Mar 2005 23:10:39 GMT
Hello...

I'm trying to use MethodUtils.invokeExactMethod, and I keep receiving:

java.lang.NoSuchMethodException: No such accessible method: 
setupMethod1() on object: com.omnytex.setupexample.setups.SetupClass1

Here's the pertinent code:

String setupClass = "com.omnytex.setupexample.setups.SetupClass1";
String setupMethod = "setupMethod1";
Object setupClassObj = RequestUtils.applicationInstance(setupClass);
MethodUtils.invokeExactMethod(setupClassObj, setupMethod, request);

request is an HttpServletRequest object.  Here's the code for SetupClass1:

package com.omnytex.setupexample.setups;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class SetupClass1 {
   private static Log log = LogFactory.getLog(SetupClass1.class);
   public void setupMethod1(HttpServletRequest request) {
     log.info("setupMethod1() - Setting request attribute...");
     request.setAttribute("c1m1", "c1m1_value");
     log.info("setupMethod1() - Done!");
   }
}

Clearly, there is in fact a setupMethod1() method.  I have verified that 
setupClassObj is in fact a valid object of the correct type, so its not 
an instantiation problem (would have expected a different exception if 
it was anyway).

My only guess is that I'm somehow not using the argument portion of the 
invokeExactMethod() call properly, but I don't see what the problem 
specifically might be.

Any ideas?  Thanks!

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message