【问题标题】:jboss JNDI setup failure - no valid JNDI bindingjboss JNDI 设置失败 - 没有有效的 JNDI 绑定
【发布时间】:2016-02-23 01:19:35
【问题描述】:

我已遵循 JBoss Web - JNDI 资源 HOW-TO,但在邮件/会话上仍然收到无效的 JNDI 绑定错误。以下是相关文件中的条目。 网络应用程序名称是 goDog。 jboss-web.xml:

 <jboss-web>
          <context-root>goDog</context-root>
    </jboss-web>

WEB-INF/web.xml sn-p:

<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>

感谢任何指导。 最后一个毛刺卡在我的袜子上以成功部署。

【问题讨论】:

    标签: jboss jndi context.xml


    【解决方案1】:

    我已经确定了 JBoss(4.2,是的,我知道,很旧)JNDI 邮件资源配置的分辨率。 下面是分辨率。 1. \WEB-INF/web.xml 中的资源引用(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>
    
    1. JBoss 中间文件 \WEB-INF/jboss-web.xml 中的一个条目,用于将 web.xml 资源引用(erence)连接到 JNDI JBoss 邮件服务:

      邮件/会话 java:/邮件

    2. JBoss 邮件资源文件 server\\deploy\mail_service.xml(mail.smtp.host 属性)的更新:

      java:/邮件 没有人 密码 jboss:service=命名

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-06-25
      • 1970-01-01
      • 1970-01-01
      • 2013-11-24
      • 2023-03-06
      • 2014-11-06
      • 1970-01-01
      • 2011-11-11
      相关资源
      最近更新 更多