Fork me on GitHub

The JNDI Namespace

The Java Naming and Directory Interface (JNDI) Namespace provides the ability to lookup and reference resources defined by a JNDI context.

Namespace Content Handler

The implementation is provided by the class.


The common prefix used for this namespace in Cache Configurations is jndi, however as with all XML namespace declarations this can be defined arbitrarily when declaring the namespace.

To use the namespace you should declare it as follows:

<cache-config xmlns:jndi="class://">




The following elements are defined by this namespace.


Specifies how to lookup a resource using a JNDI reference.

Element Type:

When processed this element will produce a ParameterizedBuilder<?>.

Child Elements:

The following elements are premitted as child elements for this element:

  • <jndi:resource-name> (required)

    A java.lang.String defining the JNDI resource to locate.

  • <init-params> (optional)

    Used to define optional parameters for resolving the JNDI resource.


Using JNDI to resolve a DNS record:


Using JNDI to resolve a JMS Connection Factory:


            <param-value system-property="java.naming.provider.url"></param-value>