3 Replies Latest reply on Oct 27, 2005 6:35 PM by Andrew Iggleden

    Mail not bound error

    Andrew Iggleden Newbie

      hi

      when trying to get the session to be able to send an email from a bean i am told that mail is not bound.

      I have a mail-service.xml in the deply folder

      <!DOCTYPE server>
      <server>
       <mbean code="org.jboss.mail.MailService"
       name="jboss:service=mail/JFrMail">
       <attribute name="JNDIName">java:/mail/JFrMail</attribute>
       <!--
       Use these if your outgoing server requires authentication
       <attribute name="User">nobody</attribute>
       <attribute name="Password">password</attribute>
       -->
       <attribute name="Configuration">
       <configuration>
       <property name="mail.transport.protocol" value="smtp"/>
       <property name="mail.smtp.host" value="mail.dummy.com"/>
       <property name="mail.from" value="noreply@dummy.com"/>
       <property name="mail.debug" value="false"/>
       </configuration>
       </attribute>
       </mbean>
      </server>


      to get the session I do the following :


      mailsession = (Session) ctx.lookup("java:/mail/JFrMail");


      and i get the following when Jboss delpoys the xml
      07:21:06,437 INFO [MailService] Mail Service bound to java:/mail/JFrMail


      my jndi.properties :
      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      java.naming.provider.url=localhost


      and i'm using jboss 4.0.3

      i've missed something but after a lot of googling I can't see what

      thanks
      Andrew

        • 1. Re: Mail not bound error
          Aaron Novice

          Post back with your stacktrace (if any), along with the log information from server.log during your access of the mail service.

          • 2. Re: Mail not bound error
            Andrew Iggleden Newbie

            my apologies...

            Exception in thread "main" javax.naming.NameNotFoundException: mail not bound
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:514)
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:522)
            at org.jnp.server.NamingServer.getObject(NamingServer.java:528)
            at org.jnp.server.NamingServer.lookup(NamingServer.java:252)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
            at sun.rmi.transport.Transport$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Unknown Source)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)
            at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
            at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
            at sun.rmi.server.UnicastRef.invoke(Unknown Source)
            at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
            at javax.naming.InitialContext.lookup(Unknown Source)
            at client.XMLClient.LoadContext(XMLClient.java:136)
            at client.XMLClient.main(XMLClient.java:62)


            there is nothing in server.log about mail but the following is displayed on the Eclipse console when I changed debug to true

            00:11:12,890 INFO [MailService] Mail service 'java:/mail/JFrMail' removed from JNDI
            00:11:13,109 INFO [STDOUT] DEBUG: JavaMail version 1.3.1
            00:11:13,109 INFO [STDOUT] DEBUG: java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_02\lib\javamail.providers (The system cannot find the file specified)
            00:11:13,156 INFO [STDOUT] DEBUG: !anyLoaded
            00:11:13,156 INFO [STDOUT] DEBUG: not loading resource: /META-INF/javamail.providers
            00:11:13,171 INFO [STDOUT] DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
            00:11:13,171 INFO [STDOUT] DEBUG: Tables of loaded providers
            00:11:13,171 INFO [STDOUT] DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
            00:11:13,171 INFO [STDOUT] DEBUG: Providers Listed By Protocol: {imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
            00:11:13,187 INFO [STDOUT] DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
            00:11:13,187 INFO [STDOUT] DEBUG: !anyLoaded
            00:11:13,203 INFO [STDOUT] DEBUG: not loading resource: /META-INF/javamail.address.map
            00:11:13,203 INFO [STDOUT] DEBUG: java.io.FileNotFoundException: C:\Program Files\Java\jre1.5.0_02\lib\javamail.address.map (The system cannot find the file specified)
            00:11:13,203 INFO [MailService] Mail Service bound to java:/mail/JFrMail


            • 3. Re: Mail not bound error
              Andrew Iggleden Newbie

              I am really stuck, I cannot find a resolution. Any ideas would be appreciated.

              thanks