Ganib(Java)-无法发送验证电子邮件

时间:2018-07-14 01:26:01

标签: java tomcat

我有一个在Ubuntu 16.04上运行的VPS服务器。 Tomcat正在运行Ganib软件(Java)。尝试注册时,我得到了一个非常糟糕的日志:

=========== checking limit ==========
Payment plan property toke not enaled
Is Valid 1
DEBUG: JavaMail version 1.4.4
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.ma$
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystem$
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
Exception while sending mail: java.lang.NullPointerException

这是我在tomcat中的config.xml文件:

<Resource name="mail/GanibSession"
auth="Container"
type="javax.mail.Session"
mail.smtp.host="smtp.gmail.com"
mail.smtp.port="465"
mail.smtp.auth="true"
mail.smtp.user="xxx@gmail.com"
password="xxx"
mail.smtp.starttls.enable="true"
mail.debug="true"
mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
/>

我该如何调试?我对Java不熟悉。

编辑:刚刚找到了堆栈跟踪!

java.lang.NullPointerException
at sun.util.calendar.ZoneInfoFile.getZoneIDs(ZoneInfoFile.java:790)
at sun.util.calendar.ZoneInfo.getAvailableIDs(ZoneInfo.java:601)
at java.util.TimeZone.getAvailableIDs(TimeZone.java:586)
at org.apache.jsp.newregistration.registerUserProcessing_jsp._jspService(registerUserProcessing_jsp.java:398)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
... omitted for brevity

1 个答案:

答案 0 :(得分:0)

找到堆栈跟踪信息后(这是在开发人员工具的“网络”选项卡中找到的,然后在“响应”选项卡中找到了),我在此线程中找到了答案:

NullPointerException when calling TimeZone.getAvailableIDs()

我停止了tomcat,运行了以下命令,然后再次启动它:

sudo apt-add-repository ppa:justinludwig/tzdata
sudo apt-get update
sudo apt-get install tzdata-java