]
Tomaz Cerar commented on AS7-1177:
----------------------------------
Current config looks like this:
{code:xml}
<mail-session jndi-name="java:/Mail" debug="true">
<login name="nobody" password="pass"/>
<smtp-server address="localhost" port="9999"/>
</mail-session>
<mail-session jndi-name="foo/MyMailServer1">
<login name="user" password="pass"/>
<smtp-server address="remote" port="25"/>
</mail-session>
{code}
I am not using port binding as we are actually not binding to any server ports (as jboss
ports) but just use address and port.
aditional java mail properties are supported as attributes on mail-session as George
suggested, currently only "debug" is read and used.
Code in my github branch now uses this configuration and creates metamodel and registers
the services in jndi.
David, as you suggested if jndi name does not start with "java:" it is put under
"java:jboss/mail/" + rawJndiName
The creation of mail session itself is not finished yet but should be trivial after I get
some sleep :)
next thing as for configuration goes I will add similar support of pop3 server with config
something like:
{code:xml}
<pop3-server address="remote.address" port="125" />
{code}
George, It would be great help if you could provide some integration tests for this. I
have some tests but not nearly enough :)
Implement JavaMail
------------------
Key: AS7-1177
URL:
https://issues.jboss.org/browse/AS7-1177
Project: Application Server 7
Issue Type: Feature Request
Components: Modules
Affects Versions: 7.0.0.CR1
Reporter: Juergen Zimmermann
Assignee: Tomaz Cerar
JavaMail cannot be used as it was in JBossAS 6 and earlier.
1) I tried as in JBoss 6:
@Resource(mappedName = "java:Mail")
private Session mailer;
... and got this logging info within the Arquillian tests:
11:12:08,454 INFO [org.jboss.as.server.controller] (pool-1-thread-48) Deployment of
"test.ear.ear" was rolled back with failure message {"Services with
missing/unavailable dependencies" =>
["jboss.naming.context.java.comp.\"test.ear\".test.KundenverwaltungListener.\"env/de.swe2.kundenverwaltung.service.KundenverwaltungListener/mailer\".jboss.deployment.subunit.\"test.ear.ear\".\"test.jar\".component.KundenverwaltungListener.8","jboss.deployment.subunit.\"test.ear.ear\".\"test.jar\".component.Dao.START","jboss.deployment.subunit.\"test.ear.ear\".\"test.jar\".component.KundenverwaltungListener.START","jboss.deployment.subunit.\"test.ear.ear\".\"test.jar\".component.KundenverwaltungResourceImpl.START","jboss.deployment.subunit.\"test.ear.ear\".\"test.jar\".component.ValidationService.START","jboss.deployment.subunit.\"test.ear.ear\".\"test.jar\".component.Kundenverwaltung.START","jboss.deployment.subunit.\"test.ear.ear\".\"test.jar\".component.Artikelverwaltung.START","jboss.deployment.subunit.\"test.ear.ear\".\"test.jar\".component.FileStore.START","jboss.deployment.subunit.\"test.ear.ear\".\"test.jar\".component.RolesService.START","jboss.deployment.subunit.\"test.ear.ear\".\"test.jar\".component.BestellverwaltungResourceImpl.START","jboss.deployment.subunit.\"test.ear.ear\".\"test.jar\".component.PasswordService.START","jboss.deployment.subunit.\"test.ear.ear\".\"test.jar\".jndiDependencyService","jboss.deployment.subunit.\"test.ear.ear\".\"test.jar\".component.Bestellverwaltung.START"]}
11:12:08,468 INFO [org.jboss.jpa] (MSC service thread 1-1) stopping Persistence Unit
Service 'test.ear.ear/test.jar#swe2Persistence'
11:12:08,470 INFO [org.jboss.weld] (MSC service thread 1-1) Stopping weld service
2) I tried
@Resource
private Session mailer;
... and got this logging info within the Arquillian tests:
11:09:20,085 INFO [org.jboss.as.server.controller] (pool-1-thread-46) Deployment of
"test.ear.ear" was rolled back with failure message {"Services with
missing/unavailable dependencies" =>
["jboss.deployment.subunit.\"test.ear.ear\".\"test.jar\".component.KundenverwaltungListener.START"]}
11:09:20,094 INFO [org.jboss.jpa] (MSC service thread 1-2) stopping Persistence Unit
Service 'test.ear.ear/test.jar#swe2Persistence'
11:09:20,098 INFO [org.jboss.weld] (MSC service thread 1-2) Stopping weld service
--
This message is automatically generated by JIRA.
For more information on JIRA, see: