Index: NamingContext.java =================================================================== RCS file: /cvsroot/jboss/jnp/src/main/org/jnp/interfaces/NamingContext.java,v retrieving revision 1.36 diff -u -r1.36 NamingContext.java --- NamingContext.java 20 Nov 2004 03:31:58 -0000 1.36 +++ NamingContext.java 16 Dec 2004 07:32:31 -0000 @@ -428,6 +428,9 @@ Name parsedName = (Name) refEnv.get(JNP_PARSED_NAME); if( parsedName != null ) name = parsedName; + + obj = NamingManager.getStateToBind ( obj, name, this, refEnv ); + try { String className; @@ -478,6 +481,8 @@ if( parsedName != null ) name = parsedName; + obj = NamingManager.getStateToBind ( obj, name, this, refEnv ); + try { String className; @@ -563,7 +568,8 @@ if (res instanceof MarshalledValuePair) { MarshalledValuePair mvp = (MarshalledValuePair) res; - return mvp.get(); + + return dereference( mvp.get(), name, refEnv ); } else if(res instanceof MarshalledObject) { @@ -671,6 +677,22 @@ } } + private Object dereference (Object obj, Name name, Hashtable env) throws NamingException + { + try + { + return NamingManager.getObjectInstance (obj, name, this, env); + } catch (NamingException e) + { + throw e; + } catch (Exception e) + { + NamingException ex = new NamingException ("Could not dereference object"); + ex.setRootCause(e); + throw ex; + } + } + public void unbind (String name) throws NamingException {