首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >未找到javax.mail.internet.MimeMessage的类文件

未找到javax.mail.internet.MimeMessage的类文件
EN

Stack Overflow用户
提问于 2013-12-12 12:58:07
回答 4查看 18K关注 0票数 15

在构建我的项目时,我会收到以下错误。

代码语言:javascript
运行
复制
City\controller\MyMailHelper.java:59: cannot access javax.mail.internet.MimeMessage
class file for javax.mail.internet.MimeMessage not found

在应用程序代码中,我指的是以下导入。

代码语言:javascript
运行
复制
import org.springframework.mail.javamail.MimeMailMessage;
import org.springframework.mail.javamail.MimeMessageHelper;

下面给出了从我的项目的maven依赖树中提取的Spring依赖项。有人能帮我找出是哪种依赖造成了这个问题吗。

代码语言:javascript
运行
复制
Line 27:  |  +- org.springframework:spring-jdbc:jar:3.2.1.RELEASE:compile (version managed from 3.2.1.RELEASE; scope managed from compile)
    Line 28:  |  +- org.springframework:spring-orm:jar:3.2.1.RELEASE:compile (version managed from 3.2.1.RELEASE; scope managed from compile)
    Line 29:  |  +- org.springframework:spring-jms:jar:3.2.1.RELEASE:compile (version managed from 3.2.1.RELEASE; scope managed from compile)
    Line 52:  |  +- org.springframework:spring-beans:jar:3.2.1.RELEASE:compile (version managed from 3.2.1.RELEASE; scope managed from compile
    Line 53:  |  +- org.springframework:spring-aop:jar:3.2.1.RELEASE:compile (version managed from 3.2.1.RELEASE; scope managed from compile)
    Line 64:  +- org.springframework:spring-core:jar:3.2.1.RELEASE:compile
    Line 65:  +- org.springframework:spring-context:jar:3.2.1.RELEASE:compile
    Line 66:  |  \- org.springframework:spring-expression:jar:3.2.1.RELEASE:compile
    Line 67:  +- org.springframework:spring-web:jar:3.2.1.RELEASE:compile
    Line 69:  +- org.springframework:spring-webmvc:jar:3.2.1.RELEASE:compile
    Line 74:  |  +- org.springframework.ws:spring-ws:jar:all:2.0.5.RELEASE:compile
    Line 77:  |  +- org.springframework:spring-tx:jar:3.1.3.RELEASE:compile
    Line 90:  |  +- org.springframework.ws:spring-ws-core:jar:2.1.2.RELEASE:compile (version managed from 2.1.2.RELEASE)
    Line 91:  |  |  +- org.springframework.ws:spring-xml:jar:2.1.2.RELEASE:compile
    Line 93:  |  +- org.springframework:spring-oxm:jar:3.2.1.RELEASE:compile
    Line 99:  +- org.springframework:spring-test:jar:3.2.1.RELEASE:test
EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2013-12-12 16:23:11

您似乎缺少了对javax.mail的依赖关系。

尝试将其添加到Maven依赖项中。

代码语言:javascript
运行
复制
<dependency>
   <groupId>javax.mail</groupId>
   <artifactId>mail</artifactId>
   <version>1.4.7</version>
</dependency>
票数 30
EN

Stack Overflow用户

发布于 2021-08-13 00:05:08

bparry的回答仍然有效。但是您应该考虑用jakarta.mail代替它。

此外,将javax.mail的每个实例替换为代码库中的jakarta.mail

票数 1
EN

Stack Overflow用户

发布于 2013-12-12 23:37:28

从回购系统下载文物似乎有一些问题。昨天。今天,当我运行mvn干净安装时,它下载了一些昨天没有发生的工件。今天没看到任何错误,我感到很震惊。今天从回购处下载的文物。jar带来了javax.mail:mail:jar:1.4.1

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20544245

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档