That worked! Thank you again Romain!
please keep a single thread http://openejb.979440.n4.nabble.com/TomEE-auto-links-email-resources-incorrectly-td4667842.html BTW use @Resource(name = "mail/mail1") otherwise what you did is not specified Romain Manni-Bucau Twitter: @rmannibucau Blog: http://rmannibucau.wordpress.com/[http://rmannibucau.wordpress.com/] LinkedIn: http://fr.linkedin.com/in/rmannibucau[http://fr.linkedin.com/in/rmannibucau] Github: https://github.com/rmannibucau[https://github.com/rmannibucau] 2014-02-18 8:21 GMT+01:00 Rene Perschon <[email protected]>: > Hi! > > I have 2 mail resources configured in tomee.xml: > > <Resource id="mail/mail1" type="javax.mail.Session"> > mail.host=host1 > mail.transport.protocol=smtps > mail.smtps.auth=true > mail.smtps.port=465 > mail.smtps.ssl.trust=host1 > mail.smtps.from=mail@host1 > mail.smtps.user=mail@host1 > password=pw > </Resource> > > <Resource id="mail/mail2" type="javax.mail.Session"> > mail.host=host2 > mail.transport.protocol=smtps > mail.smtps.auth=true > mail.smtps.port=465 > mail.smtps.ssl.trust=host2 > mail.smtps.from=mail@host2 > mail.smtps.user=mail@host2 > password=pw > </Resource> > > And i have them injected in a local stateless EJB like so: > > @Resource(name = "java:app/mail/mail1") > private Session _mailSession1; > > @Resource(name = "java:app/mail/mail2") > private Session _mailSession2; > > But when i deploy the application, tomee auto-links one of the resources > incorrectly: > > Feb 17, 2014 2:47:49 PM org.apache.openejb.config.AutoConfig > processResourceRef > Information: Auto-linking resource-ref 'java:app/mail/mail1' in bean MyBean > to Resource(id=mail/mail1) > Feb 17, 2014 2:47:49 PM org.apache.openejb.config.AutoConfig > processResourceRef > Information: Auto-linking resource-ref 'java:app/mail/mail2' in bean MyBean > to Resource(id=mail/mail1) > > mail1 is fine, but all mail2 references are linked to mail1 too! > > Can anybody help me with this? > > Thanks! > René
