jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes Wrong number of arguments in method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Wrong number of arguments in method" Watch "Wrong number of arguments in method" New topic

Wrong number of arguments in method

Clive van Hilten

Joined: Feb 13, 2002
Posts: 18
Windows 2000 Professional with SP2
JDK1.3.0_02 with JavaMail(TM) API 1.2 release from Sun
Tomcat 3.2

all code can be found in text format at http://ariel.mit-misys.com/javaranch
I have a bean called MailBean.java. I have a JSP (transfer.jsp) that calls the sendMail method of this bean - the relevant part of the JSP is also posted at the above URL.
The error message I get when running the JSP is: "Wrong number of arguments in method". As far as I can see, I have the correct number of arguments and datatypes passed as parameters.
Can anyone tell me where I'm going wrong, please?
Thank you.
[ April 12, 2002: Message edited by: Clive van Hilten ]
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Well, since access to that site is FORBIDDEN is kinda hard to tell.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Clive van Hilten

Joined: Feb 13, 2002
Posts: 18
Sorry Cindy, I think the UBB code added the closing bracket to the URL in my post, you should be able to get to it now.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

Well, a quick inspection doesn't reveal anything overt. Are you sure that it's the call to sendMail that the compiler is complaining about? You might want to post the complete text of the error message as a clue.
An unrelated question (to be ignored if you don't appreciate unsolicited advice on your code): since sendMail is a static method, why do you bother instantiating a bean rather than using a static call (a la ariel.MailBean.sendMail())?
Also, is what you posted a complete class? The only methods that actually do anything are static and don't reference the member variables at all. (Or is this just an incomplete work in progress?)

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: Wrong number of arguments in method
It's not a secret anymore!