Quantcast
Channel: Crunchify
Viewing all articles
Browse latest Browse all 1037

How to fix Spring MVC MailSender and SimpleMailMessage import missing Error?

$
0
0

I love working on Java and Spring MVC a lot. I have developed numerous personal applications which are hosted on Google Cloud platform and working very well so far my custom requirements.

In addition to personal use, I also extensively use Java at my work. It’s kind of mix with Spring Boot and J2EE with all MySQL queries.

Sometime back I’ve written an article on How to send an email using Java and Spring MVC. Today I wanted to revisit that and somehow after opening project and cleaning Eclipse workspace, I got errors for missing imports:

import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;

Somehow it took me almost some time to figure out what happened. By mistake or some how I removed below maven dependency from my pom.xml file and I started getting those errors.

<dependency>
	<groupId>org.springframework</groupId>
	<artifactId>spring-context-support</artifactId>
	<version>4.3.1.RELEASE</version>
</dependency>

Simply add above spring-context-support dependency to your pom.xml and all errors should go away.

If you are getting below errors then also this solution will work

  • failed to read artifact descriptor for org springframework spring context jar
  • failed to read artifact descriptor for org.apache.maven.plugins eclipse
Have a suggestion on article? Please chime in and share it as a comment.

The post How to fix Spring MVC MailSender and SimpleMailMessage import missing Error? appeared first on Crunchify.

Author: App Shah

Crunchify, LLC Logo


Viewing all articles
Browse latest Browse all 1037

Trending Articles