cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marian Steinbach <mar...@ds.fh-koeln.de>
Subject LDAP; Exception: java.lang.ClassCastException: [B
Date Mon, 03 Jul 2000 09:15:11 GMT
Hi!

I still have this problem with LDAP processing, so I try to pose the
question more clearly.

When I let cocoon process XSL pages using the LDAP processor I get the
following error message:

  Exception: java.lang.ClassCastException: [B

The page doesn´t show any result, only the page header ans the search filter
(value of ldap-query) appears in the page.

When I leave the search-base in my xml file empty, just like in the examples
coming with Cocoon, I get an error message from the LDAP server (code 32, no
such object...). This shows for me that LDAP the connection is correct.

Again, my platform:

- Tomcat Web Server/3.1 (JSP 1.1; Servlet 2.2; Java 1.3.0rc1; Windows 98
4.10 x86; java.vendor=Sun Microsystems Inc.)
- Cocoon 1.7.4
- jndi.jar, ldap.jar, providerutil.jar, ... in my classpath (passed via
tomcat.bat script on startup)


Thanks in advance for any hint!

Marian



Again, the XML and XSL files:

<!-- begin ldap.xml -->

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

<page>

  <ldap-defs>
    <ldap-server name="ratz">
      <initializer>com.sun.jndi.ldap.LdapCtxFactory</initializer>
      <ldap-serverurl>ldap://ratz.ds.fh-koeln.de:389</ldap-serverurl>
    </ldap-server>
    <ldap-querydefs name="standard" default="yes"/>     
  </ldap-defs>

  <ldap-query server="ratz" ldap-searchbase="ou=Design,o=Fachhochschule
Koeln,c=DE" defs="standard">
     givenname=Marian
  </ldap-query>
</page>

<!-- end ldap.xml -->




<!-- begin ldap.xsl -->

<?xml version="1.0"?>

<!-- <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"> -->

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="page">
   <xsl:processing-instruction
name="cocoon-format">type="text/html"</xsl:processing-instruction>
   <html>
    <head>
     <title>
      LDAP Search Results
     </title>
    </head>
    <body bgcolor="#ffffff">
     <xsl:apply-templates/>
    </body>
   </html>
  </xsl:template>

 <xsl:template match="searchresult">
        <table cellspacing="0" cellpadding="6">
     <xsl:apply-templates select="cn"/>
     <xsl:apply-templates select="currentorganization"/>
     <xsl:apply-templates select="mail"/>
     <xsl:apply-templates select="telephonenumber"/>
     <xsl:apply-templates select="securephonenumber"/>
        </table>
        <p/>
  </xsl:template>
 
 <xsl:template match="cn">
        <tr>
         <th bgcolor="tan" align="right">Common Name</th>
         <td>
      <xsl:apply-templates/>
         </td>
        </tr>
  </xsl:template>

 <xsl:template match="currentorganization">
        <tr>
         <th bgcolor="tan" align="right">Org</th>
         <td>
      <xsl:apply-templates/>
         </td>
        </tr>
  </xsl:template>

 <xsl:template match="telephonenumber">
        <tr>
         <th bgcolor="tan" align="right">Tel (work) #</th>
         <td>
      <xsl:apply-templates/>
         </td>
        </tr>
  </xsl:template>

 <xsl:template match="securephonenumber">
        <tr>
         <th bgcolor="tan" align="right">Secure #</th>
         <td>
      <xsl:apply-templates/>
         </td>
        </tr>
  </xsl:template>

 <xsl:template match="mail">
        <tr>
         <th bgcolor="tan" align="right">E-mail</th>
         <td>
      <a>
           <xsl:attribute name="href">
        mailto:<xsl:apply-templates/>
           </xsl:attribute>
       <xsl:apply-templates/>
          </a>
         </td>
        </tr>
  </xsl:template>

 <xsl:template match="comment">
<p>            
      <xsl:apply-templates/>
</p>
  </xsl:template>


</xsl:stylesheet>


<!-- end ldap.xsl -->

Mime
View raw message