Java Naming and Directory Interface
This feature enables the use of Java Naming and Directory Interface (JNDI) to access server configured resources such as DataSources or JMS Connection Factories. It also allows access to Java primitives configured in the server as a jndiEntry.
Enable this feature
To enable the Java Naming and Directory Interface feature, add the following element declaration inside the featureManager element in the server.xml file:
<feature>jndi-1.0</feature>
Developing a feature that depends on this feature
If we are developing a feature that depends on the Java Naming and Directory Interface feature, include the following item in the Subsystem-Content header in the feature manifest file for the new feature:
com.ibm.websphere.appserver.jndi-1.0; type="osgi.subsystem.feature"
Features that enable this feature
- Distributed Map interface for Dynamic Caching
- Enterprise JavaBeans Lite 3.1
- Java Database Connectivity 4.0
- Java Persistence API 2.0
- Java EE Managed Bean 1.0
- OSGi Java Persistence API
- Java EE Web Profile 6.0
Feature configuration elements
We can use the following elements in the server.xml file to configure the Java Naming and Directory Interface feature:
- classloading
- Global classloading
Attribute name Data type Default value Description useJarUrls boolean false Whether to use jar: or wsjar: URLs for referencing files in archives
- jndiEntry
- A single entry in the JNDI default namespace.
Attribute name Data type Default value Description id string A unique configuration ID. jndiName string The JNDI name to use for this entry. value string The JNDI value to associate with the name.
- jndiObjectFactory
- ObjectFactory to be used by a JNDI Reference entry.
Attribute name Data type Default value Description className string ObjectFactory implementation class name. id string A unique configuration ID. libraryRef A reference to top level library element (string). Library containing the factory implementation class. objectClassName string java.lang.Object Type of object returned from the factory.
- jndiObjectFactory > library
Description: Library containing the factory implementation class.
Required: false
Data type:
Attribute name Data type Default value Description apiTypeVisibility string spec,ibm-api,api The types of API package this library's class loader will be able to see, as a comma-separated list of any combination of the following: spec, ibm-api, api, third-party. description string Description of shared library for administrators filesetRef List of references to top level fileset elements (comma-separated string). Id of referenced Fileset name string Name of shared library for administrators
- jndiObjectFactory > library > file
Description: Id of referenced File
Required: false
Data type:
Attribute name Data type Default value Description name Path to a file Fully qualified filename
- jndiObjectFactory > library > fileset
Description: Id of referenced Fileset
Required: false
Data type:
Attribute name Data type Default value Description caseSensitive boolean true Boolean to indicate whether or not the search should be case sensitive (default: true). dir Path to a directory ${server.config.dir} The base directory to search for files. excludes string The comma or space separated list of file name patterns to exclude from the search results, by default no files are excluded. includes string * The comma or space separated list of file name patterns to include in the search results (default: *). scanInterval A period of time with millisecond precision 0 Scanning interval to check the fileset for changes as a long with a time unit suffix h-hour, m-minute, s-second, ms-millisecond (e.g. 2ms or 5s). Disabled (scanInterval=0) by default. Specify a positive integer followed by a unit of time, which can be hours (h), minutes (m), seconds (s), or milliseconds (ms). For example, specify 500 milliseconds as 500ms. We can include multiple values in a single entry. For example, 1s500ms is equivalent to 1.5 seconds.
- jndiObjectFactory > library > folder
Description: Id of referenced folder
Required: false
Data type:
Attribute name Data type Default value Description dir Path to a directory Directory or folder to be included in the library classpath for locating resource files
- jndiReferenceEntry
- Reference entry in the JNDI default namespace.
Attribute name Data type Default value Description factoryRef A reference to top level jndiObjectFactory element (string). Object factory for the reference entry. id string A unique configuration ID. jndiName string JNDI name for the reference entry.
- jndiReferenceEntry > factory
Description: Object factory for the reference entry.
Required: false
Data type:
Attribute name Data type Default value Description className string ObjectFactory implementation class name. libraryRef A reference to top level library element (string). Library containing the factory implementation class. objectClassName string java.lang.Object Type of object returned from the factory.
- jndiReferenceEntry > factory > library
Description: Library containing the factory implementation class.
Required: false
Data type:
Attribute name Data type Default value Description apiTypeVisibility string spec,ibm-api,api The types of API package this library's class loader will be able to see, as a comma-separated list of any combination of the following: spec, ibm-api, api, third-party. description string Description of shared library for administrators filesetRef List of references to top level fileset elements (comma-separated string). Id of referenced Fileset name string Name of shared library for administrators
- jndiReferenceEntry > factory > library > file
Description: Id of referenced File
Required: false
Data type:
Attribute name Data type Default value Description name Path to a file Fully qualified filename
- jndiReferenceEntry > factory > library > fileset
Description: Id of referenced Fileset
Required: false
Data type:
Attribute name Data type Default value Description caseSensitive boolean true Boolean to indicate whether or not the search should be case sensitive (default: true). dir Path to a directory ${server.config.dir} The base directory to search for files. excludes string The comma or space separated list of file name patterns to exclude from the search results, by default no files are excluded. includes string * The comma or space separated list of file name patterns to include in the search results (default: *). scanInterval A period of time with millisecond precision 0 Scanning interval to check the fileset for changes as a long with a time unit suffix h-hour, m-minute, s-second, ms-millisecond (e.g. 2ms or 5s). Disabled (scanInterval=0) by default. Specify a positive integer followed by a unit of time, which can be hours (h), minutes (m), seconds (s), or milliseconds (ms). For example, specify 500 milliseconds as 500ms. We can include multiple values in a single entry. For example, 1s500ms is equivalent to 1.5 seconds.
- jndiReferenceEntry > factory > library > folder
Description: Id of referenced folder
Required: false
Data type:
Attribute name Data type Default value Description dir Path to a directory Directory or folder to be included in the library classpath for locating resource files
- jndiReferenceEntry > properties
Description: The properties for the reference entry.
Required: false
Data type: