NutzCN Logo
问答 阿里云邮箱报错,请问是什么问题
发布于 355天前 作者 lihongwu19921215 812 次浏览 复制 上一个帖子 下一个帖子
标签:
05-30 13:14:51.125  DEBUG - [QuartzSchedulerThread.DGJQuartzScheduler_QuartzSchedulerThread] batch acquisition of 0 triggers
org.nutz.ioc.IocException: javax/mail/Authenticator For object [htmlEmail] - type:[class org.apache.commons.mail.HtmlEmail]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:203)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:221)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:140)
	at com.brt.film.module.web.ContactModule.sendEmail(ContactModule.java:155)
	at com.brt.film.module.web.ContactModule$$NUTZAOP._aop_invoke(ContactModule.java:1)
	at org.nutz.aop.InterceptorChain.invoke(InterceptorChain.java:77)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:57)
	at org.nutz.aop.interceptor.TransactionInterceptor.filter(TransactionInterceptor.java:34)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
	at com.dgj.nutz.interceptor.ExecutionTimeInterceptor.filter(ExecutionTimeInterceptor.java:28)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
	at com.dgj.nutz.interceptor.NameSpaceAndSessionInterceptor.filter(NameSpaceAndSessionInterceptor.java:33)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
	at org.nutz.aop.interceptor.LoggingMethodInterceptor.filter(LoggingMethodInterceptor.java:48)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
	at com.brt.film.module.web.ContactModule$$NUTZAOP.sendEmail(ContactModule.java)
	at com.brt.film.module.web.ContactModule.add(ContactModule.java:128)
	at com.brt.film.module.web.ContactModule$$NUTZAOP._aop_invoke(ContactModule.java:1)
	at org.nutz.aop.InterceptorChain.invoke(InterceptorChain.java:77)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:57)
	at org.nutz.aop.interceptor.TransactionInterceptor.filter(TransactionInterceptor.java:34)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
	at com.dgj.nutz.interceptor.ExecutionTimeInterceptor.filter(ExecutionTimeInterceptor.java:28)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
	at com.dgj.nutz.interceptor.NameSpaceAndSessionInterceptor.filter(NameSpaceAndSessionInterceptor.java:33)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
	at org.nutz.aop.interceptor.LoggingMethodInterceptor.filter(LoggingMethodInterceptor.java:48)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
	at com.brt.film.module.web.ContactModule$$NUTZAOP.add(ContactModule.java)
	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.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:25)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:40)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:113)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:40)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:183)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: javax/mail/Authenticator
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
	at java.lang.Class.getDeclaredMethods(Unknown Source)
	at org.nutz.lang.Mirror.getMethods(Mirror.java:604)
	at org.nutz.ioc.aop.config.impl.AnnotationAopConfigration.getAopMethod(AnnotationAopConfigration.java:42)
	at org.nutz.ioc.aop.config.impl.AnnotationAopConfigration.getInterceptorPairList(AnnotationAopConfigration.java:28)
	at org.nutz.ioc.aop.config.impl.ComboAopConfigration.getInterceptorPairList(ComboAopConfigration.java:23)
	at org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:78)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:34)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:196)
	... 66 more
Caused by: java.lang.ClassNotFoundException: javax.mail.Authenticator
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
	... 76 more
HtmlEmail email = ioc.get(HtmlEmail.class);
            email.setSubject(title);
            email.setMsg(content);
            email.addTo(emailnum);//请务必改成您自己的邮箱啊!!!
            email.buildMimeMessage();
            email.sendMimeMessage();
var ioc={
	con : {
			type : "org.nutz.ioc.impl.PropertiesProxy",
			fields : {
				paths : [ "mail/" ],
				utf8 : false
			}
		},
    emailAuthenticator : {
        type : "org.apache.commons.mail.DefaultAuthenticator",
        args : [{java:"$con.get('mail.UserName')"}, {java:"$con.get('mail.Password')"}]
    },
    htmlEmail : {
        type : "org.apache.commons.mail.ImageHtmlEmail",
        singleton : false,
        fields : {
            hostName : {java:"$con.get('mail.HostName')"},
            smtpPort : {java:"$con.get('mail.SmtpPort')"},
            authenticator : {refer:"emailAuthenticator"},
            SSLOnConnect : {java:"$con.get('mail.SSLOnConnect')"},
            from : {java:"$con.get('mail.From')"},
            charset : {java:"$con.get('mail.charset', 'UTF-8')"}
        }
    }
};
2 回复

java.lang.NoClassDefFoundError: javax/mail/Authenticator

缺类

commons-email-1.4.jar
activation-1.1.1.jar
我引的是这两个jar ,但是网上帖子说,tomcat lib 缺少 我也放了一份,也没好用

添加回复
请先登陆
回到顶部