dcsimg
NoSuchMethodError using JDK 1.5.0
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Stefan_Borchardt
Posted On:   Thursday, March 31, 2005 08:59 AM

Hello, is JavaMail ready for JDK 5.0? I get this error message: DEBUG: setDebug: JavaMail version 1.3.1 DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc] DEBUG: mail.imap.fetchsize: 16384 Exception in thread "main" java.lang.NoSuchMethodError: com.sun.mail.util.SocketFetcher.getSocket(Ljava/lang/String;ILjava/util/Properties;Ljava/lang/String;Z)Ljava/net/Socket; at com.sun.mail.iap.Protocol. (Protocol.java:66) at com.sun.mail.imap.protocol.IMAPProtocol. (IMAPProtocol.java:69) at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:414) at javax.mail.Service   More>>

Hello,


is JavaMail ready for JDK 5.0?

I get this error message:


DEBUG: setDebug: JavaMail version 1.3.1
DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc]
DEBUG: mail.imap.fetchsize: 16384


Exception in thread "main" java.lang.NoSuchMethodError: com.sun.mail.util.SocketFetcher.getSocket(Ljava/lang/String;ILjava/util/Properties;Ljava/lang/String;Z)Ljava/net/Socket;


at com.sun.mail.iap.Protocol. (Protocol.java:66)
at com.sun.mail.imap.protocol.IMAPProtocol. (IMAPProtocol.java:69)
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:414)
at javax.mail.Service.connect(Service.java:233)
at javax.mail.Service.connect(Service.java:134)
at GetMail. (GetMail.java:22)
at Main.main(Main.java:39) // <- i.connect(...


My source code:


import javax.mail.*;
//import javax.activation.*;
//import javax.mail.internet.*;
import java.util.*;


public class GetMail {
Session s = null;
Store i = null;
Folder f = null;
public GetMail() {
s = Session.getDefaultInstance(new Properties());
s.setDebug(true);
try {
i = s.getStore("imap");
i.connect("imap.1und1.de", "USER", "PASSWD"); //Exception here
f = i.getDefaultFolder();
} catch (Exception e) {
e.printStackTrace();
} } }


This code works on another machine with JRE 1.4.2.
The JAR-files are included in the classpath and the exception does not seem to be a Security Manager problem.
I have already varied Properties, protocol, host, user and passwd, without success.
I use JavaMail 1.3.2 and JDK 1.5.0_02 with NetBeans 4.1b on Windows XP SP2.


What am I doing wrong?


Thanks,


Stefan Borchardt

   <<Less

Re: NoSuchMethodError using JDK 1.5.0

Posted By:   Stefan_Borchardt  
Posted On:   Friday, April 1, 2005 05:07 AM

According to Bill Shannon, this can occur when different versions of JavaMail are simultaneously present in the CLASSPATH.


Stefan Borchardt

About | Sitemap | Contact