gpt4 book ai didi

java - Apache Camel 邮件错误

转载 作者:行者123 更新时间:2023-12-02 06:08:30 25 4
gpt4 key购买 nike

从 apache Camel 访问 gmail 时遇到此错误

 [org.apache.camel.component.mail.MailConsumer] (Camel (camel-1) thread #1 - imaps://imap.gmail.com:993) Consumer Consumer[imaps://imap.gmail.com:993?consumer.delay=120000&delete=false&password=*****&unseen=true&username=abcdef%40gmail.com] failed polling endpoint: Endpoint[imaps://imap.gmail.com:993?consumer.delay=120000&delete=false&password=******&unseen=true&username=abcdef%40gmail.com]. Will try again at next poll. Caused by: [javax.mail.MessagingException - Connection timed out: connect]: javax.mail.MessagingException: Connection timed out: connect;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:670) [mail-1.4.5-redhat-1.jar:1.4.5-redhat-1]
at javax.mail.Service.connect(Service.java:295) [mail-1.4.5-redhat-1.jar:1.4.5-redhat-1]
at org.apache.camel.component.mail.MailConsumer.ensureIsConnected(MailConsumer.java:376) [camel-mail-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:82) [camel-mail-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:142) [camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92) [camel-core-2.10.0.redhat-60024.jar:2.10.0.redhat-60024]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_51]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) [rt.jar:1.7.0_51]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) [rt.jar:1.7.0_51]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [rt.jar:1.7.0_51]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method) [rt.jar:1.7.0_51]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) [rt.jar:1.7.0_51]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) [rt.jar:1.7.0_51]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) [rt.jar:1.7.0_51]
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) [rt.jar:1.7.0_51]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) [rt.jar:1.7.0_51]
at java.net.Socket.connect(Socket.java:579) [rt.jar:1.7.0_51]
at java.net.Socket.connect(Socket.java:528) [rt.jar:1.7.0_51]
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:319) [mail-1.4.5-redhat-1.jar:1.4.5-redhat-1]
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:233) [mail-1.4.5-redhat-1.jar:1.4.5-redhat-1]
at com.sun.mail.iap.Protocol.<init>(Protocol.java:113) [mail-1.4.5-redhat-1.jar:1.4.5-redhat-1]
at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:111) [mail-1.4.5-redhat-1.jar:1.4.5-redhat-1]
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:637) [mail-1.4.5-redhat-1.jar:1.4.5-redhat-1]
... 12 more

最佳答案

删除端口号

imaps://imap.gmail.com?consumer.delay=120000&delete=false&password=*&unseen=true&username=abcdef%40gmail.com

然后再试一次。以后请贴出你的代码,以及错误信息。

关于java - Apache Camel 邮件错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22097083/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com