NutzCN Logo
问答 阿里云,邮箱登录验证失败,MimeMessage has not been created yet
发布于 2205天前 作者 blblbiu 1144 次浏览 复制 上一个帖子 下一个帖子
标签:

2018-11-02 11:50:44,295 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(dataSource) in JsonLoader(paths=[/ioc])
2018-11-02 11:50:44,296 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(htmlEmail) in JsonLoader(paths=[/ioc])
2018-11-02 11:50:44,296 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(userProfileModule) in AnnotationIocLoader(packages=[com.chats.nutzbook])
2018-11-02 11:50:44,296 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(emailservice) in AnnotationIocLoader(packages=[com.chats.nutzbook])
2018-11-02 11:50:44,297 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'emailservice'<interface com.chats.nutzbook.service.EmailService>
2018-11-02 11:50:44,297 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - >> Load definition name=emailservice
2018-11-02 11:50:44,297 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(emailservice) in AnnotationIocLoader(packages=[com.chats.nutzbook])
2018-11-02 11:50:44,297 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:223) DEBUG - >> Make...'emailservice'<interface com.chats.nutzbook.service.EmailService>
2018-11-02 11:50:44,297 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:65) DEBUG - Save object 'emailservice' to [app]
2018-11-02 11:50:44,298 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) DEBUG - Load class com.chats.nutzbook.service.EmailServiceimpl without AOP
2018-11-02 11:50:44,300 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2018-11-02 11:50:45,332 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [ GET]URI=/chatsweb/user/profile 1062ms
2018-11-02 11:50:45,358 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [GET] path=/user/profile/avatar : UserProfileModule.readAvatar(UserProfileModule.java:125)
2018-11-02 11:50:45,358 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:50:45,389 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT avatar FROM t_user_profile WHERE uid=?
| 1 |
|---|
| 1 |
For example:> "SELECT avatar FROM t_user_profile WHERE uid=1"
2018-11-02 11:50:45,438 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [ GET]URI=/chatsweb/user/profile/avatar 80ms
2018-11-02 11:50:49,186 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [GET] path=/user/profile : UserProfileModule.index(UserProfileModule.java:135)
2018-11-02 11:50:49,187 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:50:49,194 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [ GET]URI=/chatsweb/user/profile 8ms
2018-11-02 11:50:49,207 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [GET] path=/user/profile/avatar : UserProfileModule.readAvatar(UserProfileModule.java:125)
2018-11-02 11:50:49,210 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:50:49,212 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT avatar FROM t_user_profile WHERE uid=?
| 1 |
|---|
| 1 |
For example:> "SELECT avatar FROM t_user_profile WHERE uid=1"
2018-11-02 11:50:49,214 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [ GET]URI=/chatsweb/user/profile/avatar 4ms
2018-11-02 11:50:50,210 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/user/profile/active/mail : UserProfileModule.activeMail(UserProfileModule.java:140)
2018-11-02 11:50:50,210 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:50:50,211 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile WHERE uid=?
| 1 |
|---|
| 1 |
For example:> "SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile WHERE uid=1"
2018-11-02 11:50:50,229 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:50:50,229 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - >> Load definition name=htmlEmail
2018-11-02 11:50:50,229 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(htmlEmail) in JsonLoader(paths=[/ioc])
2018-11-02 11:50:50,229 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:223) DEBUG - >> Make...'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:50:50,243 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) DEBUG - Load class org.apache.commons.mail.ImageHtmlEmail without AOP
2018-11-02 11:50:50,355 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,360 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,360 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'emailAuthenticator'<>
2018-11-02 11:50:50,360 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - >> Load definition name=emailAuthenticator
2018-11-02 11:50:50,361 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(emailAuthenticator) in JsonLoader(paths=[/ioc])
2018-11-02 11:50:50,362 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:223) DEBUG - >> Make...'emailAuthenticator'<>
2018-11-02 11:50:50,363 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:65) DEBUG - Save object 'emailAuthenticator' to [app]
2018-11-02 11:50:50,363 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,363 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,365 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) DEBUG - Load class org.apache.commons.mail.DefaultAuthenticator without AOP
2018-11-02 11:50:50,365 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,365 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,367 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,368 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,371 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,372 com.chats.nutzbook.service.EmailServiceimpl.send(EmailServiceimpl.java:26) INFO - 发送邮件失败java.lang.IllegalArgumentException: MimeMessage has not been created yet
2018-11-02 11:50:50,377 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [POST]URI=/chatsweb/user/profile/active/mail 167ms
2018-11-02 11:51:05,962 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 0 triggers
2018-11-02 11:51:31,161 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 0 triggers
2018-11-02 11:51:49,705 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/user/profile/active/mail : UserProfileModule.activeMail(UserProfileModule.java:140)
2018-11-02 11:51:49,705 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:51:49,707 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile WHERE uid=?
| 1 |
|---|
| 1 |
For example:> "SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile WHERE uid=1"
2018-11-02 11:51:49,710 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:49,710 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - >> Load definition name=htmlEmail
2018-11-02 11:51:49,710 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(htmlEmail) in JsonLoader(paths=[/ioc])
2018-11-02 11:51:49,710 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:223) DEBUG - >> Make...'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:49,711 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) DEBUG - Load class org.apache.commons.mail.ImageHtmlEmail without AOP
2018-11-02 11:51:49,711 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:49,712 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:49,712 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'emailAuthenticator'<>
2018-11-02 11:51:49,712 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:49,713 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:49,713 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:49,713 com.chats.nutzbook.service.EmailServiceimpl.send(EmailServiceimpl.java:26) INFO - 发送邮件失败java.lang.IllegalArgumentException: MimeMessage has not been created yet
2018-11-02 11:51:49,714 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [POST]URI=/chatsweb/user/profile/active/mail 9ms
2018-11-02 11:51:52,653 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/user/profile/active/mail : UserProfileModule.activeMail(UserProfileModule.java:140)
2018-11-02 11:51:52,653 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:51:52,654 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile WHERE uid=?
| 1 |
|---|
| 1 |
For example:> "SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile WHERE uid=1"
2018-11-02 11:51:52,656 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:52,657 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - >> Load definition name=htmlEmail
2018-11-02 11:51:52,657 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(htmlEmail) in JsonLoader(paths=[/ioc])
2018-11-02 11:51:52,657 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:223) DEBUG - >> Make...'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:52,657 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) DEBUG - Load class org.apache.commons.mail.ImageHtmlEmail without AOP
2018-11-02 11:51:52,658 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:52,658 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:52,658 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'emailAuthenticator'<>
2018-11-02 11:51:52,658 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:52,659 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:52,659 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:52,659 com.chats.nutzbook.service.EmailServiceimpl.send(EmailServiceimpl.java:26) INFO - 发送邮件失败java.lang.IllegalArgumentException: MimeMessage has not been created yet
2018-11-02 11:51:52,661 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [POST]URI=/chatsweb/user/profile/active/mail 8ms
2018-11-02 11:51:54,372 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/user/profile/active/mail : UserProfileModule.activeMail(UserProfileModule.java:140)
2018-11-02 11:51:54,373 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:51:54,374 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile WHERE uid=?
| 1 |
|---|
| 1 |
For example:> "SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile WHERE uid=1"
2018-11-02 11:51:54,375 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:54,376 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - >> Load definition name=htmlEmail
2018-11-02 11:51:54,376 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(htmlEmail) in JsonLoader(paths=[/ioc])
2018-11-02 11:51:54,376 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:223) DEBUG - >> Make...'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:54,376 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) DEBUG - Load class org.apache.commons.mail.ImageHtmlEmail without AOP
2018-11-02 11:51:54,376 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:54,377 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:54,377 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'emailAuthenticator'<>
2018-11-02 11:51:54,377 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:54,377 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:54,377 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:54,377 com.chats.nutzbook.service.EmailServiceimpl.send(EmailServiceimpl.java:26) INFO - 发送邮件失败java.lang.IllegalArgumentException: MimeMessage has not been created yet
2018-11-02 11:51:54,379 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [POST]URI=/chatsweb/user/profile/active/mail 6ms
2018-11-02 11:51:56,162 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/user/profile/active/mail : UserProfileModule.activeMail(UserProfileModule.java:140)
2018-11-02 11:51:56,163 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:51:56,163 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile WHERE uid=?
| 1 |
|---|
| 1 |
For example:> "SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile WHERE uid=1"
2018-11-02 11:51:56,166 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:56,166 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - >> Load definition name=htmlEmail
2018-11-02 11:51:56,166 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(htmlEmail) in JsonLoader(paths=[/ioc])
2018-11-02 11:51:56,166 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:223) DEBUG - >> Make...'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:56,167 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) DEBUG - Load class org.apache.commons.mail.ImageHtmlEmail without AOP
2018-11-02 11:51:56,167 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:56,167 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:56,168 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'emailAuthenticator'<>
2018-11-02 11:51:56,168 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:56,168 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:56,168 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:56,169 com.chats.nutzbook.service.EmailServiceimpl.send(EmailServiceimpl.java:26) INFO - 发送邮件失败java.lang.IllegalArgumentException: MimeMessage has not been created yet
2018-11-02 11:51:56,170 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [POST]URI=/chatsweb/user/profile/active/mail 8ms
2018-11-02 11:51:56,604 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 0 triggers

2018-11-02 11:50:44,295 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(dataSource) in JsonLoader(paths=[/ioc])
2018-11-02 11:50:44,296 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(htmlEmail) in JsonLoader(paths=[/ioc])
2018-11-02 11:50:44,296 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(userProfileModule) in AnnotationIocLoader(packages=[com.chats.nutzbook])
2018-11-02 11:50:44,296 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(emailservice) in AnnotationIocLoader(packages=[com.chats.nutzbook])
2018-11-02 11:50:44,297 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'emailservice'<interface com.chats.nutzbook.service.EmailService>
2018-11-02 11:50:44,297 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - 	 >> Load definition name=emailservice
2018-11-02 11:50:44,297 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(emailservice) in AnnotationIocLoader(packages=[com.chats.nutzbook])
2018-11-02 11:50:44,297 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:223) DEBUG - 	 >> Make...'emailservice'<interface com.chats.nutzbook.service.EmailService>
2018-11-02 11:50:44,297 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:65) DEBUG - Save object 'emailservice' to [app] 
2018-11-02 11:50:44,298 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) DEBUG - Load class com.chats.nutzbook.service.EmailServiceimpl without AOP
2018-11-02 11:50:44,300 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2018-11-02 11:50:45,332 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [ GET]URI=/chatsweb/user/profile 1062ms
2018-11-02 11:50:45,358 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [GET] path=/user/profile/avatar : UserProfileModule.readAvatar(UserProfileModule.java:125)
2018-11-02 11:50:45,358 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:50:45,389 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT avatar FROM t_user_profile  WHERE uid=?
    | 1 |
    |---|
    | 1 |
  For example:> "SELECT avatar FROM t_user_profile  WHERE uid=1"
2018-11-02 11:50:45,438 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [ GET]URI=/chatsweb/user/profile/avatar 80ms
2018-11-02 11:50:49,186 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [GET] path=/user/profile : UserProfileModule.index(UserProfileModule.java:135)
2018-11-02 11:50:49,187 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:50:49,194 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [ GET]URI=/chatsweb/user/profile 8ms
2018-11-02 11:50:49,207 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [GET] path=/user/profile/avatar : UserProfileModule.readAvatar(UserProfileModule.java:125)
2018-11-02 11:50:49,210 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:50:49,212 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT avatar FROM t_user_profile  WHERE uid=?
    | 1 |
    |---|
    | 1 |
  For example:> "SELECT avatar FROM t_user_profile  WHERE uid=1"
2018-11-02 11:50:49,214 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [ GET]URI=/chatsweb/user/profile/avatar 4ms
2018-11-02 11:50:50,210 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/user/profile/active/mail : UserProfileModule.activeMail(UserProfileModule.java:140)
2018-11-02 11:50:50,210 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:50:50,211 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile  WHERE uid=?
    | 1 |
    |---|
    | 1 |
  For example:> "SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile  WHERE uid=1"
2018-11-02 11:50:50,229 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:50:50,229 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - 	 >> Load definition name=htmlEmail
2018-11-02 11:50:50,229 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(htmlEmail) in JsonLoader(paths=[/ioc])
2018-11-02 11:50:50,229 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:223) DEBUG - 	 >> Make...'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:50:50,243 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) DEBUG - Load class org.apache.commons.mail.ImageHtmlEmail without AOP
2018-11-02 11:50:50,355 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,360 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,360 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'emailAuthenticator'<>
2018-11-02 11:50:50,360 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - 	 >> Load definition name=emailAuthenticator
2018-11-02 11:50:50,361 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(emailAuthenticator) in JsonLoader(paths=[/ioc])
2018-11-02 11:50:50,362 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:223) DEBUG - 	 >> Make...'emailAuthenticator'<>
2018-11-02 11:50:50,363 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:65) DEBUG - Save object 'emailAuthenticator' to [app] 
2018-11-02 11:50:50,363 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,363 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,365 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) DEBUG - Load class org.apache.commons.mail.DefaultAuthenticator without AOP
2018-11-02 11:50:50,365 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,365 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,367 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,368 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,371 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:50:50,372 com.chats.nutzbook.service.EmailServiceimpl.send(EmailServiceimpl.java:26) INFO  - 发送邮件失败java.lang.IllegalArgumentException: MimeMessage has not been created yet
2018-11-02 11:50:50,377 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [POST]URI=/chatsweb/user/profile/active/mail 167ms
2018-11-02 11:51:05,962 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 0 triggers
2018-11-02 11:51:31,161 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 0 triggers
2018-11-02 11:51:49,705 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/user/profile/active/mail : UserProfileModule.activeMail(UserProfileModule.java:140)
2018-11-02 11:51:49,705 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:51:49,707 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile  WHERE uid=?
    | 1 |
    |---|
    | 1 |
  For example:> "SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile  WHERE uid=1"
2018-11-02 11:51:49,710 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:49,710 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - 	 >> Load definition name=htmlEmail
2018-11-02 11:51:49,710 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(htmlEmail) in JsonLoader(paths=[/ioc])
2018-11-02 11:51:49,710 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:223) DEBUG - 	 >> Make...'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:49,711 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) DEBUG - Load class org.apache.commons.mail.ImageHtmlEmail without AOP
2018-11-02 11:51:49,711 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:49,712 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:49,712 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'emailAuthenticator'<>
2018-11-02 11:51:49,712 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:49,713 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:49,713 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:49,713 com.chats.nutzbook.service.EmailServiceimpl.send(EmailServiceimpl.java:26) INFO  - 发送邮件失败java.lang.IllegalArgumentException: MimeMessage has not been created yet
2018-11-02 11:51:49,714 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [POST]URI=/chatsweb/user/profile/active/mail 9ms
2018-11-02 11:51:52,653 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/user/profile/active/mail : UserProfileModule.activeMail(UserProfileModule.java:140)
2018-11-02 11:51:52,653 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:51:52,654 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile  WHERE uid=?
    | 1 |
    |---|
    | 1 |
  For example:> "SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile  WHERE uid=1"
2018-11-02 11:51:52,656 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:52,657 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - 	 >> Load definition name=htmlEmail
2018-11-02 11:51:52,657 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(htmlEmail) in JsonLoader(paths=[/ioc])
2018-11-02 11:51:52,657 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:223) DEBUG - 	 >> Make...'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:52,657 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) DEBUG - Load class org.apache.commons.mail.ImageHtmlEmail without AOP
2018-11-02 11:51:52,658 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:52,658 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:52,658 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'emailAuthenticator'<>
2018-11-02 11:51:52,658 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:52,659 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:52,659 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:52,659 com.chats.nutzbook.service.EmailServiceimpl.send(EmailServiceimpl.java:26) INFO  - 发送邮件失败java.lang.IllegalArgumentException: MimeMessage has not been created yet
2018-11-02 11:51:52,661 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [POST]URI=/chatsweb/user/profile/active/mail 8ms
2018-11-02 11:51:54,372 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/user/profile/active/mail : UserProfileModule.activeMail(UserProfileModule.java:140)
2018-11-02 11:51:54,373 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:51:54,374 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile  WHERE uid=?
    | 1 |
    |---|
    | 1 |
  For example:> "SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile  WHERE uid=1"
2018-11-02 11:51:54,375 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:54,376 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - 	 >> Load definition name=htmlEmail
2018-11-02 11:51:54,376 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(htmlEmail) in JsonLoader(paths=[/ioc])
2018-11-02 11:51:54,376 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:223) DEBUG - 	 >> Make...'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:54,376 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) DEBUG - Load class org.apache.commons.mail.ImageHtmlEmail without AOP
2018-11-02 11:51:54,376 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:54,377 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:54,377 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'emailAuthenticator'<>
2018-11-02 11:51:54,377 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:54,377 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:54,377 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:54,377 com.chats.nutzbook.service.EmailServiceimpl.send(EmailServiceimpl.java:26) INFO  - 发送邮件失败java.lang.IllegalArgumentException: MimeMessage has not been created yet
2018-11-02 11:51:54,379 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [POST]URI=/chatsweb/user/profile/active/mail 6ms
2018-11-02 11:51:56,162 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/user/profile/active/mail : UserProfileModule.activeMail(UserProfileModule.java:140)
2018-11-02 11:51:56,163 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 11:51:56,163 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile  WHERE uid=?
    | 1 |
    |---|
    | 1 |
  For example:> "SELECT uid,nickname,email,email_checked,gender,dt,loc,ct,ut FROM t_user_profile  WHERE uid=1"
2018-11-02 11:51:56,166 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:56,166 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:192) DEBUG - 	 >> Load definition name=htmlEmail
2018-11-02 11:51:56,166 org.nutz.ioc.loader.combo.ComboIocLoader.printFoundIocBean(ComboIocLoader.java:226) DEBUG - Found IocObject(htmlEmail) in JsonLoader(paths=[/ioc])
2018-11-02 11:51:56,166 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:223) DEBUG - 	 >> Make...'htmlEmail'<class org.apache.commons.mail.HtmlEmail>
2018-11-02 11:51:56,167 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:76) DEBUG - Load class org.apache.commons.mail.ImageHtmlEmail without AOP
2018-11-02 11:51:56,167 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:56,167 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:56,168 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'emailAuthenticator'<>
2018-11-02 11:51:56,168 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:56,168 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:56,168 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'conf'<>
2018-11-02 11:51:56,169 com.chats.nutzbook.service.EmailServiceimpl.send(EmailServiceimpl.java:26) INFO  - 发送邮件失败java.lang.IllegalArgumentException: MimeMessage has not been created yet
2018-11-02 11:51:56,170 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [POST]URI=/chatsweb/user/profile/active/mail 8ms
2018-11-02 11:51:56,604 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 0 triggers

18 回复

java.lang.IllegalArgumentException: MimeMessage has not been created yet

看上去是代码问题

来自炫酷的 NutzCN

package com.chats.nutzbook.module;

import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.sql.SQLException;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.DaoException;
import org.nutz.dao.FieldFilter;
import org.nutz.dao.util.Daos;
import org.nutz.img.Images;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.Mvcs;
import org.nutz.mvc.Scope;
import org.nutz.mvc.adaptor.JsonAdaptor;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Attr;
import org.nutz.mvc.annotation.By;
import org.nutz.mvc.annotation.Filters;
import org.nutz.mvc.annotation.GET;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.filter.CheckSession;
import org.nutz.mvc.impl.AdaptorErrorContext;
import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;

import com.chats.nutzbook.bean.UserProfile;
import com.chats.nutzbook.utils.Toolkit;
@IocBean
@At("/user/profile")
@Filters(@By(type=CheckSession.class,args= {"me","/"}))
public class UserProfileModule extends BaseModule {
	private static final Log log = Logs.get();
	 @At
	    public UserProfile get(@Attr(scope=Scope.SESSION, value="me")int userId) {
		 //增方法
	        UserProfile profile = Daos.ext(dao, FieldFilter.locked(UserProfile.class, "avatar")).fetch(UserProfile.class, userId);
	        if (profile == null) {
	            profile = new UserProfile();
	            profile.setUserId(userId);
	            profile.setCreateTime(new Date());
	            profile.setUpdateTime(new Date());
	            dao.insert(profile);
	        }
	        return profile;
	    }

	    @At
	    @AdaptBy(type=JsonAdaptor.class)
	    @Ok("void")
	    public void update(@Param("..")UserProfile profile, @Attr(scope=Scope.SESSION, value="me")int userId) {
	        if (profile == null)
	            return;
	        profile.setUserId(userId);//修正userId,防止恶意修改其他用户的信息
	        profile.setUpdateTime(new Date());
	        profile.setAvatar(null); // 不准通过这个方法更新
	        UserProfile old = get(userId);
	        // 检查email相关的更新
	        if (old.getEmail() == null) {
	            // 老的邮箱为null,所以新的肯定是未check的状态
	            profile.setEmailChecked(false);
	        } else {
	            if (profile.getEmail() == null) {
	                profile.setEmail(old.getEmail());
	                profile.setEmailChecked(old.isEmailChecked());
	            } else if (!profile.getEmail().equals(old.getEmail())) {
	                // 设置新邮箱,果断设置为未检查状态
	                profile.setEmailChecked(false);
	            } else {
	                profile.setEmailChecked(old.isEmailChecked());
	            }
	        }
	        Daos.ext(dao, FieldFilter.create(UserProfile.class, null, "avatar", true)).update(profile);
	    }
	    @AdaptBy(type=UploadAdaptor.class, args={"${app.root}/WEB-INF/tmp/user_avatar", "8192", "utf-8", "20000", "102400"})
	    @POST
	    @Ok(">>:/user/profile")
	    @At("/avatar")
	    public void uploadAvatar(@Param("file")TempFile tf,
	            @Attr(scope=Scope.SESSION, value="me")int userId,
	            AdaptorErrorContext err) {
	        String msg = null;
	        if (err != null && err.getAdaptorErr() != null) {
	            msg = "文件大小不符合规定";
	        } else if (tf == null) {
	            msg = "空文件";
	        } else {
	            UserProfile profile = get(userId);
	            try {
	                BufferedImage image = Images.read(tf.getFile());
	                image = Images.zoomScale(image, 128, 128, Color.WHITE);
	                ByteArrayOutputStream out = new ByteArrayOutputStream();
	                Images.writeJpeg(image, out, 0.8f);
	                profile.setAvatar(out.toByteArray());
	                dao.update(profile, "^avatar$");
	            } catch(DaoException e) {
	                log.info("System Error", e);
	                msg = "系统错误";
	            } catch (Throwable e) {
	                msg = "图片格式错误";
	            }
	        }

	        if (msg != null)
	            Mvcs.getHttpSession().setAttribute("upload-error-msg", msg);
	    }
	    @Ok("raw:jpg")
	    @At("/avatar")
	    @GET
	    public Object readAvatar(@Attr(scope=Scope.SESSION, value="me")int userId, HttpServletRequest req) throws SQLException {
	        UserProfile profile = Daos.ext(dao, FieldFilter.create(UserProfile.class, "^avatar$")).fetch(UserProfile.class, userId);
	        if (profile == null || profile.getAvatar() == null) {
	            return new File(req.getServletContext().getRealPath("/rs/user_avatar/none.jpg"));
	        }
	        return profile.getAvatar();
	    }
	    @At("/")
	    @GET
	    @Ok("jsp:jsp.user.profile")
	    public UserProfile index() {
			return null;	
	    }
	    @At("/active/mail/")
	    @POST
	    public Object activeMail (@Attr(scope=Scope.SESSION, value = "me")int id,HttpServletRequest req) {
	    	NutMap re=new NutMap();
	    	UserProfile file=get(id);
	    	if(Strings.isBlank(file.getEmail())) {
	    		return re.setv("ok",false).setv("msg", "请填写邮箱!");
	    	}
	    	String token=String.format("%s%s%s",id,file.getEmail(),System.currentTimeMillis());
	    	token=Toolkit._3DES_encode(emailKEY, token.getBytes());
	    	String url=req.getRequestURL()+"?token="+token;
	    	String html="<div>如果无法点击请拷贝到浏览器中打开</p>验证链接%s</div>";
	    	html=String.format(html, url,url);
	    	try {
	    	boolean ok=emailService.send(file.getEmail(), "验证邮件bychatsweb", html);
	    	if(!ok) {
	    		return re.setv("ok", false).setv("msg", "发送失败");
	    	}
	    	}catch(Throwable e) {
	    		log.info("发送失败");
	    	}
			return re.setv("ok", true);
	    }
	    @Filters
	    @At("/active/mail/")
	    @Ok("raw")
	    @GET
	    public String activemailcallback (@Param("token")String token,HttpSession session) {
			if(Strings.isBlank(token))return "链接不可访问";
			if(token.length()<10)return "非法token!";
			try {
				token=Toolkit._3DES_decode(emailKEY, Toolkit.hexstr2bytearray(token));
				if(null==token)return "非法的链接!";
				String []tmp=token.split(",");
				if (tmp.length != 3 || tmp[0].length() == 0 || tmp[1].length() == 0 || tmp[2].length() == 0)
	                return "非法token";
				long time=Long.parseLong(tmp[2]);
				if(System.currentTimeMillis()-time>10*60*1000) return "该验证链接已经过期";
				int userid=Integer.parseInt(tmp[0]);
				Cnd cnd=Cnd.where("usereId","=",userid).and("email","=",tmp[1]);
				int re=dao.update(UserProfile.class,Chain.make("emailChecked", true),cnd);
				if(re==1) {
					return "验证成功!";
				}
				return "验证失败,请重新验证";
			}catch(Throwable e) {
				log.info("检查token时候出错",e);
				return "非法的token";
			}
	    }
}

我是根据教程来的,不知道哪里出了错

addTo() returned	ImageHtmlEmail  (id=127)	
this	EmailServiceimpl  (id=117)	
to	"sxqzone@aliyun.com" (id=120)	
subject	"验证邮件bychatsweb" (id=125)	
html	"<div>如果无法点击请拷贝到浏览器中打开</p>验证链接http://localhost:8080/chatsweb/user/profile/active/mail?token=c700e2df146e647c92a8ca950e91c2e119e9936b3dad0fa2547c8f416034d26753f104faa2478635</div>" (id=126)	
email	ImageHtmlEmail  (id=127)	

log.info("发送失败", e); // 打印完整报错信息看看
  For example:> "SELECT avatar FROM t_user_profile  WHERE uid=1"
2018-11-02 13:17:31,366 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [ GET]URI=/chatsweb/user/profile/avatar 64ms
2018-11-02 13:17:32,619 org.nutz.mvc.impl.ActionInvoker.getActionChain(ActionInvoker.java:87) DEBUG - Path=[/user/profile/active/mail] available methods[GET] but request [POST], using the wrong http method?
2018-11-02 13:17:32,620 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) DEBUG - Search mapping for [POST] path=/user/profile/active/mail : NOT Action match
2018-11-02 13:17:35,406 org.nutz.mvc.impl.ActionInvoker.getActionChain(ActionInvoker.java:87) DEBUG - Path=[/user/profile/active/mail] available methods[GET] but request [POST], using the wrong http method?
2018-11-02 13:17:35,407 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) DEBUG - Search mapping for [POST] path=/user/profile/active/mail : NOT Action match
2018-11-02 13:17:35,867 org.nutz.mvc.impl.ActionInvoker.getActionChain(ActionInvoker.java:87) DEBUG - Path=[/user/profile/active/mail] available methods[GET] but request [POST], using the wrong http method?
2018-11-02 13:17:35,867 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) DEBUG - Search mapping for [POST] path=/user/profile/active/mail : NOT Action match
2018-11-02 13:17:36,077 org.nutz.mvc.impl.ActionInvoker.getActionChain(ActionInvoker.java:87) DEBUG - Path=[/user/profile/active/mail] available methods[GET] but request [POST], using the wrong http method?
2018-11-02 13:17:36,078 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) DEBUG - Search mapping for [POST] path=/user/profile/active/mail : NOT Action match
2018-11-02 13:17:36,270 org.nutz.mvc.impl.ActionInvoker.getActionChain(ActionInvoker.java:87) DEBUG - Path=[/user/profile/active/mail] available methods[GET] but request [POST], using the wrong http method?
2018-11-02 13:17:36,270 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) DEBUG - Search mapping for [POST] path=/user/profile/active/mail : NOT Action match
2018-11-02 13:17:45,304 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [GET] path=/user/profile/active/mail : UserProfileModule.activemailcallback(UserProfileModule.java:167)
2018-11-02 13:17:45,305 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 13:17:45,307 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [ GET]URI=/chatsweb/user/profile/active/mail 3ms
2018-11-02 13:17:55,160 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 0 triggers
2018-11-02 13:18:23,909 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 0 triggers
2018-11-02 13:18:24,663 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [GET] path=/user/profile/active/mail : UserProfileModule.activemailcallback(UserProfileModule.java:167)
2018-11-02 13:18:24,663 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) DEBUG - Get 'userProfileModule'<class com.chats.nutzbook.module.UserProfileModule>
2018-11-02 13:18:24,665 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [ GET]URI=/chatsweb/user/profile/active/mail 2ms
2018-11-02 13:18:27,506 org.nutz.mvc.impl.ActionInvoker.getActionChain(ActionInvoker.java:87) DEBUG - Path=[/user/profile/active/mail] available methods[GET] but request [POST], using the wrong http method?
2018-11-02 13:18:27,506 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) DEBUG - Search mapping for [POST] path=/user/profile/active/mail : NOT Action match
2018-11-02 13:18:50,976 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 0 triggers

    | 1 |
    |---|
    | 1 |
  For example:> "SELECT avatar FROM t_user_profile  WHERE uid=1"
2018-11-02 13:19:33,474 com.chats.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:22) DEBUG - [ GET]URI=/chatsweb/user/profile/avatar 3ms
2018-11-02 13:19:35,164 org.nutz.mvc.impl.ActionInvoker.getActionChain(ActionInvoker.java:87) DEBUG - Path=[/user/profile/active/mail] available methods[GET] but request [POST], using the wrong http method?
2018-11-02 13:19:35,164 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110) DEBUG - Search mapping for [POST] path=/user/profile/active/mail : NOT Action match
2018-11-02 13:19:43,207 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 0 triggers
 @At("/active/mail")
	    @POST
	    public Object activeMail(@Attr(scope=Scope.SESSION, value="me")int userId,
	            HttpServletRequest req) {
	        NutMap re = new NutMap();
	        UserProfile profile = get(userId);
	        if (Strings.isBlank(profile.getEmail())) {
	            return re.setv("ok", false).setv("msg", "你还没有填邮箱啊!");
	        }
	        String token = String.format("%s,%s,%s", userId, profile.getEmail(), System.currentTimeMillis());
	        token = Toolkit._3DES_encode(emailKEY, token.getBytes());
	        String url = req.getRequestURL() + "?token=" + token;
	        String html = "<div>如果无法点击,请拷贝一下链接到浏览器中打开<p/>验证链接 %s</div>";
	        html = String.format(html, url, url);
	        try {
	            boolean ok = emailService.send(profile.getEmail(), "XXX 验证邮件 by Nutzbook", html);
	            if (!ok) {
	                return re.setv("ok", false).setv("msg", "发送失败");
	            }
	        } catch (Throwable e) {
	            log.info("发送邮件失败", e);
	            return re.setv("ok", false).setv("msg", "发送失败");
	        }
	        return re.setv("ok", true);
	    }
	    @Filters
	    @At("/active/mail/")
	    @Ok("raw")
	    @GET
	    public String activemailcallback (@Param("token")String token,HttpSession session) {
			if(Strings.isBlank(token))return "链接不可访问";
			if(token.length()<10)return "非法token!";
			try {
				token=Toolkit._3DES_decode(emailKEY, Toolkit.hexstr2bytearray(token));
				if(null==token)return "非法的链接!";
				String []tmp=token.split(",");
				if (tmp.length != 3 || tmp[0].length() == 0 || tmp[1].length() == 0 || tmp[2].length() == 0)
	                return "非法token";
				long time=Long.parseLong(tmp[2]);
				if(System.currentTimeMillis()-time>10*60*1000) return "该验证链接已经过期";
				int userid=Integer.parseInt(tmp[0]);
				Cnd cnd=Cnd.where("usereId","=",userid).and("email","=",tmp[1]);
				int re=dao.update(UserProfile.class,Chain.make("emailChecked", true),cnd);
				if(re==1) {
					return "验证成功!";
				}
				return "验证失败,请重新验证";
			}catch(Throwable e) {
				log.info("检查token时候出错",e);
				return "非法的token";
			}
	    }

我看教程上试放在一个class里面的,profilemodel,这样子看来是请求出错了

不是,启动的时候会发个邮件,那个邮件发出去没?

来自炫酷的 NutzCN

那个发出去了

都是走emailService.send, 不应该有问题才对

我的知道了,

 try {
	            HtmlEmail email = ioc.get(HtmlEmail.class);
	            email.setSubject(subject);
	            //setmsg
	            email.setMsg(html);
	            email.addTo(to);//请务必改成您自己的邮箱啊!!!
	            email.buildMimeMessage();
	            email.sendMimeMessage();
	        } catch (Exception e) {
	        	log.info("发送邮件失败"+e);
	            e.printStackTrace();
	        }
		try {
			HtmlEmail email=ioc.get(HtmlEmail.class);
			email.setSubject(subject);
			//sethtmlmsg
			email.setHtmlMsg(html);
			email.addTo(to);	
			email.sendMimeMessage();
			return true;
		} catch (Exception e ) {
			
			return false;
		}

这个setmsg方法,我弄成了sethtmlmsg

你的教程上hisethtmlmsg,这个里面有bug

嗯? 版本差异?

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