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é

Reply via email to