Hi All, We are use JBoss AS 5.0.0 and we have trouble: we create two mail-services but when try get information we got similar data for different jndi.
config: <?xml version="1.0" encoding="UTF-8"?> | <!-- $Id: mail-service.xml 62349 2007-04-15 16:48:15Z [email protected] $ --> | <server> | <mbean code="org.jboss.mail.MailService" | name="jboss:service=jcCrm"> | <attribute name="JNDIName">java:/mail/jcCrm</attribute> | <attribute name="Configuration"> | <configuration> | <property name="mail.transport.protocol" value="smtp"/> | <property name="mail.user" value="[email protected]"/> | <property name="mail.password" value="<password_1>"/> | <property name="mail.smtp.host" value="mail.japancar.ru"/> | <property name="mail.smtp.port" value="25"/> | <property name="mail.smtp.auth" value="true"/> | <property name="mail.from" value="[email protected]"/> | <property name="mail.mime.charset" value="UTF-8"/> | <property name="mail.debug" value="true"/> | </configuration> | </attribute> | <depends>jboss:service=Naming</depends> | </mbean> | | <mbean code="org.jboss.mail.MailService" | name="jboss:service=gp"> | <attribute name="JNDIName">java:/mail/gp</attribute> | <attribute name="Configuration"> | <configuration> | <property name="mail.transport.protocol" value="smtp"/> | <property name="mail.user" value="[email protected]"/> | <property name="mail.password" value="<password_2>"/> | <property name="mail.smtp.host" value="mail.japancar.ru"/> | <property name="mail.smtp.port" value="25"/> | <property name="mail.smtp.auth" value="true"/> | <property name="mail.from" value="[email protected]"/> | <property name="mail.mime.charset" value="UTF-8"/> | <property name="mail.debug" value="true"/> | </configuration> | </attribute> | <depends>jboss:service=Naming</depends> | </mbean> | </server> We use next part of code for getting mail-sessions: session1 = (Session) context.lookup("java:/mail/gp"); | session2 = (Session) context.lookup("java:/mail/jcCrm"); | | if (session1 != null) { | Properties properties = session1.getProperties(); | properties.list(out); | } | | if (session2 != null) { | Properties properties = session2.getProperties(); | properties.list(out); | } | | out.write("<br> sesion1.equals(session2) = " + session1.equals(session2) + " " + "<br>"); | It provide next result: | -- listing properties -- [email protected] mail.mime.charset=UTF-8 mail.transport.protocol=smtp mail.smtp.host=mail.japancar.ru mail.debug=true [email protected] mail.smtp.port=25 mail.smtp.auth=true mail.password=<pass_1> | | -- listing properties -- [email protected] mail.mime.charset=UTF-8 mail.transport.protocol=smtp mail.smtp.host=mail.japancar.ru mail.debug=true [email protected] mail.smtp.port=25 mail.smtp.auth=true mail.password=<pass_1> | sesion1.equals(session2) = false | So, we can see, that for two different jndi we got similar values. Also, this code work fine on JBoss AS 4.2.3.GA Any ideas? View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4220462#4220462 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4220462 _______________________________________________ jboss-user mailing list [email protected] https://lists.jboss.org/mailman/listinfo/jboss-user
