Hi,

When trying to bind rmi for JMXConnectorServer with carbon-jndi a
*javax.naming.NameNotFoundException:
Name [rmi://127.0.0.1:9999/jmxrmi <http://127.0.0.1:9999/jmxrmi>] is not
bound in this Context. Unable to find [rmi:]* throws.

This is thrown by the org.wso2.carbon.jndi.internal.impl.NamingContext  from
the method
 protected void bind(Name name, Object obj, boolean rebind) throws
NamingException {}

after execution of line

NamingEntry entry = (NamingEntry)this.bindings.get(name.get(0));

This is because the if(name.size() > 1) is true and subsequently  if(entry
== null) also becomes true since the binding aren't put to the bindings map
yet [1].

Ideally, shouldn't it be that if the entry is null, the object is wrapped
with a new NamingEntry [2] ?

[1]
 
https://github.com/wso2/carbon-jndi/blob/v1.0.2/components/org.wso2.carbon.jndi/src/main/java/org/wso2/carbon/jndi/internal/impl/NamingContext.java#L818
<https://github.com/wso2/carbon-jndi/blob/v1.0.2/components/org.wso2.carbon.jndi/src/main/java/org/wso2/carbon/jndi/internal/impl/NamingContext.java#L818>
[2]
https://github.com/wso2/carbon-jndi/blob/v1.0.2/components/org.wso2.carbon.jndi/src/main/java/org/wso2/carbon/jndi/internal/impl/NamingContext.java#L833


Thank you

Regards,
Asma

-- 
Asma Zinneera Jabir
Software Engineer
WSO2 Inc: http://wso2.com/
Contact No: +94 77 332 4752
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to