You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ian Abbott <ia...@cinesite.co.uk> on 2000/03/23 17:44:49 UTC

Re: LDAP woes

Autobahn Internet Services wrote:
> 
> I've been really happy with cocoon so far (once I got Tomcat set up
> to work with it). The only thing I'm still tearing my hair out about
> is getting it to work with LDAP (RH6.1, latest Cocoon, Apache 1.3.9,
> latest OpenLDAP server). The server's there and responds to command
> line and JNDI requests. But somehow I keep getting this NullPointer
> exception:
> 

I kept getting this too, and I tried all manner of things including
shaking a dead chicken over the machine to get it to work. In the end,
after many attempts, I got it working. Now, I'm not sure if this is
because I recompiled Cocoon myself from a tarball on
http://xml.apache.org/from-cvs/, or whether I finally sorted out the
LDAP.XML file, though I'm sure recompilation wouldn't have any real
effect.

The problem seems to be conflicting information in the documentation and
the sample. I think the placement of searchbase is the most important
factor.

Anyway, here's the file that worked for me, running on Apache 1.3.12,
OpenLDAP, JServ 1.1, Cocoon 1.7.1-dev and SGI IRIX 6.5.7:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="phonebook.xsl"?>
<?cocoon-process type="ldap"?>
<?cocoon-process type="xslt"?>

<page>

 <ldap-defs>
  <ldap-server name="cinesite">
   <initializer>com.sun.jndi.ldap.LdapCtxFactory</initializer>
   <ldap-serverurl>ldap://LDAP.FQDN.GOES.HERE</ldap-serverurl>
  </ldap-server>
  <ldap-querydefs name="standard" default="yes"/>
 </ldap-defs>

 <ldap-query server="cinesite" ldap-searchbase="o=Cinesite,c=UK"
defs="standard">
   cn=*{@name}*
 </ldap-query>

</page>

I'll spare you the XSL sheet. Safe to say that calling
phonebook.xml?name=ia finds things fairly well. 

I knocked up a reasonable GUI to all of this and showed it to a
colleague, and all the while went 'and not a bit of code was needed!'. 

Thanks to all concerned. Cocoon is definitely making my life more
interesting.

Cheers
Ian