Need for application.xml in JavaEE 6 for ejb

5.1k Views Asked by At

I have a question similar to Application Deployment Descriptor in Java EE 6 where the answerer explains that if you want to use custom (non-default) context-root, one must define the application.xml which should contain all the information for the project.

If I have an EJB, is there any such specific condition/situation for an EJB, where I must define an application.xml?

2

There are 2 best solutions below

2
On

The application.xml is not required, and I cannot think of a situation where you would be forced to do it because of an EJB.

1
On

The previous answer is correct, only a few additions:

  • In general, the deployment descriptor gives you the possibility to overwrite settings done by component defaults or annotations.
  • In Java EE there is for most use cases no need to create an EAR deployment, since EJBs can also resist in the WAR.
  • Thus, application.xml is optional, so as per se there is no situation where you must have it, but there are those were you may want to have it. Also checkout Pascal's cite.