On Mon, 2003-07-07 at 07:38, Jan Bartel wrote: > Hi > > There appear to be a couple of anomalies in the handling of bean > references (ie ejb-ref and ejb-local-ref) elements of the web.xml and > ejb-jar.xml descriptors. > > Firstly, the war deployer and the ejb deployer handle ejb-ref elements > differently. The war deployer (org.jboss.web.AbstractWebContainer) > always looks first for a jndi-name element in a matching ejb-ref element > in jboss-web.xml, only falling back to looking for an ejb-link element > in the ejb-jar.xml when no jndi-name has been provided. On the other > hand, the ejb deployer (org.jboss.ejb.Container) always looks first for > an ejb-link element, only falling back to the jndi-element if no > ejb-link is specified. Both deployers should handle the ejb-ref element > in the same way, and I'd argue that it is 'more correct' to look for the > ejb-link name first, as this is provided in the spec, and only fallback > to the application server-specific jboss.xml and jboss-web.xml > descriptor elements where no ejb-link has been provided. >
Making that change would break previously working configurations, where both are specified and it is inconsistent. IMHO if the user specifies a jndi-name it should be used, it provides an exact binding. Unless the url#ejb-name format is used, ejb-link is not as deterministic. The best way to cater for this change would be to provide an option on the ejb deployer for the old behaviour. > Secondly, the handling of ejb-local-refs is very different to ejb-refs. > Both the war and the ejb deployers look exclusively for an ejb-link > element. Ie there is no possibility to provide the jndi-name of the > referenced bean as there is with ejb-refs. Is there any reason why this > is handled differently? By that I mean, why shouldn't the ejb-local-ref > attempt to locate a jndi-name element in a jboss specific descriptor as > a fallback? It would make things much more symmetrical if this was the case. > > Assuming that symmetry would be desirable, I propose an addition to the > jboss-web.xml and jboss.xml descriptors to add this element: > <!-- > The ejb-local-ref element is used to give the jndi-name of an > ejb reference. This is an alternative to using ejb-link in ejb-jar.xml > > Used in: entity, session, and message-driven > --> > <!ELEMENT ejb-local-ref (ejb-ref-name , jndi-name)> > > Modifications would be necessary to several source files including > org.jboss.metadata.BeanMetaData, org.jboss.metadata.EjbLocalRefMetaData, > org.jboss.web.AbstractWebContainer and org.jboss.ejb.Container. > > If these changes are acceptable, I am almost ready to commit them, but > it appears I no longer have CVS write access?? Can I get it back again > to commit these changes? > ejb-local-refs are only intended for ejbs in the same deployment so ejb-link should suffice, but the spec is not very explicit. The way jboss works, this won't be a problem. It should not break any existing deployments. > > thanks > Jan -- xxxxxxxxxxxxxxxxxxxxxxxx Adrian Brock Director of Support Back Office JBoss Group, LLC xxxxxxxxxxxxxxxxxxxxxxxx ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development