Is adding your ejb's to the web.xml or other ejb references to ejb-jar.xml files important, if so why?

I'm developing a J2EE web application using Struts, and EJB's.

My question is that I have not included any ejb references in my web.xml file that any of my war classes are using, nor did I enter any references in my session ejb's xml file who reference various CMP beans.  Am I losing anything by not doing this, as the application works fine omitting these references.  

I'm using XDoclet tags and never bothered using the references.  I don't know what the benefits are as of right now to me it seems adding them in just adds more maintenace work.

FYI in my dev environment I have an exploded war file and an ear file that contains all my ejb's and related classes.

In my test env, I have one ear file and all works fine.

Who is Participating?
aozarovConnect With a Mentor Commented:
If you are using xdoclets then you are not loosing anything.
The concept of defining reference for EJB in the EJB xml descriptor or servlets web.xml is to enable you to code against
a logical binding name (instead of using the real jndi path). That concept was suppose to diffrenciate between developers and j2ee
assembler which was suppose to take all the pieces and connect them together. That concept was never really used because most of the
developers are the assemblers (connecting the j2ee elements together). Also in your case you can have xdoclets generate such reference, but
then what is the point if the ejb jndi name change you are going to change your xdoclet code (and hence your code) anyway.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.