I have a Java EE web application using the Java EE 6 web profile features + EJB Timer service and JavaMail. I am currently using the full GlassFish 3.1.2 profile during development, but I want to explore alternatives because:
I am currently using the GlassFish built-in application server function for tests, so it is advisable to use a similar installation for any alternative. In the worst case scenario, I can live with GlassFish for automated tests.
Is it possible to “add” the JavaMail and EJB Timer Service implementation module to an application server that implements only a web profile? Does this work well? If this is not possible, are there alternatives to using JavaMail and the EJB Timer Service?
Which application servers that meet my requirements can you recommend?
, " " EJB, EJB lite. , Java EE. , - Java EE?
Java EE, , , .
Apache TomEE doc, TomEE, TomEE + OpenEJB .
AS 7.1, this thead JBoss AS 7.1.0, , .
, GlassFish, .
, , jboss 7.1 .
Jboss 5.1, JDK 6, .
jboss . , "" / , . ( .)
wiki, jboss jboss 5. , . , , , .
, :
. , . (, , AS, . , , -, .)
, .
, JBoss AS7 . , - AS7 EAP 6 (!) - . , , , .
AS7 , . , , , , ( 7.1), -, -. , , (7.1.0 - 125 , - ).
, ( , ), . , Geronimo EE6, , , .
Tomcat. , Tomcat, " Tomcat", , - , - . TomEE. Tomcat, .
, OpenEJB/TomEE . , , , :
To set up your JavaMail resource in a test case, simply follow these steps:
Properties p = new Properties(); p.setProperty("superbizMail", "new://Resource?type=javax.mail.Session"); p.setProperty("superbizMail.mail.smtp.host", "mail.superbiz.org"); p.setProperty("superbizMail.mail.smtp.port", "25"); p.setProperty("superbizMail.mail.transport.protocol", "smtp"); p.setProperty("superbizMail.mail.smtp.auth", "true"); p.setProperty("superbizMail.mail.smtp.user", "someuser"); p.setProperty("superbizMail.password", "mypassword"); EJBContainer.createEJBContainer(p);
Then enter the JavaMail session in your EJB with:
@Resource private Session superbizMail;
Behind the scenes of "superbizMail". the part resets all properties, and the resulting set of properties is passed to javax.mail.Session.getDefaultInstance(Properties props). Resulting Sessionis what is entered into the link@Resource
javax.mail.Session.getDefaultInstance(Properties props)
Session
@Resource