hi can anybody tell me if in the ejb-jar.xml in the tag <ejb-name> </ejb-name> what is really supposed to come as i cna see the hgome inter face and the beana nd the remote interface in different online examples .. thanks
well thanks for posting and reply : but my question was is it neccessary that the BEAN be the ejb-name i have seen examples with the home interface or the remote interface being the ejb-name orshould i ask : what does it depends on how do we choose the ejb-name.
Hi there! The ejb-name is a name that does not *need* to match the bean name or interface. You could (although it would be bad idea) give each of your beans names like: Foo, Bar, etc. even though your actual component interfaces are Customer, Advice, etc.
It is generally good practice, though, to give your bean an ejb-name that represents the bean, not one of its interfaces, although many use this practice:
Remote Component interface: Customer Remote Home interface: CustomerHome Local Component interface: CustomerLocal Local Home interface: CustomerHomeLocal or CustomerLocalHome
Bean class name: CustomerBean ejb-name in DD: CustomerBean (or Customer)
(So the ejb-name often matches the bean class name or remote component interface name, which is generally the bean class name *minus* the word "bean".)
Remember that the ejb-name is never used in code, or in JNDI lookups, etc. The ejb-name is used ONLY as a kind of "label" in the DD. It is a name that you can use in *other* parts of the DD to tell the DD which actual bean you are referring to, without having to redefine all the core info about the bean everywhere you need to refer to one. For example, an ejb-ref can use the ejb-link to specify WHICH bean you're *really* talking about, and value of the ejb-link tag must match the value of an ejb-name tag somewhere else in the DD.