Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-23546

NameNotFoundException thrown if whitespace entered in JNDI

    XMLWordPrintable

Details

    Description

      when user configures JNDI SMTP configuration and enters extra space characters in the JNDI location, our application accepts it but throws an error while sending email.
      Steps:

      1. Navigate to mail servers from admin and configure SMTP mail server using JNDI location
      2. Enter JNDI Location and enter some white spaces in the location field.
      3. Attempt to send test email and also click on SMTP log level details check box and than exception will be thrown out like:
       An error has occurred with sending the test email:
      com.atlassian.mail.MailException: javax.naming.NameNotFoundException: Name  java: comp is not bound in this Context
      	at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:187)
      	at com.atlassian.jira.web.action.admin.mail.SendTestMail.doExecute(SendTestMail.java:91)
      	at webwork.action.ActionSupport.execute(ActionSupport.java:165)
      	at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:54)
      	at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:139)
      	at com.atlassian.jira.web.dispatcher.JiraWebworkActionDispatcher.service(JiraWebworkActionDispatcher.java:168)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      	...
      Caused by: javax.naming.NameNotFoundException: Name  java: comp is not bound in this Context
      	at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
      	at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
      	at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
      	at javax.naming.InitialContext.lookup(InitialContext.java:392)
      	at com.atlassian.mail.server.impl.SMTPMailServerImpl.getJndiSession(SMTPMailServerImpl.java:161)
      	at com.atlassian.mail.server.impl.SMTPMailServerImpl.getSession(SMTPMailServerImpl.java:110)
      	at com.atlassian.mail.server.impl.SMTPMailServerImpl.send(SMTPMailServerImpl.java:169)
      	... 110 more 

      Attachments

        Activity

          People

            pleschev Peter Leschev
            vsiyawat Vikram Singh Siyawat [Atlassian]
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: