作业帮 > 综合 > 作业

org.springframework.beans.factory.BeanCreationException:Erro

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/23 20:29:49
org.springframework.beans.factory.BeanCreationException:Error creating bean with name 'tgMailSender' defined in ServletContext resource [/WEB-INF/datasource.xml]:Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException:Failed to convert property value of type [javax.mail.Session] to required type [javax.mail.Session] for property 'session'; nested exception is java.lang.IllegalArgumentException:Cannot convert value of type [javax.mail.Session] to required type [javax.mail.Session] for property 'session':no matching editors or conversion strategy found
配置邮件时出现以上错误,都是javax.mail.Session为什么没法转换,
是不是有两个版本的.jar在里面.
再问: 我把所有用到jar的地方全部改为一个版本了,不行。。
再答: 我是这样写,一切正常的
再问: 配置方法不太一样,我是在tomcat配置文件中配置的。。。 可不可以将你的com.myproject.service.MailEngine发过来我参考一下
再答: MailEngine 就是实现/覆盖一下里面的方法,没啥特别的。