我正在将Wildfli10.0.1.0的应用程序移植到极富活力的2017.7.0群中。
除了使用YAML的SMTP电子邮件配置之外,一切都进行得相当顺利:
我尝试了一些替代方案,但这是基于我认为yaml将来自standalone.xml映射- project-defaults.yml的最新一个。
swarm:
socket-binding-groups:
mail-socket:
outbound-socket-bindings:
mail-smtp:
remote-host: smtp.someprovider.com
remote-port: 587
mail:
mail-sessions:
smtpSession:
jndi-name: java:/smtpSession
smtp-server:
username: username_here
password: password_here
tls: true
outbound-socket-binding-ref: mail-smtp然而,我仍然会出错:
2017-08-05 11:17:36,100 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "mail"),
("mail-session" => "smtpSession")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.outbound-socket-binding.mail-smtp"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.mail-session.smtpSession is missing [jboss.outbound-socket-binding.mail-smtp]"]
}
2017-08-05 11:17:36,155 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.outbound-socket-binding.mail-smtp (missing) dependents: [service jboss.mail-session.smtpSession] 2017年8月7日编辑?
按照Ladicek的建议,我尝试过这样做:
swarm:
socket-binding-groups:
standard-sockets:
mail-socket:
outbound-socket-bindings:
mail-smtp:
remote-host: smtp.someprovider.com
remote-port: 587和
swarm:
socket-binding-groups:
standard-sockets:
outbound-socket-bindings:
mail-smtp:
remote-host: smtp.someprovider.com
remote-port: 587和
swarm:
socket-binding-groups:
standard-socket:
outbound-socket-bindings:
mail-smtp:
remote-host: smtp.someprovider.com
remote-port: 587但是既不工作,也有同样的错误。
有人能帮忙吗?
需要升级到2017.8.1并使用以下配置
network:
socket-binding-groups:
standard-sockets:
outbound-socket-bindings:
mail-smtp:
remote-host: smtp.someprovider.com
remote-port: 587谢谢。
发布于 2017-08-07 08:16:38
终于解决了:
需要升级到2017.8.1并使用以下配置
network:
socket-binding-groups:
standard-sockets:
outbound-socket-bindings:
mail-smtp:
remote-host: smtp.someprovider.com
remote-port: 587谢谢。
发布于 2017-08-05 07:40:46
从我的头脑中,我相信有一个级别的YAML结构是缺失的:您需要选择将套接字绑定添加到其中的套接字绑定组。这是WildFly的托管域的一个工件,这是一个不适用于群的概念,但有时您会碰到它。在独立的WildFly中只有一个套接字绑定组,因此在群中只有一个套接字绑定组:standard-sockets。
所以YAML看起来就像:
swarm:
socket-binding-groups:
standard-sockets:
mail-socket:
...关于群集YAML结构的任何类型的问题,请参阅https://reference.wildfly-swarm.io
发布于 2017-08-24 17:51:37
这对我有用。
yml档案:
swarm:
mail:
mail-sessions:
mail-socket:
jndi-name: java:/mail/NGSoftMail
smtp-server:
username: sigafco@xxxmail.com.co
password: *****
outbound-socket-binding-ref: mail-smtp
debug: true
from: sigafco@xxxmail.com.co
network:
socket-binding-groups:
standard-sockets:
outbound-socket-bindings:
mail-smtp:
remote-host: xxxmail.com.co
remote-port: 25java文件:
@ApplicationScoped
@Path("mailsender")
public class MailSender {
@Resource(mappedName = "java:/mail/NGSoftMail")
private Session session;
@GET
@Path("mail")
public String sendGet() throws Exception {
Message message = new MimeMessage(session);
message.setFrom();
message.setRecipients(Message.RecipientType.TO, InternetAddress.parse("david.vasquez@xxx.com.co", false));
message.setSubject("asunto!!!");
message.setSentDate(new Date());
message.setContent("contenido!!!", "text/html; charset=UTF-8");
Transport.send(message);
return String.format("{\"your_mail\": \"%s\"}", "OK");
}
}pom档案:
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>mail</artifactId>
</dependency>https://stackoverflow.com/questions/45518234
复制相似问题