You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Williams, Murray Todd" <mu...@merck.com> on 2000/03/02 20:31:47 UTC

Trying to get LDAP "Hello World" to work

I had incredible luck getting the SQL Processor.  I think I must have spent
all my karma in one shot.  I'm trying to get an LDAP example going now and
I'm getting a NullPointerException.  Unfortunately, I know very little about
LDAP (I'm trying to learn now) so I'm a bit lost in the lingo.  The
stacktrace I'm getting follows:

java.lang.NullPointerException
     at
org.apache.cocoon.processor.ldap.LdapProcessor.process(LdapProcessor.java:11
6)
     at org.apache.cocoon.Engine.handle(Engine.java:283)
     at org.apache.cocoon.Cocoon.service(Cocoon.java:145)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
     at
org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
     at org.apache.jserv.JServConnection.run(JServConnection.java:188)
     at java.lang.Thread.run(Thread.java:479)

The .xml file is very very simple (based on the example in the
documentation)...

<?xml version="1.0"?>
<?cocoon-process type="ldap"?>
<?cocoon-process type="xslt"?>
<?cocoon-format type="text/xml"?>

<?xml-stylesheet href="ldapExample.xsl" type="text/xsl"?>

<page title="LDAP Processor Example">

<ldap-defs>
   <ldap-server name="usrymx04">
     <initializer>com.sun.jndi.ldap.LdapCtxFactory</initializer>
     <ldap-serverurl>ldap://usrymx04.merck.com</ldap-serverurl>
   </ldap-server>
</ldap-defs>


<ldap-query server="usrymx04">
 sn=*madhukar*
</ldap-query>

</page>


And just to save some time, the line where the NullPointerException is
coming from is the last line (query_props.put(...)) in the following code
snippet.

NamedNodeMap query_attributes = query_element.getAttributes();
for (int j=0; j<query_attributes.getLength(); j++) {
  Node query_attribute = query_attributes.item(j);
 
query_props.put(query_attribute.getNodeName(),query_attribute.getNodeValue()
);
}

Would anyone be able to tell off the bat what I'm doing wrong?  Thanks a
billion!

Murray Todd Williams
Merck & Co., Inc.

Re: Trying to get LDAP "Hello World" to work

Posted by Ted <te...@gs2admin1.e-meet.com>.
Hope you have JNDI.jar installed.

Dr. Teddy Achacoso
GroupServe, Inc.

"Williams, Murray Todd" wrote:
> 
> I had incredible luck getting the SQL Processor.  I think I must have spent
> all my karma in one shot.  I'm trying to get an LDAP example going now and
> I'm getting a NullPointerException.  Unfortunately, I know very little about
> LDAP (I'm trying to learn now) so I'm a bit lost in the lingo.  The
> stacktrace I'm getting follows:
> 
> java.lang.NullPointerException
>      at
> org.apache.cocoon.processor.ldap.LdapProcessor.process(LdapProcessor.java:11
> 6)
>      at org.apache.cocoon.Engine.handle(Engine.java:283)
>      at org.apache.cocoon.Cocoon.service(Cocoon.java:145)
>      at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
>      at
> org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
>      at org.apache.jserv.JServConnection.run(JServConnection.java:188)
>      at java.lang.Thread.run(Thread.java:479)
> 
> The .xml file is very very simple (based on the example in the
> documentation)...
> 
> <?xml version="1.0"?>
> <?cocoon-process type="ldap"?>
> <?cocoon-process type="xslt"?>
> <?cocoon-format type="text/xml"?>
> 
> <?xml-stylesheet href="ldapExample.xsl" type="text/xsl"?>
> 
> <page title="LDAP Processor Example">
> 
> <ldap-defs>
>    <ldap-server name="usrymx04">
>      <initializer>com.sun.jndi.ldap.LdapCtxFactory</initializer>
>      <ldap-serverurl>ldap://usrymx04.merck.com</ldap-serverurl>
>    </ldap-server>
> </ldap-defs>
> 
> <ldap-query server="usrymx04">
>  sn=*madhukar*
> </ldap-query>
> 
> </page>
> 
> And just to save some time, the line where the NullPointerException is
> coming from is the last line (query_props.put(...)) in the following code
> snippet.
> 
> NamedNodeMap query_attributes = query_element.getAttributes();
> for (int j=0; j<query_attributes.getLength(); j++) {
>   Node query_attribute = query_attributes.item(j);
> 
> query_props.put(query_attribute.getNodeName(),query_attribute.getNodeValue()
> );
> }
> 
> Would anyone be able to tell off the bat what I'm doing wrong?  Thanks a
> billion!
> 
> Murray Todd Williams
> Merck & Co., Inc.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

Re: Trying to get LDAP "Hello World" to work

Posted by Raj Basavaraju <ra...@bidland.com>.
In order to get ldap sample to properly, make sure jndi.jar and providerutil.jar
files are visible in wrapper.classpath.  If you don't have these jar files
download them from javasoft web site.

Raj


"Williams, Murray Todd" wrote:

> I had incredible luck getting the SQL Processor.  I think I must have spent
> all my karma in one shot.  I'm trying to get an LDAP example going now and
> I'm getting a NullPointerException.  Unfortunately, I know very little about
> LDAP (I'm trying to learn now) so I'm a bit lost in the lingo.  The
> stacktrace I'm getting follows:
>
> java.lang.NullPointerException
>      at
> org.apache.cocoon.processor.ldap.LdapProcessor.process(LdapProcessor.java:11
> 6)
>      at org.apache.cocoon.Engine.handle(Engine.java:283)
>      at org.apache.cocoon.Cocoon.service(Cocoon.java:145)
>      at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
>      at
> org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
>      at org.apache.jserv.JServConnection.run(JServConnection.java:188)
>      at java.lang.Thread.run(Thread.java:479)
>
> The .xml file is very very simple (based on the example in the
> documentation)...
>
> <?xml version="1.0"?>
> <?cocoon-process type="ldap"?>
> <?cocoon-process type="xslt"?>
> <?cocoon-format type="text/xml"?>
>
> <?xml-stylesheet href="ldapExample.xsl" type="text/xsl"?>
>
> <page title="LDAP Processor Example">
>
> <ldap-defs>
>    <ldap-server name="usrymx04">
>      <initializer>com.sun.jndi.ldap.LdapCtxFactory</initializer>
>      <ldap-serverurl>ldap://usrymx04.merck.com</ldap-serverurl>
>    </ldap-server>
> </ldap-defs>
>
> <ldap-query server="usrymx04">
>  sn=*madhukar*
> </ldap-query>
>
> </page>
>
> And just to save some time, the line where the NullPointerException is
> coming from is the last line (query_props.put(...)) in the following code
> snippet.
>
> NamedNodeMap query_attributes = query_element.getAttributes();
> for (int j=0; j<query_attributes.getLength(); j++) {
>   Node query_attribute = query_attributes.item(j);
>
> query_props.put(query_attribute.getNodeName(),query_attribute.getNodeValue()
> );
> }
>
> Would anyone be able to tell off the bat what I'm doing wrong?  Thanks a
> billion!
>
> Murray Todd Williams
> Merck & Co., Inc.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Trying to get LDAP "Hello World" to work

Posted by Dirk-Willem van Gulik <di...@webweaving.org>.

On Thu, 2 Mar 2000, Williams, Murray Todd wrote:

> I had incredible luck getting the SQL Processor.  I think I must have spent
> all my karma in one shot.  I'm trying to get an LDAP example going now and

Your karma might be lacking. Just offer a few bytes from /dev/zero
to /dev/null and jndi.jar. You might also want to chant for its
friend in arms 'providerutil.jar'.

> org.apache.cocoon.processor.ldap.LdapProcessor.process(
	LdapProcessor.java:116)

Hmm, that line rings a bell. Now you might want to also be nice and do
something like

	searchbase="ou=mydept,o=someorg"

or something like that. Or perhaps with the L=.

Dw.