troubleshooting Question

Java Error 500: java.lang.NoSuchMethodError: com/sun/mail/util/SocketFetcher.getSocket

Avatar of pavelmed
pavelmed asked on
Java
39 Comments2 Solutions4153 ViewsLast Modified:
I was asked to resolve the run-time error which was thrown by a Java application (on a Windows server) while trying to send an email.
The application was written a while ago and is working on another Windows server.

The error thrown is: "Error 500: java.lang.NoSuchMethodError:
com/sun/mail/util/SocketFetcher.getSocket(Ljava/lang/String;ILjava/util/Properties;Ljava/lang/String;Z)Ljava/net/Socket; "

The whole environment was moved to a new server where that applications failed.
I determined that the application was using the JavaMail package.

I could not located the mail.jar file in the major Java directories (I only located one deep down in one of WebSphere directories).
I also could not recompile the java file that was using JavaMail because it could not find the package.

So I downloaded and installed the latest mail.jar file (JavaMail version 1.4.4) and included the path into the CLASSPATH.
By the way, the CLASSPATH variable was not configured on the server, so the path to JavaMail is now the only path in the CLASSPATH.

Anyway, nothing helped after I recompiled the application.  I am still getting the same "NoSuchMethodError" error.

I tried to replace the new mail.jar file by the old one from the older server (where the app worked), then recompiled the app and ran again - same error.

Could you please suggest how to resolve this?

Thank you!
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 39 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 39 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros