I followed the directions in the documentation for federating LDAP into the JNDI context -- everything appears to have worked properly, as I can view the contents of the directory via the JNDIView MBean.
(suggestion: can we limit how many entries show up there? Our directory has 50,000+ entries---this page either takes forever to load, or causes the MBean to throw an OutOfMemoryException)
Does anybody have any example of how I can get the DirContext so that I can search the LDAP directory? I've tried it like this:
ldapCtx = (DirContext)ctx.lookup("external/ldap/EDS");
(I later use ldapCtx.search(....) to retrieve entries from the directory) This works successfully when I bind manually to the LDAP server from within my cilent code (in a stateless session bean), but it would be nice to use federated JNDI so I don't have to manage the binding code from within the bean.
When I run the client app, I get this exception:
Exception in thread "main" java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.io.WriteAbortedException: Writing aborted by exception; java.io.NotSerializableException: com.sun.jndi.ldap.LdapCtx
java.io.WriteAbortedException: Writing aborted by exception; java.io.NotSerializableException: com.sun.jndi.ldap.LdapCtx
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:445)
at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2262)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:519)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1411)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:212)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invoke(Unknown Source)
at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:357)
at org.jboss.ejb.plugins.jrmp.interfaces.StatelessSessionProxy.invoke(StatelessSessionProxy.java:123)
at $Proxy1.findUserBySystemLogonId(Unknown Source)
at Client.main(Client.java:28)
Am I supposed to cast to a different type? Any ideas?
Thanks,
Jason
- Re: [JBoss-user] search LDAP via federated JNDI VASQUEZ_JASON
- Re: [JBoss-user] search LDAP via federated JNDI Scott M Stark
- Re: [JBoss-user] search LDAP via federated JNDI VASQUEZ_JASON
- Re: [JBoss-user] search LDAP via federated JNDI Scott M Stark
- [JBoss-user] How to specify resource db in cm... Jordi Fernandez
- Re: [JBoss-user] search LDAP via federated JNDI VASQUEZ_JASON
