The Remote Naming (JNDI) is Read-Only, remote clients cannot bind or rebind objects into it. Only applications running in the same JVM can bind values into JNDI.
It looks like the server side logs the warning, but the client does not get an exception thrown back, bind and rebind should throw some javax.naming.NamingException since the bind/rebind operations are failing.
public static void main(String[] args) throws Exception { Context ctx = getInitialContext("localhost", 8080, "admin", "redhat1!"); ctx.bind("java:/reproducer", "reproducer"); ctx.rebind("java:/reproducer", "reproducer"); } public static Context getInitialContext(String host, Integer port, String username, String password) throws NamingException { Properties props = new Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory"); props.put(Context.PROVIDER_URL, String.format("%s://%s:%d", "remote+http", host, port)); if(username != null && password != null) { props.put(Context.SECURITY_PRINCIPAL, username); props.put(Context.SECURITY_CREDENTIALS, password); } return new InitialContext(props); }
13:20:22,804 WARN [org.wildfly.naming] (default task-2) WFNAM00036: Unexpected internal error: java.lang.UnsupportedOperationException: WFLYNAM0043: Naming context is read-only at org.jboss.as.naming.WritableServiceBasedNamingStore.requireOwner(WritableServiceBasedNamingStore.java:160) at org.jboss.as.naming.WritableServiceBasedNamingStore.bind(WritableServiceBasedNamingStore.java:66) at org.jboss.as.naming.NamingContext.bind(NamingContext.java:262) at org.jboss.as.naming.NamingContext.bind(NamingContext.java:289) at org.wildfly.naming.client.remote.RemoteServerTransport.handleBind(RemoteServerTransport.java:238) at org.wildfly.naming.client.remote.RemoteServerTransport$1.handleMessage(RemoteServerTransport.java:126) at org.jboss.remoting3.remote.RemoteConnectionChannel.lambda$handleMessageData$3(RemoteConnectionChannel.java:430) at org.jboss.remoting3.EndpointImpl$TrackingExecutor.lambda$execute$0(EndpointImpl.java:991) at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) at java.lang.Thread.run(Thread.java:748) 13:20:22,813 WARN [org.wildfly.naming] (default task-2) WFNAM00036: Unexpected internal error: java.lang.UnsupportedOperationException: WFLYNAM0043: Naming context is read-only at org.jboss.as.naming.WritableServiceBasedNamingStore.requireOwner(WritableServiceBasedNamingStore.java:160) at org.jboss.as.naming.WritableServiceBasedNamingStore.rebind(WritableServiceBasedNamingStore.java:108) at org.jboss.as.naming.NamingContext.rebind(NamingContext.java:301) at org.jboss.as.naming.NamingContext.rebind(NamingContext.java:309) at org.wildfly.naming.client.remote.RemoteServerTransport.handleBind(RemoteServerTransport.java:236) at org.wildfly.naming.client.remote.RemoteServerTransport$1.handleMessage(RemoteServerTransport.java:129) at org.jboss.remoting3.remote.RemoteConnectionChannel.lambda$handleMessageData$3(RemoteConnectionChannel.java:430) at org.jboss.remoting3.EndpointImpl$TrackingExecutor.lambda$execute$0(EndpointImpl.java:991) at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) at java.lang.Thread.run(Thread.java:748)
- clones
-
WFLY-13459 Remote Naming bind / rebind / unbind / rename / createSubcontext / destroySubcontext does not throw exception back to client
- Open
- incorporates
-
JBEAP-20878 (7.3.z) javax.naming.OperationNotSupportedException should be thrown when read-only remote naming operations failed
- Closed
-
JBEAP-20822 (7.3.z) WEJBHTTP-51 - Http Naming Client does not get root cause of failure of remote bind operation
- Closed
-
JBEAP-20882 (7.3.z) WFNC-60 - Remote Naming Client does not check NamingException wrapped in the response on bind
- Closed
- is cloned by
-
JBEAP-19478 [GSS](7.2.z) Remote Naming bind / rebind / unbind / rename / createSubcontext / destroySubcontext does not throw exception back to client
- Closed
- is incorporated by
-
JBEAP-20816 [GSS](7.3.z) Upgrade wildfly-http-client from 1.0.24.Final-redhat-00001 to 1.0.25.Final-redhat-00001
- Closed
-
JBEAP-20883 [GSS](7.3.z) Upgrade wildfly-naming-client from 1.0.13.Final-redhat-00001 to 1.0.14.Final-redhat-00001
- Closed