]
Lin Gao reassigned WFLY-14311:
------------------------------
Assignee: Sudeshna Sur (was: Lin Gao)
javax.naming.OperationNotSupportedException should be thrown when
read-only remote naming operations failed
-----------------------------------------------------------------------------------------------------------
Key: WFLY-14311
URL:
https://issues.redhat.com/browse/WFLY-14311
Project: WildFly
Issue Type: Bug
Components: Naming
Reporter: Lin Gao
Assignee: Sudeshna Sur
Priority: Major
Labels: downstream_dependency
Fix For: 23.0.0.Beta1
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.
When modifying methods like: bind/rebind/unbind/rename/createSubContext/destroySubContext
are invoked from remote client, it expects *javax.naming.OperationNotSupportedException*
thrown out, but *java.lang.UnsupportedOperationException* is thrown out.
{code:java}
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)
{code}
From EE Platform spec: EE.5.3.4 Java EE Product Provider's Responsibilities:
{quote}
The container must ensure that the application component instances have only read access
to their naming context. The container must throw the
*javax.naming.OperationNotSupportedException* from all the methods of the
javax.naming.Context interface that modify the environment naming context and its
subcontexts.
{quote}
For more information and reproducer, please refer to WFLY-13459