使用james 3.0-beta4发送电子邮件时遇到一些问题:
我在用scala写作。当我做transport.send时发生错误。
Transport.send(message,externalRcpts.toArray(new Address [externalRcpts.size()]));
ERROR
james.domainlist - No domain found
javax.persistence.NoResultException: Query "SELECT domain FROM JamesDomain domain WHERE domain.name=:name" selected no result, but expected unique result.
at org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java:345) ~[openjpa-2.1.0.jar:2.1.0]
at org.apache.james.domainlist.jpa.JPADomainList.containsDomain(JPADomainList.java:100) ~[james-server-data-jpa-3.0-beta4.jar:3.0-beta4]
at org.apache.james.mailetcontainer.impl.JamesMailetContext.isLocalServer(JamesMailetContext.java:341) [james-server-mailetcontainer-camel-3.0-beta4.jar:3.0-beta4]
at org.apache.james.transport.matchers.HostIsLocal.matchRecipient(HostIsLocal.java:38) [apache-standard-mailets-1.1.jar:1.1]
at org.apache.mailet.base.GenericRecipientMatcher.match(GenericRecipientMatcher.java:54) [apache-mailet-base-1.1.jar:1.1]
at org.apache.james.mailetcontainer.impl.camel.MatcherSplitter.split(MatcherSplitter.java:87) [james-server-mailetcontainer-camel-3.0-beta4.jar:3.0-beta4]
at sun.reflect.GeneratedMethodAccessor111.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.6.0_26]
答案 0 :(得分:0)
该错误表示James无法解析目标域。如果您发送到@localhost或其他未知域,则可能会发生这种情况。试试这个: ./james-cli.sh -h localhost -p 9999 adddomain domain_name.com
无论如何,因为我记得这个错误没有阻止 - 消息仍然到达目的地。如果它在你的情况下阻塞尝试找到配置选项,使其不阻塞(我不知道该选项实际位于何处,但它应该具有非常直观的名称;-))。
祝你好运!