spring自动发送邮件报错?

在每天的下午四点钟,执行某类中的方法,正常到达。
可是执行发送邮件send时报错。因为我要在这里查询数据库。
是不是session未关闭的原因。然后就发送,所以导致的呢。
请求支援~~~

错误消息:
at com.vstartek.crm.secutity.mail.SimpleMailServer.sendTextMail(SimpleMailServer.java:41)
at com.vstartek.crm.secutity.service.QuBirthday.sendMail(QuBirthday.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:283)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:272)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
17:26:17,312 DEBUG ExceptionHelper:97 - Detected JDK support for nested exceptions.
17:26:17,328 INFO JobRunShell:207 - Job DEFAULT.birthTask threw a JobExecutionException:
org.quartz.JobExecutionException: Invocation of method 'sendMail' on target class [class com.vstartek.crm.secutity.service.QuBirthday] failed [See nested exception: java.lang.NoClassDefFoundError: javax/activation/DataSource]
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:287)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: java.lang.NoClassDefFoundError: javax/activation/DataSource
at com.vstartek.crm.secutity.mail.SimpleMailServer.sendTextMail(SimpleMailServer.java:41)
at com.vstartek.crm.secutity.service.QuBirthday.sendMail(QuBirthday.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:283)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:272)
... 3 more

2个回答

你的库路径里有activation.jar吗?
你再好好检查检查吧,应该就是缺包的

注意这里:
Caused by: java.lang.NoClassDefFoundError: javax/activation/DataSource
应该是少了个jar包

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐