Java Reference
In-Depth Information
Namespace
Description
and CartEJB can look up java:comp/LogLevel and get different values. For backward compatibility,
this isn't true for the web module. All components deployed as part of a WAR share the same
java:comp namespace. It's unlikely you'll use this namespace very often. It's mostly there for back-
ward compatibility. Prior to Java EE 6, java:comp was really the only standard namespace.
Lookups in this namespace are scoped per module. All components in the module share the
java:module namespace. An EJB-JAR file is a module, as is a WAR file. For backward compatibil-
ity, the java:comp and java:module namespaces are treated identically in web modules and refer to
the same namespace. You should favor the use of java:module over java:comp when possible.
java:module
Lookups in this namespace are scoped per application. All components in all modules in the applic-
ation share the java:app namespace. An EAR is an example of an application. All WARs and EJBs
deployed from the EAR would share this namespace.
java:app
Lookups in this namespace are global and shared by all components in all modules in all applica-
tions.
java:global
[app-name]
The [app-name] value is optional and only present if the EJBs are deployed to the server
inside of an EAR. If an EAR isn't used, then the [app-name] value will be absent from
the EJBs' portable JNDI name.
The default value for [app-name] is the name of the EAR file without the .ear extension.
The application.xml file is able to override this default value, however.
<module-name>
The <module-name> value is required and will always be present. The value for
<module-name> depends on how the modules containing the EJBs are deployed.
For EJBs deployed as standalone EJB-JAR files (JAR files deployed directly), the default
value for <module-name> is the name of the EJB-JAR file without the .jar extension.
This default name can be overridden using the module-name element of the META-INF/
ejb-jar.xml configuration file.
For EJBs deployed as part of a standalone web module (WAR file), the default value for
<module-name> is the name of the WAR file without the .war extension. This default
name can be overridden using the module-name element of the WEB-INF/web.xml con-
figuration file.
Search WWH ::




Custom Search