Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Wrong number of arguments in method" Watch "Wrong number of arguments in method" New topic
Author

Wrong number of arguments in method

Clive van Hilten
Greenhorn

Joined: Feb 13, 2002
Posts: 18
Hi
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.
Clive
[ April 12, 2002: Message edited by: Clive van Hilten ]
Cindy Glass
"The Hood"
Sheriff

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
Greenhorn

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.
Clive
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

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?)
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Don't get me started about those stupid light bulbs.
 
subject: Wrong number of arguments in method
 
Similar Threads
Java mail problem
storing array in beans????
Calling a function with 2 arguments
html error when posting
Method not found error - why?