我的HtmlEmail源文件是BBSCS-8的代码改写而成:
当我用本文件的main测试时,邮件能够正确发送.但是当我部署到web上时变出现以下错误:
2007-11-02 14:52:55,953 [com.sclh.rsp.registercenter.service.sendmail.SendMailTi
merTask]-[ERROR] sendmail start .....
Hibernate: select oploggerad0_.ID as ID18_, oploggerad0_.MESSAGE as MESSAGE18_,
oploggerad0_.USERID as USERID18_, oploggerad0_.TYPE as TYPE18_, oploggerad0_.DBT
YPE as DBTYPE18_, oploggerad0_.REMOTEADDR as REMOTEADDR18_, oploggerad0_.ISLOOK
as ISLOOK18_, oploggerad0_.SYSTEMTIME as SYSTEMTIME18_, oploggerad0_.DELFLAG as
DELFLAG18_ from RSC.OPLOGGER_ADVICE oploggerad0_ where (delflag='0' ) order by
to_number(id)
Hibernate: select userinfo0_.ID as ID6_3_, userinfo0_.LOGINID as LOGINID6_3_, us
erinfo0_.PASSWORD as PASSWORD6_3_, userinfo0_.NAME as NAME6_3_, userinfo0_.RIGHT
ID as RIGHTID6_3_, userinfo0_.DEPARTID as DEPARTID6_3_, userinfo0_.SYSTEMTIME as
SYSTEMTIME6_3_, userinfo0_.DELFLAG as DELFLAG6_3_, userright1_.ID as ID10_0_, u
serright1_.NAME as NAME10_0_, userright1_.ALIAS as ALIAS10_0_, userright1_.COMM
as COMM10_0_, userright1_.SYSTEMTIME as SYSTEMTIME10_0_, userright1_.DELFLAG as
DELFLAG10_0_, departinfo2_.ID as ID0_1_, departinfo2_.NAME as NAME0_1_, departin
fo2_.URL as URL0_1_, departinfo2_.RELATIONSUMMARY1 as RELATION4_0_1_, departinfo
2_.RELATIONMAN1 as RELATION5_0_1_, departinfo2_.RELATIONTEL1 as RELATION6_0_1_,
departinfo2_.RELATIONEMAIL1 as RELATION7_0_1_, departinfo2_.RELATIONSUMMARY2 as
RELATION8_0_1_, departinfo2_.RELATIONMAN2 as RELATION9_0_1_, departinfo2_.RELATI
ONTEL2 as RELATIO10_0_1_, departinfo2_.RELATIONEMAIL2 as RELATIO11_0_1_, departi
nfo2_.ORGANTYPEID as ORGANTY12_0_1_, departinfo2_.SYSTEMTIME as SYSTEMTIME0_1_,
departinfo2_.DELFLAG as DELFLAG0_1_, organtype3_.ID as ID11_2_, organtype3_.NAME
as NAME11_2_, organtype3_.ALIAS as ALIAS11_2_, organtype3_.COMM as COMM11_2_, o
rgantype3_.SYSTEMTIME as SYSTEMTIME11_2_, organtype3_.DELFLAG as DELFLAG11_2_ fr
om RSC.USERINFO userinfo0_ left outer join RSC.USER_RIGHT userright1_ on userinf
o0_.RIGHTID=userright1_.ID left outer join RSC.DEPARTINFO departinfo2_ on userin
fo0_.DEPARTID=departinfo2_.ID left outer join RSC.ORGANTYPE organtype3_ on depar
tinfo2_.ORGANTYPEID=organtype3_.ID where userinfo0_.ID=?
Hibernate: select oploggerty0_.ID as ID19_0_, oploggerty0_.NAME as NAME19_0_, op
loggerty0_.ALIAS as ALIAS19_0_, oploggerty0_.COMM as COMM19_0_, oploggerty0_.SYS
TEMTIME as SYSTEMTIME19_0_, oploggerty0_.DELFLAG as DELFLAG19_0_ from RSC.OPLOGG
ER_TYPE oploggerty0_ where oploggerty0_.ID=?
Hibernate: select oploggerdb0_.ID as ID20_0_, oploggerdb0_.NAME as NAME20_0_, op
loggerdb0_.ALIAS as ALIAS20_0_, oploggerdb0_.COMM as COMM20_0_, oploggerdb0_.SYS
TEMTIME as SYSTEMTIME20_0_, oploggerdb0_.DELFLAG as DELFLAG20_0_ from RSC.OPLOGG
ER_DBTYPE oploggerdb0_ where oploggerdb0_.ID=?
Hibernate: select departloca0_.ID as ID17_, departloca0_.NAME as NAME17_, depart
loca0_.ORGANTYPEID as ORGANTYP3_17_, departloca0_.URL as URL17_, departloca0_.SY
STEMTIME as SYSTEMTIME17_, departloca0_.DELFLAG as DELFLAG17_ from RSC.DEPART_LO
CALHOST departloca0_ where (delflag='0' )
Hibernate: select departinfo0_.ID as ID0_1_, departinfo0_.NAME as NAME0_1_, depa
rtinfo0_.URL as URL0_1_, departinfo0_.RELATIONSUMMARY1 as RELATION4_0_1_, depart
info0_.RELATIONMAN1 as RELATION5_0_1_, departinfo0_.RELATIONTEL1 as RELATION6_0_
1_, departinfo0_.RELATIONEMAIL1 as RELATION7_0_1_, departinfo0_.RELATIONSUMMARY2
as RELATION8_0_1_, departinfo0_.RELATIONMAN2 as RELATION9_0_1_, departinfo0_.RE
LATIONTEL2 as RELATIO10_0_1_, departinfo0_.RELATIONEMAIL2 as RELATIO11_0_1_, dep
artinfo0_.ORGANTYPEID as ORGANTY12_0_1_, departinfo0_.SYSTEMTIME as SYSTEMTIME0_
1_, departinfo0_.DELFLAG as DELFLAG0_1_, organtype1_.ID as ID11_0_, organtype1_.
NAME as NAME11_0_, organtype1_.ALIAS as ALIAS11_0_, organtype1_.COMM as COMM11_0
_, organtype1_.SYSTEMTIME as SYSTEMTIME11_0_, organtype1_.DELFLAG as DELFLAG11_0
_ from RSC.DEPARTINFO departinfo0_ left outer join RSC.ORGANTYPE organtype1_ on
departinfo0_.ORGANTYPEID=organtype1_.ID where departinfo0_.ID=?
-------to:[email protected]
-------subject:--------异常日志警报文件
2007-11-02 14:52:56,218 [com.sclh.rsp.registercenter.service.sendmail.TemplateMa
il]-[ERROR] org.apache.commons.mail.EmailException: Sending the email to the fol
lowing server failed : smtp.163.com:25
org.apache.commons.mail.EmailException: Sending the email to the following serve
r failed : smtp.163.com:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:873)
at org.apache.commons.mail.Email.send(Email.java:898)
at com.sclh.rsp.registercenter.service.sendmail.TemplateMail.sendMailFro
mTemplate(TemplateMail.java:105)
at com.sclh.rsp.registercenter.service.sendmail.SendMailTimerTask.run(Se
ndMailTimerTask.java:66)
at java.util.TimerThread.mainLoop(Timer.java:432)
at java.util.TimerThread.run(Timer.java:382)
Caused by: javax.mail.NoSuchProviderException: smtp
at javax.mail.Session.getService(Session.java:611)
at javax.mail.Session.getTransport(Session.java:541)
at javax.mail.Session.getTransport(Session.java:484)
at javax.mail.Session.getTransport(Session.java:464)
at javax.mail.Session.getTransport(Session.java:519)
at javax.mail.Transport.send0(Transport.java:155)
at javax.mail.Transport.send(Transport.java:81)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:863)
... 5 more
-------to:[email protected]
-------subject:--------异常日志警报文件
2007-11-02 14:52:56,296 [com.sclh.rsp.registercenter.service.sendmail.TemplateMa
il]-[ERROR] org.apache.commons.mail.EmailException: Sending the email to the fol
lowing server failed : smtp.163.com:25
org.apache.commons.mail.EmailException: Sending the email to the following serve
r failed : smtp.163.com:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:873)
at org.apache.commons.mail.Email.send(Email.java:898)
at com.sclh.rsp.registercenter.service.sendmail.TemplateMail.sendMailFro
mTemplate(TemplateMail.java:105)
at com.sclh.rsp.registercenter.service.sendmail.SendMailTimerTask.run(Se
ndMailTimerTask.java:66)
at java.util.TimerThread.mainLoop(Timer.java:432)
at java.util.TimerThread.run(Timer.java:382)
Caused by: javax.mail.NoSuchProviderException: smtp
at javax.mail.Session.getService(Session.java:611)
at javax.mail.Session.getTransport(Session.java:541)
at javax.mail.Session.getTransport(Session.java:484)
at javax.mail.Session.getTransport(Session.java:464)
at javax.mail.Session.getTransport(Session.java:519)
at javax.mail.Transport.send0(Transport.java:155)
at javax.mail.Transport.send(Transport.java:81)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:863)
... 5 more
2007-11-02 14:52:56,296 [com.sclh.rsp.registercenter.service.sendmail.SendMailTi
merTask]-[ERROR] sendmail end .....
始终不明白为何会出现这种情况.main方法可以通过认证,而web方式为何就不可以呢?