Why the JNDI rebinding via naming subsystem in EAP6 requires reload?

Solution Unverified - Updated -

Issue

  • Why the JNDI rebinding via naming subsystem in EAP6 requires reload ?
  • Changing the values which are bound in the naming subsystem shows "reload-required", which it ideally should not. The JNDI naming should follow the "rebind" feature of InitialContext. The values should be rebound in the JNDI.

Example:

  • Step-1. Bind a simple object in the JNDI as following:
[standalone@localhost:9999 /] /subsystem=naming/binding=java\:jboss\/exported\/test/:add(binding-type=simple,value=100,type=int)
{"outcome" => "success"}
  • Step-2. Change the value of the jndi binding as following:
[standalone@localhost:9999 /] /subsystem=naming/binding=java\:jboss\/exported\/test/:write-attribute(name=value,value="500")
{
    "outcome" => "success",
    "response-headers" => {
        "operation-requires-reload" => true,
        "process-state" => "reload-required"
    }
}
  • Step-3. Now using a simple JNDI lookup code check the value of the JNDI it will still show "100". Like one can use the following JSP code to do a jndi lookup.
<%@page import="java.util.*,javax.naming.*" %>
<%
       String jndiName = "java:jboss/exported/test";
       int data =0;
       try{            
            Context ic = new InitialContext();
            System.out.println("About to look up jndi name " + jndiName);
            Object obj = ic.lookup(jndiName);
            System.out.println("lookup returned " + obj);
            data= (Integer) obj;
            System.out.println("Got the Data: " + data);
       }
     catch(Exception e)
          {
             System.out.println("******* Inside catch "+e);
             e.printStackTrace();
          }
     out.println("<h1>Got the Data: " + data);
%>
  • However the value is persisted in the XML configuration as following:
    [standalone@localhost:9999 /] /subsystem=naming/binding=java\:jboss\/exported\/test/:read-attribute(name=value)
    {
        "outcome" => "success",
        "result" => "500",
        "response-headers" => {"process-state" => "reload-required"}
    }
  • It can be noticed that in the JNDI which was bound as 100 with JNDI name as "java:jboss/exported/test", then later when tried changing the value of this JNDI binding from "100" to "500" and it is noticed that even after the "write-attribute" operation the runtime model object value was still 100 but the changes were persisted in the XML configuration as following:
            <subsystem xmlns="urn:jboss:domain:naming:1.3">
                <bindings>
                    <simple name="java:jboss/exported/test" value="500" type="int"/>
                </bindings>
                <remote-naming/>
            </subsystem>
  • It does not look like a reload should be required for this kind of update.
  • Is this behaviour of EAP6 as per the design ?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.