我已经按照JNDI Web - JNDI Resources HOW-TO进行了操作,但是在邮件/会话中仍然出现了一个no valid JBoss binding错误。以下是相关文件中的条目。web应用程序名称为goDog。jboss-web.xml:
<jboss-web>
<context-root>goDog</context-root>
</jboss-web>WEB-INF/web.xml代码片段:
<resource-ref>
<description>
Resource reference to a factory for javax.mail.Session
instances that may be used for sending electronic mail
messages, preconfigured to connect to the appropriate
SMTP server.
</description>
<res-ref-name>
mail/Session
</res-ref-name>
<res-type>
javax.mail.Session
</res-type>
<res-auth>
Container
</res-auth>
</resource-ref>META-INF/context.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Resource name="mail/Session" auth="Container" type="javax.mail.Session" mail.smtp.host="<themailserver>" />
</Context>感谢您的指导。最后的毛刺粘在我的袜子上才能成功部署。
发布于 2015-11-24 01:28:45
我已经确定了JBoss (4.2,是的,我知道,非常旧) JNDI Mail资源配置的解决方案。下面是解决方案。1. \WEB-INF/web.xml中的resource-ref(erence)条目:
<resource-ref>
<description>
Resource reference to a factory for javax.mail.Session
instances that may be used for sending electronic mail
messages, preconfigured to connect to the appropriate
SMTP server.
</description>
<res-ref-name>mail/Session</res-ref-name>
<res-type>javax.mail.Session</res-type>
<res-auth>Container</res-auth>
</resource-ref>mail/Session java:/Mail
java:/Mail nobody password jboss:service=Naminghttps://stackoverflow.com/questions/33828621
复制相似问题