xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sascha M┬čller <sascha.muel...@fh-koeln.de>
Subject Re: Simple help on Cocoon DCP-classes
Date Mon, 17 Jan 2000 17:06:44 GMT
Ricardo Rocha wrote:
> 
> Hello,
> > i am trying around with Cocoon1.5 + JServ on Linux and on WinNT.
> > Where  do i have to put the classpath-information for my self-written
> > DCP-Class. In the cocoon.properties (wrapper.classpath=) or in the
> > zone.properties or somewhere else?
> > I think it is the cocoon.properties. But when i insert my class, i got a
> > NoClassDefFoundError: org/apache/cocoon/dcp/ServletDCPProcessor
> > in jserv.log
> 
> It should be in the jserv.properties' wrapper.classpath section
> (note it's _not_ cocoon.properties nor zone.properties).

Sorry, i am confuesd. It was i the jserv.properties (not cocoon) and
then the NoClassDefFoundError comes up.
If it is not in the classpath i get a different Error (DCP Error:..could
not find class; it is part of the response page).
With CodeWarrior i build a DCPTest.jar file from
DCPTest.java

this is my class: (i saw it working one time on my machine at home, but
now it does not!)

package de.fhkoeln.zam.example;
import java.util.*;
import java.text.*;
import org.w3c.dom.*;
import javax.servlet.http.*;
import org.apache.cocoon.dcp.*;


public class DCPTest extends ServletDCPProcessor {

  public String getDocTyp() 
  {
    Enumeration e = this.request.getParameterNames();

    if (!e.hasMoreElements()) { // No parameters given, remove node from
document
      return null;
    }
    int count;
    for (count = 0; e.hasMoreElements(); count++) {
      String name = (String) e.nextElement();
      String[] values = this.request.getParameterValues(name);
                if (name.equals("doctyp"))
                {
                return values[0];
                }
        }
        return null;
  }

    public String getSystemDate(Dictionary parameters) {
    Date now = new Date();
    String formattedDate = now.toString();
    String format = (String) parameters.get("format");

    if (format != null) {
      try {
        SimpleDateFormat dateFormat = new SimpleDateFormat(format);
        formattedDate = dateFormat.format(now);
      } catch (Exception e) { } // Bad format, ignore and return default
    }

    return formattedDate;
  }
}

Any Idea why there comes up a ClassDefFoundError

> 
> This kind of question probably belongs to the Cocoon mailing
> list, btw :-)
> 
> Regards,
> 
> Ricardo

Mime
View raw message