Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java EE 6 Application Server for Web Profile with JavaMail

I have a Java EE web application using features from the Java EE 6 web profile + the EJB Timer service and JavaMail. I'm currently using GlassFish 3.1.2 full profile during development, but I want to investigate the alternatives because:

  • There seems to be a bug with multipart forms in GlassFish 3.1.2 and GlassFish 3.1.1 had other problems hurting me which are fixed in 3.1.2. (catch 22...) That bug is fixed by the jar in the ticket.
  • There seems to be a lot more options for application servers supporting the "web profile" than the "full profile" and the former is supposed to be so much more lightweight.
  • I want to choose the best option for deployment

I am currently using the embedded application server feature of GlassFish for tests, so a similar facility for any alternative is desirable. At worst, I can live with stiking to GlassFish embedded for the automated tests.

Is it possible to "add" a JavaMail and EJB Timer Service implementation module to an applicaton server implementing only the web profile? Does it work well? If this is not possible, are there alternatives to using JavaMail and the EJB Timer Service?

Which application servers meeting my requirements can you recommend?

Finally, I considered using the "Asynchronous invocation" feature of EJBs which is not part of EJB lite. If I understood correctly, it is illegal to start threads manually when running in a Java EE container. In that case, how can asynchronous operations be started in the Java EE Web Profile?

I'm still relatively new to the whole Java EE ecosystem and terminology so please don't hesitate to ask me to clarify any parts of my question.

Supporting doc

  • Java EE 6 web profile vs Full profile
  • EJB 3.1 vs EJB lite

edit 1

According to the Apache TomEE doc, TomEE, TomEE+ and OpenEJB would fit the bill.

edit 2

Based on the AS 7.1 release notes, this thead and this issue JBoss AS 7.1.0 seems to implement all the features I need.

like image 522
bernie Avatar asked Mar 07 '12 17:03

bernie


2 Answers

First of all, I have never used GlassFish so I cannot give you any information about that.

I'm not sure if your application is being build for a true production envrionment but jboss 7.1 does not yet have any official commercial support in case you run into trouble.

Jboss 5.1 optimized for JDK 6 has commercial support via red hat.

That being said, a jboss instance can be fully configured and is very flexible. That means that you can start with the 'web' profile and add/remove services you do not need. (Removing unused services is always advised for production environments.)

Here is a wiki that gives information about slimming a jboss profile in jboss 5. It indicates all steps needed to remove a service. The slimming operation can also be reversed, so you can add anything you need to a certain profile.

So there are basicly two approaches:

  • Start with a profile like 'default' or 'all' and start removing services that are not needed for your application
  • Start with the 'minimal' or 'web' profile and start adding services you are missing for your application. You copy the services from a profile that has it. (I personally prefer this approach)

Adding and removing services can be a work of trial and error though. You need to search the internet for a correct guide for the service you are trying to add or remove. (Tip, always do your operations on a copy of the profile provided by the AS and document each step. That way you can start over if you did something that seems irreversible.)

I hope this is of any help.

like image 93
tom Avatar answered Nov 15 '22 00:11

tom


tom's right that JBoss AS7 doesn't have commercial support yet. However, it is coming - AS7 is being productised as EAP 6 (annoyingly!), and is going into beta in a few days. The community version has been out for a few months now, and although it does have a lot of rough edges, it basically works pretty well.

AS7 has a much more modular architecture than previous versions. The idea is that you only load the modules you need, which means that although it's a full-profile implementation (as of 7.1), if you only use web profile features, you only pay the runtime cost of a web profile implementation. You still have the bits you don't need sitting on disk, but disk is cheap (7.1.0 is 125 MB all in - hardly huge).

I'm afraid i haven't used any other fully-grown app servers (not in the last decade, at least), and so can't comment on them. I believe Geronimo supports full-profile EE6, so if you don't need commercial support, that might be worth a look.

I have spent some time using Tomcat-based setups. Yes, you can add enough extras to Tomcat to create a sort of 'bionic Tomcat' that is basically an app server, but doing it yourself is work you really shouldn't be doing - pure waste. I haven't used TomEE. I'm not a big fan of Tomcat generally, i have to admit.

like image 20
Tom Anderson Avatar answered Nov 14 '22 23:11

Tom Anderson