[jboss-user] [JNDI and Naming] - $Proxy60 - returned by JBOSS JNDI Context

Anand Krishnan do-not-reply at jboss.com
Fri Jun 11 12:47:57 EDT 2010


Anand Krishnan [http://community.jboss.org/people/anandhakrishnank] replied to the discussion

"$Proxy60 - returned by JBOSS JNDI Context"

To view the discussion, visit: http://community.jboss.org/message/547602#547602

--------------------------------------------------------------
I had come across the $proxy60, by using Context{line 3}, instead of InitialContext as given below:

/*[1]*/PrintWriter w = response.getWriter();
/*[2]*/NamingContext envCtx = (NamingContext) intialCtx.lookup("java:");
/*[3]*/Context ldapCtx = (Context) envCtx.lookup("external/ldap/jboss");
/*[4]*/InitialContext initialContext = new InitialContext(ldapCtx.getEnvironment());
/*[5]*/w.println(initialContext.toString()+"<br/>");
/*[6]*/w.println(initialContext.getEnvironment());


{line 5 prints :}
javax.naming.InitialContext at 1cece51
{line 6 prints :}
{java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces}


I need to convert this object to LocalOnlyContextFactory, thats how I could use in my application.
Please suggest!

If try type-casting, it gives ClassCastException:
LocalOnlyContextFactory typeCtx =(LocalOnlyContextFactory)ldapctx;{ldapCtx from line:3}

Please suggest solution to get the right context to use in my application.

Thanks,
Anand

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/547602#547602]

Start a new discussion in JNDI and Naming at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100611/dd657c0f/attachment.html 


More information about the jboss-user mailing list