Hi,
I have an mbean which creates ldap-contexts. Definition of the mbean is:
<mbean code="org.jboss.naming.ExternalContext" name=":service=ExternalContext,jndiName=ldap/main" > <attribute name="JndiName">ldap/main</attribute> <attribute name="Properties">ldap.properties</attribute> <attribute name="InitialContext"> javax.naming.ldap.InitialLdapContext</attribute> <attribute name="RemoteAccess">true</attribute> </mbean>
LdapContext ctx = (LdapContext)new InitialContext().lookup( "ldap/main" );
javax.naming.NotContextException: Not an instance of DirContext at javax.naming.directory.InitialDirContext.getURLOrDefaultInitDirCtx(Unknown Source) at javax.naming.directory.InitialDirContext.search(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.jboss.naming.ExternalContext$CachedContext.invoke(ExternalContext.java:538) at $Proxy39.search(Unknown Source)