IBM Support

CORBA.IMPLIMIT Context is Read Only exception

Troubleshooting


Problem

org.omg.CORBA.IMP_LIMIT: Context is Read Only when trying to add a configured JNDI name to the name space.

Symptom

If a server scoped configured binding is created, that has a common intermediate context as any Resource Manager resource, then the naming operation will fail with a WriteProtectedContextException:

[8/20/14 23:45:18:511 EDT] 0000000a Helpers W NMSV0610I: A
NamingException is being thrown from a javax.naming.Context
implementation. Details follow:
Context implementation: com.ibm.ws.naming.jndicos.CNContextImpl
Context method: createSubcontext
Context name: WPSNetwork/clusters/dev2.a.AppTarget
Target name: com/ibm
Other data: ""
Exception stack trace:
com.ibm.websphere.naming.WriteProtectedContextException: The target
context for this operation on the name "com/ibm" from the context
"WPSNetwork/clusters/dev2.a.AppTarget"is a read-only context. [Root
exception is org.omg.CORBA.IMP_LIMIT: Context is Read Only, Primary
Name=WPSNetwork/clusters/dev2\.a\.AppTarget/com vmcid: 0x49421000
minor code: 82 completed: No]
at com.ibm.ws.naming.jndicos.CNContextImpl.mapIMP_LIMIT(CNContextImpl.java:
4878)
at com.ibm.ws.naming.jndicos.CNContextImpl.doCreateSubcontext(CNContextImpl
.java:2874)
at com.ibm.ws.naming.jndicos.CNContextImpl.createSubcontext(CNContextImpl.j
ava:971)
at com.ibm.websphere.naming.JndiHelper.createSubcontexts(JndiHelper.java:31
2)
...
Caused by: org.omg.CORBA.IMP_LIMIT: Context is Read Only, Primary
Name=WPSNetwork/clusters/dev2\.a\.AppTarget/com vmcid: 0x49421000
minor code: 82 completed: No
at com.ibm.ws.naming.distcos.ReadOnlyNC.do_bind_new_corba_context(ReadOnlyN
C.java:173)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.bind_new_corba_cont
ext(WsnOptimizedNamingImplBase.java:2023)
at com.ibm.WsnOptimizedNaming._NamingContextStub.bind_new_corba_context(_Na
mingContextStub.java:472)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosBindNewContext(CNContextImpl.
java:4295)
at com.ibm.ws.naming.jndicos.CNContextImpl.doCreateSubcontext(CNContextImpl
.java:2852)

Cause

This exception occurs when a JNDI name is configured with a name that would cause it to map to an intermediate context. Intermediate contexts created for a configured binding are read-only.

For more details, see Configured name bindings in the information center.

What is an intermediate context? If an EJB home binding is configured with the name some/compound/name/ejbHome, the intermediate contexts some, some/compound, and some/compound/name. These will be created as read-only contexts. You cannot add, update, or
remove any read-only bindings.

Here is what happens during application server startup:

  1. Initialize Name Server
    1. Name space is created

    2. Configured bindings are processed (note that cell, node, and server scoped configured binding are bound to different parts of the name space tree and therefore do not affect one another)

  2. Initialize Resource Manager service
    1. Binds configured resources (for example, JDBC data sources, JMS QCF and queues, JavaMail sessions, and so on) to the server root, which is the same place a server scoped configured binding would be bound

So obviously names that start with "cell", "cells", "clusters", "servers", and so on should not be used (Note: Except for "cell", most of these other names can be used, depending on there they
are used, but it is best to just not use them at all).

The other source of read only names are the intermediate contexts of name space bindings. These names (contexts) are not "reserved", but in the current implementation they are read only and
thus cannot be used for like named resources. Best practice is to prefix the JNDI name of name space bindings with a unique prefix, separate and distinct from any resource JNDI names.

Diagnosing The Problem

For example, the jndiName attribute of all the ejbBindings elements of the config/cells/CATOECOMAPP/applications/IBMEAR.ear/deployments/IBMEAR/
IBMEJB.jar/META-INF/ibm-ejb-jar-bnd.xmi file starts with
"cell/clusters/ibmejbcluster/", which is part of the R/O section of WebSphere's global JNDI name space.

For example:

<ejbBindings xmi:id="EnterpriseBeanBinding_1051637943127"
jndiName="cell/clusters/ibmejbcluster/Wallet">
<enterpriseBean xmi:type="com.ibm.etools.ejb:Entity"
href="META-INF/ejb-jar.xml#Wallet"/>
</ejbBindings>

The prefix,cell/clusters/ibmejbcluster , is what is causing the CORBA.IMPLIMIT Context is Read Only exception.

Resolving The Problem

If a server scoped configured binding is created that has a common intermediate context as any Resource Manager resource, then the naming operation will fail with a WriteProtectedContextException.

This is currently a limitation. It is recommended, at least for server scoped configured bindings, such as an EJB binding, that any intermediate contexts in the JNDI name of any configured binding be unique (for example, not start with any common resource prefix like jdbc/, jms/, and so on).

It is also not recommend to use configured bindings as a way to override resource bindings. You can use the resource scoping mechanism to override a default (cell or node) with a server specific definition.

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"JNDI\/Naming","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.0;8.5.5;8.0;7.0","Edition":"Base;Network Deployment","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SS7K4U","label":"WebSphere Application Server for z\/OS"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":null,"Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"7.0;6.1;6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21398579