解决代码混淆后出现javax.mail.nosuchproviderexception smtp的问题

solution:

added the following code in the proguard_project.txt  file

-keep class javax.mail.**{*;}
-keep class javax.mail.internet.**{*;}
-keep class org.apache.commons.mail.**{*;}

-keep class javamail.** {*;}
-keep class javax.mail.** {*;}
-keep class javax.activation.** {*;}
-keep class com.sun.mail.dsn.** {*;}
-keep class com.sun.mail.handlers.** {*;}
-keep class com.sun.mail.smtp.** {*;}
-keep class com.sun.mail.util.** {*;}
-keep class mailcap.** {*;}
-keep class mimetypes.** {*;}
-keep class myjava.awt.datatransfer.** {*;}
-keep class org.apache.harmony.awt.** {*;}
-keep class org.apache.harmony.misc.** {*;}


发送邮件失败javax.mail.NoSuchProviderException: smtp

07-04

我用Java应用程序发邮件,一切正常,放到tomcat里面就出现这个问题,网上说是mail.jar,和activation.jar版本的问题,我试了好多错误依旧。请大侠帮帮忙,谢谢了。rnrnjavax.mail.Message$RecipientType@1d5d765rnrnDEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]rnjava.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)rn at java.lang.reflect.Constructor.newInstance(Unknown Source)rn at javax.mail.Session.getService(Session.java:607)rn at javax.mail.Session.getTransport(Session.java:541)rn at javax.mail.Session.getTransport(Session.java:484)rn at javax.mail.Session.getTransport(Session.java:464)rn at org.wssm.easyGmail.SendGmail.sendMail(SendGmail.java:169)rn at org.wssm.easyGmail.SendGmail.doPost(SendGmail.java:118)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn at java.lang.Thread.run(Unknown Source)rnCaused by: java.lang.NoSuchMethodError: javax.mail.Session.getDebugOut()Ljava/io/PrintStream;rn at com.sun.mail.smtp.SMTPTransport.(SMTPTransport.java:112)rn at com.sun.mail.smtp.SMTPTransport.(SMTPTransport.java:97)rn ... 27 morern邮件发送失败! javax.mail.NoSuchProviderException: smtprnjavax.mail.Message$RecipientType@1d5d765rnrnDEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]rnjava.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)rn at java.lang.reflect.Constructor.newInstance(Unknown Source)rn at javax.mail.Session.getService(Session.java:607)rn at javax.mail.Session.getTransport(Session.java:541)rn at javax.mail.Session.getTransport(Session.java:484)rn at javax.mail.Session.getTransport(Session.java:464)rn at org.wssm.easyGmail.SendGmail.sendMail(SendGmail.java:169)rn at org.wssm.easyGmail.SendGmail.doPost(SendGmail.java:121)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn at java.lang.Thread.run(Unknown Source)rnCaused by: java.lang.NoSuchMethodError: javax.mail.Session.getDebugOut()Ljava/io/PrintStream;rn at com.sun.mail.smtp.SMTPTransport.(SMTPTransport.java:112)rn at com.sun.mail.smtp.SMTPTransport.(SMTPTransport.java:97)rn ... 27 morern邮件发送失败! javax.mail.NoSuchProviderException: smtp

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试

关闭