[jboss-user] [Installation, Configuration & DEPLOYMENT] - Weird behavior on AS 5 regarding multiple mail sessions
leonardomadrigal
do-not-reply at jboss.com
Thu Mar 19 20:17:07 EDT 2009
On jboss as 4.x was ok to use multiple:
|
| <mbean code="org.jboss.mail.MailService" name="jboss:service=Whatever">
|
on mail-service.xml to define multiple mail sessions.
On jboss 5 using any *-service.xml that contain multiple Mail Sessions causes jboss to ignore the properties of the first deployed services.
ex:
mail-service.xml
.....
| <mbean code="org.jboss.mail.MailService" name="jboss:service=Mail1">
| <attribute name="JNDIName">mail/Mail1</attribute>
| <attribute name="Configuration">
| <configuration>
| <property name="mail.transport.protocol" value="smtp"/>
| <property name="mail.smtp.host" value="1.1.1.1"/>
| </configuration>
| </attribute>
| </mbean>
|
| <mbean code="org.jboss.mail.MailService" name="jboss:service=Mail2">
| <attribute name="JNDIName">mail/Mail2</attribute>
| <attribute name="Configuration">
| <configuration>
| <property name="mail.transport.protocol" value="smtp"/>
| <property name="mail.smtp.host" value="1.1.1.2"/>
| </configuration>
| </attribute>
| </mbean>
|
.....
The services get deployed just fine, and the JNDI lookups return correctly (a mail session)
but a simple jsp with the following code:
| Context initCtx = new InitialContext();
| Context envCtx = (Context) initCtx.lookup("");
| Object objref = envCtx.lookup("mail/Mail1");
| Session s = (Session) PortableRemoteObject.narrow(objref, Session.class);
| Object objref2 = envCtx.lookup("mail/Mail2");
| Session s2 = (Session) PortableRemoteObject.narrow(objref2, Session.class);
| out.print(s.getProperties());
| out.print(s2.getProperties());
|
shows that the properties of the first session (s1) to be the same of s2
(the SMTP is always 1.1.1.2)
If the mbean's are separated on diferent -service.xml files, the behavior is the same.
any ideas?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4219674#4219674
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4219674
More information about the jboss-user
mailing list