2015-09-27 09:35:07,058 [ThreadSafeServer]-[ERROR] INIT ThreadSafeServer :
java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:514)
at com.wifino1.server.email.EmailSender2.setParams(EmailSender2.java:84)
at com.wifino1.server.email.ThreadSafeServer.service(ThreadSafeServer.java:29)
at com.wifino1.utils.AppServerUtils.serverInit(AppServerUtils.java:173)
at com.wifino1.server.AppServer.startServer(AppServer.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.wifino1.bootstrap.Bootstrap.startAPP(Bootstrap.java:141)
at com.wifino1.bootstrap.Bootstrap.main(Bootstrap.java:81)
2015-09-27 09:35:07,074 [class com.wifino1.bootstrap.Bootstrap { APPServer} ]-[ERROR] Exception in thread "Timer-2"
2015-09-27 09:35:07,074 [class com.wifino1.bootstrap.Bootstrap { APPServer} ]-[ERROR] java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
2015-09-27 09:35:07,074 [class com.wifino1.bootstrap.Bootstrap { APPServer} ]-[ERROR] at com.wifino1.server.ShowMemoryServer.run(ShowMemoryServer.java:32)
2015-09-27 09:35:07,074 [class com.wifino1.bootstrap.Bootstrap { APPServer} ]-[ERROR] at java.util.TimerThread.mainLoop(Timer.java:555)
2015-09-27 09:35:07,076 [class com.wifino1.bootstrap.Bootstrap { APPServer} ]-[ERROR] at java.util.TimerThread.run(Timer.java:505)
2015-09-27 09:35:07,295 [class com.wifino1.bootstrap.Bootstrap { APPServer} ]-[ERROR] Start app APPServer fail!
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.wifino1.bootstrap.Bootstrap.startAPP(Bootstrap.java:141)
at com.wifino1.bootstrap.Bootstrap.main(Bootstrap.java:81)
Caused by: java.lang.NullPointerException
at com.cdy.connPool.MConnPool.<init>(MConnPool.java:49)
at com.wifino1.MServer.client.RecClient.start(RecClient.java:185)
at com.wifino1.Mserver.RecClientImpl.start(RecClientImpl.java:135)
at com.wifino1.server.AppServer.startServer(AppServer.java:97)
... 6 more
props.put("mail.smtp.host", HOST);//HOST的值是"smtp.163.com"
追答应该是HOST为空,HOST这个变量是如何获取的?从properties中读出来的吗?是否classpath不对?
以下是hashtable的put方法源码,看抛出的行数应该是value为空。
public synchronized V put(K key, V value) {
// Make sure the value is not null
if (value == null) {
throw new NullPointerException();
}
props.put("mail.smtp.host", HOST);//HOST的值是"smtp.163.com"