ClassNotFoundException:org.apache.xml.serializer.TreeWalker

时间:2012-05-04 21:21:11

标签: xml tomcat tree xmlspy

我用xml数据库编写了一个简单的应用程序& appache tomcat。我工作得很好,直到我打开它时试图拉开工作区。之后我随时尝试创建tomcat服务器,我收到此错误:

  

ClassNotFoundException: org.apache.xml.serializer.TreeWalker

所以我离开了。现在我正在研究xmlspy,尝试使用tomcat FO引擎生成pdf文件。我安装了新的tomcat&在xmlspy中指出了这一点。现在,当我尝试在xmlspy中运行fo时,我收到以下错误。

注意:serializer.jar& xalan jar文件已经在lib文件夹中。

log4j:WARN No appenders could be found for logger (org.apache.fop.util.ContentHandlerFactoryRegistry).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xml/serializer/TreeWalker
  at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:823)
  at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:278)
  at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:130)
  at org.apache.fop.cli.Main.startFOP(Main.java:174)
  at org.apache.fop.cli.Main.main(Main.java:205)
Caused by: java.lang.ClassNotFoundException: org.apache.xml.serializer.TreeWalker
  at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
  ... 5 more

2 个答案:

答案 0 :(得分:1)

好的,我解决了这个问题。在JRE中,xiling包(如果我的名字是对的)有问题。已安装新的JRE,现在运行正常。感谢。

答案 1 :(得分:1)

以下帮助我:

System.setProperty("javax.xml.transform.TransformerFactory", "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");