javaee / ejb-spec

See javax.ejb project for API. Contains legacy issues only.
https://github.com/javaee/javax.ejb
6 stars 1 forks source link

evaluate Java EE 7 spec section 5.2.2 for possible clarification in relation to EJB 3.2 spec portable JNDI lookup #135

Open amykang2020 opened 6 years ago

amykang2020 commented 6 years ago

Java EE 7 spec section 5.2.2 "For historical reasons, the java:comp namespace is shared by all components in a web module. To preserve compatibility, this specification doesn’t change that. In a web module, java:comp refers to the same namespace as java:module."

EJB 3.2 spec section 4.4.2.1 "If FooBean is packaged in a stand-alone fooweb.war file, without the use of any deployment descriptors, the resulting global JNDI name entries are:

java:global/fooweb/FooBean
java:global/fooweb/FooBean!com.acme.Foo

java:app/fooweb/FooBean
java:app/fooweb/FooBean!com.acme.Foo

java:module/FooBean
java:module/FooBean!com.acme.Foo

"

Java EE 7 spec section 5.2.2 also says following "java:comp – Names in this namespace are per-component (for example, per enterprise bean). Except for components in a web module, each component gets its own java:comp namespace, not shared with any other component. Components in a web module do not have their own private component namespace. "

"It is recommended that resources in a web module that are intended to be shared by more than one component be declared in the java:module/env namespace."

A cross spec evaluation is necessary for potential clarifications -

  1. to reduce the likelyhood of confusion and different interpretations of regarding java:comp name space when EJB in war
  2. Java EE 7 spec section 5.2.2 paragraph "For historical reasons, the java:comp ..." - since it's for "historical reason" and for "preserve compatibility", for portability reason, would it be more appropriate to clarify that EJB in war is not required to be declared in java:comp so to be inline with EJB portable JNDI lookup requirement ?