commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luke Shannon" <lshan...@hypermedia.com>
Subject Digester Help
Date Tue, 09 Nov 2004 16:39:55 GMT

I new to Digester and am having a little trouble. I am trying to parse an XML document to
create a Lucene document. I get the following error when I run my digest method:

Below the error is my code and the XML document I am trying to parse. What am I doing wrong?

Thanks,

Luke

INFO: Server startup in 8202 ms

Nov 9, 2004 11:26:42 AM org.apache.commons.digester.Digester endElement

SEVERE: End event threw error

java.lang.NoClassDefFoundError: org/apache/commons/beanutils/MethodUtils

at org.apache.commons.digester.CallMethodRule.end(CallMethodRule.java:585)

at org.apache.commons.digester.Rule.end(Rule.java:228)

at org.apache.commons.digester.Digester.endElement(Digester.java:1067)

at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

at org.apache.commons.digester.Digester.parse(Digester.java:1556)

at model.XMLParser.digest(XMLParser.java:40)

at model.XMLDocument.Document(XMLDocument.java:68)

at servlets.Update.indexDocs(Update.java:124)

at servlets.Update.indexDocs(Update.java:108)

at servlets.Update.doGet(Update.java:81)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)

at java.lang.Thread.run(Unknown Source)


public class XMLParser {
 
 public Vector items;
 private Digester digester;
 private File parseMe;
 
 public XMLParser(File file) {
  parseMe = file;
  items = new Vector();
 }
 
 public XMLParser digest() throws IOException, SAXException {
  digester = new Digester();
  digester.push(this);
  digester.setValidating(false);
  digester.addObjectCreate("DATA/VERSION/ITEM", Item.class);
  digester.addCallMethod("DATA/VERSION/ITEM", "setItem", 0);
  digester.addSetNext("DATA/VERSION/ITEM", "addItems");
  return (XMLParser)digester.parse(parseMe);  
 }
 
 public void addItems(Item i) {
  items.add(i);
 } 
}

The XML document:

<?xml version="1.0" encoding="UTF-8"?>
<DATA>
   <DEF>
      <TYPE>138</TYPE>
      <TYPES/>
   </DEF>
   <VERSION>
      <ITEM NAME="provider" TYPE="text">me</ITEM>
      <ITEM NAME="progress_ref" TYPE="text">1098818760440</ITEM>
      <ITEM NAME="name" TYPE="text">file1folder1</ITEM>
      <ITEM NAME="desc" TYPE="text">rg</ITEM>
      <ITEM NAME="select" TYPE="text">Please Select...</ITEM>
      <ITEM NAME="poster" TYPE="text">test</ITEM>
      <ITEM NAME="sort" TYPE="text">3</ITEM>
      <ITEM DIR="apache_config_command.txt" HEIGHT="-1" NAME="kcfileupload" SIZE="942"
STYPE="file" TYPE="upload" WIDTH="-1">apache_config_command.txt</ITEM>
   </VERSION>
</DATA>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message