-
1. Re: $Proxy60 - returned by JBOSS JNDI Context
anandhakrishnank Jun 11, 2010 12:47 PM (in response to anandhakrishnank)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@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
-
2. Re: $Proxy60 - returned by JBOSS JNDI Context
anandhakrishnank Jun 15, 2010 6:51 AM (in response to anandhakrishnank)I had attached the sample application, and had commented on JNDITest Servlet source code. Please check and revert.
Output Screen:
~~~~~~~~~~~~~~~~~~~~~~~~///////////////~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~///////////////~~~~~~~~~~~~~~~~~~~~~~~
org.jnp.interfaces.NamingContext
org.jnp.interfaces.NamingContext@11c5342
{jnp.parsedName=, java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces}javax.naming.InitialContext@131a24c
$Proxy71
{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}
Typecasting
javax.naming.InitialContext@9e3fc2
{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:org.jboss.naming:org.jnp.interfaces}
~~~~~~~~~~~~~~~~~~~~~~~~///////////////~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~///////////////~~~~~~~~~~~~~~~~~~~~~~~Hope, Someone there to help me...
Thanks,
Anandhakrishnan
-
deploy.zip 6.2 KB
-
-
3. Re: $Proxy60 - returned by JBOSS JNDI Context
jaikiran Jun 15, 2010 7:05 AM (in response to anandhakrishnank)Are you packaging any jar files containing org.jboss.naming.* or org.jnp.* packages in your application? If yes, then remove such jars from your application packaging.
-
4. Re: $Proxy60 - returned by JBOSS JNDI Context
anandhakrishnank Jun 15, 2010 10:44 AM (in response to jaikiran)Hi,
Thanks for your information,
I don't have any single jar in my war file, All the required class are available by default in Jboss 4.2.3 GA version.
I got some these input from others discussion.
Thanks,
Anand