[jboss-user] [JBoss Seam] - Recieving Mail with Seam

mokua_ombati do-not-reply at jboss.com
Tue Aug 7 02:22:45 EDT 2007


Hallo,
I have been trying to create a component for recieving email.
BTW,the component for sending mail is working quite nicely.

The problem is my component is not able to receive the mails and from the logs i get :


  | 2007-08-07 08:58:52,375 INFO  [STDOUT] DEBUG: JavaMail version 1.4ea
  | 2007-08-07 08:58:52,484 INFO  [STDOUT] DEBUG: java.io.FileNotFoundException: C:\Program Files\Java\jre1.6.0_01\lib\javamail.providers (The system cannot find the file specified)
  | 2007-08-07 08:58:52,484 INFO  [STDOUT] DEBUG: !anyLoaded
  | 2007-08-07 08:58:52,500 INFO  [STDOUT] DEBUG: not loading resource: /META-INF/javamail.providers
  | 2007-08-07 08:58:52,515 INFO  [STDOUT] DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
  | 2007-08-07 08:58:52,515 INFO  [STDOUT] DEBUG: Tables of loaded providers
  | 2007-08-07 08:58:52,531 INFO  [STDOUT] DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,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]}
  | 2007-08-07 08:58:52,531 INFO  [STDOUT] DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
  | 2007-08-07 08:58:52,531 INFO  [STDOUT] DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
  | 2007-08-07 08:58:52,546 INFO  [STDOUT] DEBUG: !anyLoaded
  | 2007-08-07 08:58:52,546 INFO  [STDOUT] DEBUG: not loading resource: /META-INF/javamail.address.map
  | 2007-08-07 08:58:52,546 INFO  [STDOUT] DEBUG: java.io.FileNotFoundException: C:\Program Files\Java\jre1.6.0_01\lib\javamail.address.map (The system cannot find the file specified)
  | 2007-08-07 08:58:52,546 INFO  [STDOUT] DEBUG: setDebug: JavaMail version 1.4ea
  | 2007-08-07 08:58:52,546 INFO  [STDOUT] DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]
  | 2007-08-07 08:58:52,562 INFO  [STDOUT] DEBUG POP3: connecting to host "localhost", port 110, isSSL false
  | 2007-08-07 08:58:53,781 ERROR [org.jboss.resource.adapter.mail.inflow.MailActivation] Failed to execute folder check, spec=MailActivationSpec(mailServer=localhost, storeProtocol=pop3, mailFolder=INBOX, pollingInterval=60000, messageSelector=null, userName=myname, maxMessages=1, debug=true)
  | 2007-08-07 08:59:54,421 INFO  [STDOUT] DEBUG: JavaMail version 1.4ea
  | 2007-08-07 08:59:54,750 INFO  [STDOUT] DEBUG: java.io.FileNotFoundException: C:\Program Files\Java\jre1.6.0_01\lib\javamail.providers (The system cannot find the file specified)
  | 2007-08-07 08:59:54,750 INFO  [STDOUT] DEBUG: !anyLoaded
  | 2007-08-07 08:59:54,750 INFO  [STDOUT] DEBUG: not loading resource: /META-INF/javamail.providers
  | 2007-08-07 08:59:54,750 INFO  [STDOUT] DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
  | 2007-08-07 08:59:54,750 INFO  [STDOUT] DEBUG: Tables of loaded providers
  | 2007-08-07 08:59:54,750 INFO  [STDOUT] DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,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]}
  | 2007-08-07 08:59:54,750 INFO  [STDOUT] DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
  | 2007-08-07 08:59:54,750 INFO  [STDOUT] DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
  | 2007-08-07 08:59:54,750 INFO  [STDOUT] DEBUG: !anyLoaded
  | 2007-08-07 08:59:54,750 INFO  [STDOUT] DEBUG: not loading resource: /META-INF/javamail.address.map
  | 2007-08-07 08:59:54,750 INFO  [STDOUT] DEBUG: java.io.FileNotFoundException: C:\Program Files\Java\jre1.6.0_01\lib\javamail.address.map (The system cannot find the file specified)
  | 2007-08-07 08:59:54,750 INFO  [STDOUT] DEBUG: setDebug: JavaMail version 1.4ea
  | 2007-08-07 08:59:54,750 INFO  [STDOUT] DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]
  | 2007-08-07 08:59:54,750 INFO  [STDOUT] DEBUG POP3: connecting to host "localhost", port 110, isSSL false
  | 2007-08-07 08:59:55,812 ERROR [org.jboss.resource.adapter.mail.inflow.MailActivation] Failed to execute folder check, spec=MailActivationSpec(mailServer=localhost, storeProtocol=pop3, mailFolder=INBOX, pollingInterval=60000, messageSelector=null, userName=myname, maxMessages=1, debug=true)
  | 
  | 


The Mail Receiver is below:

  | package com.triad.sessionBeans.student;
  | 
  | import org.jboss.annotation.ejb.ResourceAdapter;
  | import org.jboss.resource.adapter.mail.inflow.MailListener;
  | import org.jboss.seam.annotations.Logger;
  | import org.jboss.seam.annotations.Name;
  | import org.jboss.seam.log.Log;
  | 
  | import javax.ejb.ActivationConfigProperty;
  | import javax.ejb.MessageDriven;
  | import javax.mail.Message;
  | import javax.mail.MessagingException;
  | 
  | 
  | @MessageDriven(activationConfig={
  |         @ActivationConfigProperty(propertyName="mailServer", propertyValue="localhost"),
  |         @ActivationConfigProperty(propertyName="mailFolder", propertyValue="INBOX"),
  |         @ActivationConfigProperty(propertyName="storeProtocol", propertyValue="pop3"),
  |         @ActivationConfigProperty(propertyName="userName", propertyValue="myname"),
  |         @ActivationConfigProperty(propertyName="password", propertyValue="mypass"),
  |         @ActivationConfigProperty(propertyName = "debug", propertyValue = "true"),
  | 		@ActivationConfigProperty(propertyName = "flush", propertyValue = "true")
  | })
  | @ResourceAdapter("mail-ra.rar")
  | @Name("mailListener")
  | public  class MailRecieverMDB implements MailListener {
  | 
  | 	@Logger
  | 	private Log log;
  | 	public void onMessage(Message message) {
  | 	      // Process the message
  | 		
  | 	      try {
  | 			log.info("The msg has been recieveed #0",message.getSubject());
  | 		} catch (MessagingException e) {
  | 			// TODO Auto-generated catch block
  | 			e.printStackTrace();
  | 		}
  | 	   }
  | 	   
  | }
  | 


The components.xml :

  | <?xml version="1.0" encoding="UTF-8"?>
  | <components xmlns="http://jboss.com/products/seam/components"
  |             xmlns:core="http://jboss.com/products/seam/core"
  |             xmlns:drools="http://jboss.com/products/seam/drools"
  |             xmlns:security="http://jboss.com/products/seam/security"
  |             xmlns:mail="http://jboss.com/products/seam/mail"
  |             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  |             xmlns:pdf="http://jboss.com/products/seam/pdf"
  |             xsi:schemaLocation=
  |                 "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.2.xsd 
  |                  http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-1.2.xsd
  |                  http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.2.xsd
  |                  http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-1.2.xsd
  |                  http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.2.xsd">
  | 
  |    <core:init debug="true" jndi-pattern="@jndiPattern@"/>
  |      
  |    <core:manager concurrent-request-timeout="500" 
  |                  conversation-timeout="120000" 
  |                  conversation-id-parameter="cid" 
  |                  conversation-is-long-running-parameter="clr"/>
  |                  
  |    <pdf:documentStore useExtensions="true" errorPage="/pdfMissing.seam" />
  | 
  |    <component class="org.jboss.seam.web.MultipartFilter">
  |       <property name="createTempFiles">true</property>
  |       <!-- <property name="maxRequestSize">5000000000</property> -->
  |   	</component>
  |     
  |    <core:managed-persistence-context name="entityManager"
  |                               auto-create="true"
  |                persistence-unit-jndi-name="java:/E-AssessmentEntityManagerFactory"/>
  | 
  |    <core:ejb installed="@embeddedEjb@"/>
  |    
  |    <core:dispatcher />
  |    
  |    <drools:rule-base name="securityRules">
  |        <drools:rule-files>
  |            <value>/security.drl</value>
  |        </drools:rule-files>
  |    </drools:rule-base>
  | 
  |    <security:identity authenticate-method="#{authenticator.authenticate}"
  |                            security-rules="#{securityRules}"/>
  |    
  |    <event type="org.jboss.seam.notLoggedIn">
  |        <action expression="#{redirect.captureCurrentView}"/>
  |    </event>
  |    <event type="org.jboss.seam.postAuthenticate">
  |        <action expression="#{redirect.returnToCapturedView}"/>
  |    </event>
  |    
  |    <mail:mail-session host="localhost" port="2525" username="myname" password="mypass"  />
  |    
  |    
  |    <mail:meldware>
  |         <mail:users>
  |             <value>#{myname}</value>
  |             <value>#{root}</value>
  | 	    </mail:users>
  |     </mail:meldware>
  |     
  |    	<mail:meldware-user name="myname" username="mypass" password="mypass">
  |    	    <mail:aliases>
  |    	        <value>mymail at gmail.com</value>
  |    	        <value>mymail at yahoo.com</value>
  |    	    </mail:aliases>
  |    	 </mail:meldware-user>
  |    	<mail:meldware-user name="root" username="root" password="root" administrator="true" /> 
  |         
  |    <!-- For use with jBPM pageflow or process management -->
  |    <!--  
  |    <core:jbpm>
  |       <core:process-definitions></core:process-definitions>
  |       <core:pageflow-definitions></core:pageflow-definitions>
  |    </core:jbpm>
  |    -->
  |    
  |       
  | </components>
  | 

The jboss mail-service.xml:

  | <?xml version="1.0" encoding="UTF-8"?>
  | <!DOCTYPE server>
  | <!-- $Id: mail-service.xml 31716 2005-06-01 06:20:43Z starksm $ -->
  | 
  | <server>
  | 
  |   <!-- ==================================================================== -->
  |   <!-- Mail Connection Factory                                              -->
  |   <!-- ==================================================================== -->
  | 
  |   <mbean code="org.jboss.mail.MailService"
  |          name="jboss:service=Mail">
  |     <attribute name="JNDIName">java:/Mail</attribute>
  |     <attribute name="User">mokua</attribute>
  |     <attribute name="Password">mokua</attribute>
  |     <attribute name="Configuration">
  |       <!-- A test configuration -->
  |       <configuration>
  |         <!-- Change to your mail server prototocol -->
  |         <property name="mail.store.protocol" value="pop3"/>
  |         <property name="mail.transport.protocol" value="smtp"/>
  | 
  |         <!-- Change to the user who will receive mail  -->
  |         <property name="mail.user" value="myname"/>
  | 
  |         <!-- Change to the mail server  -->
  |         <property name="mail.pop3.host" value="localhost"/>
  | 
  |         <!-- Change to the SMTP gateway server -->
  |         <property name="mail.smtp.host" value="localhost"/>
  |         
  |         <!-- The mail server port -->
  |         <property name="mail.smtp.port" value="2525"/>
  |         
  |         <!-- Change to the address mail will be from  -->
  |         <property name="mail.from" value="myname at localhost.com"/>
  | 
  |         <!-- Enable debugging output from the javamail classes -->
  |         <property name="mail.debug" value="true"/>
  |       </configuration>
  |     </attribute>
  |     <depends>jboss:service=Naming</depends>
  |   </mbean>
  | 
  | 
  | </server>
  | 

Am using:
seam1.2.1 ga
jboss4.0.5 ga

i have already replaced the mail-ra.ra in jboss with one that comes with seam.

Any help will be greatly appreciated.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071436#4071436

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071436



More information about the jboss-user mailing list