java - how to change Socket read timeout? -
i use javamail api there:
properties prop = new properties(); prop.put("mail.smtp.starttls.enable","true"); prop.put("mail.smtp.auth", "true"); prop.put("mail.smtp.connectiontimeout", "2000"); session session = session.getinstance(prop, null); transport transport = session.gettransport("smtp"); transport.connect()
i don't use socket
object directly how can change socket read timeout ?
stacktrace:
org.apache.geronimo.javamail.transport.smtp.smtpconnection.receiveline(smtpconnection.java:760) org.apache.geronimo.javamail.transport.smtp.smtpconnection.receiveline(smtpconnection.java:682) org.apache.geronimo.javamail.transport.smtp.smtpconnection.getreply(smtpconnection.java:692) org.apache.geronimo.javamail.transport.smtp.smtpconnection.getwelcome(smtpconnection.java:448) org.apache.geronimo.javamail.transport.smtp.smtpconnection.protocolconnect(smtpconnection.java:143) org.apache.geronimo.javamail.transport.smtp.smtptransport.protocolconnect(smtptransport.java:165) javax.mail.service.connect(service.java:274) controller.registercontroller.isauthorized(registercontroller.java:132) controller.registercontroller.register(registercontroller.java:102) sun.reflect.nativemethodaccessorimpl.invoke0(native method) sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) java.lang.reflect.method.invoke(method.java:606) org.apache.el.parser.astvalue.invoke(astvalue.java:278) org.apache.el.methodexpressionimpl.invoke(methodexpressionimpl.java:274) org.apache.myfaces.view.facelets.el.contextawaretagmethodexpression.invoke(contextawaretagmethodexpression.java:96) org.apache.myfaces.application.actionlistenerimpl.processaction(actionlistenerimpl.java:68) javax.faces.component.uicommand.broadcast(uicommand.java:120) javax.faces.component.uiviewroot._broadcastall(uiviewroot.java:1028) javax.faces.component.uiviewroot.broadcastevents(uiviewroot.java:286) javax.faces.component.uiviewroot._process(uiviewroot.java:1375) javax.faces.component.uiviewroot.processapplication(uiviewroot.java:752) org.apache.myfaces.lifecycle.invokeapplicationexecutor.execute(invokeapplicationexecutor.java:38) org.apache.myfaces.lifecycle.lifecycleimpl.executephase(lifecycleimpl.java:170) org.apache.myfaces.lifecycle.lifecycleimpl.execute(lifecycleimpl.java:117) javax.faces.webapp.facesservlet.service(facesservlet.java:197) org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:305) org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210) org.primefaces.webapp.filter.fileuploadfilter.dofilter(fileuploadfilter.java:98) org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:243) org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210) org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:222) org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:123) org.apache.tomee.catalina.openejbvalve.invoke(openejbvalve.java:45) org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:472) org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:171) org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:99) org.apache.catalina.valves.accesslogvalve.invoke(accesslogvalve.java:936) org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:118) org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:407) org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1004) org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:589) org.apache.tomcat.util.net.jioendpoint$socketprocessor.run(jioendpoint.java:312) java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) java.lang.thread.run(thread.java:724)
set mail.smtp.timeout property. see javadocs com.sun.mail.smtp package.
Comments
Post a Comment