当前位置: 首页 > 知识库问答 >
问题:

找不到SAX2驱动程序类

冯育
2023-03-14

我正在开发一个java web应用程序,它使用Jasper report来显示一些报表。现在我的版本发生了一些变化,我得到了以下错误:

net.sf.jasperreports.engine.JRRuntimeException: java.io.IOException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
at net.sf.jasperreports.renderers.BatikRenderer.ensureSvg(BatikRenderer.java:229)
at net.sf.jasperreports.renderers.BatikRenderer.ensureSvg(BatikRenderer.java:239)
at net.sf.jasperreports.renderers.BatikRenderer.getDimension(BatikRenderer.java:157)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportImage(JRPdfExporter.java:1434)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:854)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:818)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:695)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:396)
at net.sf.jasperreports.engine.JasperExportManager.exportToPdfStream(JasperExportManager.java:191)
at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfStream(JasperExportManager.java:527)

我认为错误可能是由于构建路径造成的。这是我的依赖树:

    [INFO] ------------------------------------------------------------------------
[INFO] Building vaadin-webapp-billing 2.3.7-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ vaadin-webapp-billing ---
[INFO] it.mycompany:vaadin-webapp-billing:war:2.3.7-SNAPSHOT
[INFO] +- it.mycompany:services-billing:jar:2.3.7-SNAPSHOT:compile
[INFO] |  +- it.mycompany:util-billing:jar:2.3.7-SNAPSHOT:compile
[INFO] |  |  +- it.mycompany:model-billing:jar:2.3.7-SNAPSHOT:compile
[INFO] |  |  |  +- org.eclipse.persistence:org.eclipse.persistence.jpa:jar:2.5.1:compile
[INFO] |  |  |  |  +- org.eclipse.persistence:javax.persistence:jar:2.1.0:compile
[INFO] |  |  |  |  +- org.eclipse.persistence:org.eclipse.persistence.asm:jar:2.5.1:compile
[INFO] |  |  |  |  +- org.eclipse.persistence:org.eclipse.persistence.antlr:jar:2.5.1:compile
[INFO] |  |  |  |  +- org.eclipse.persistence:org.eclipse.persistence.jpa.jpql:jar:2.5.1:compile
[INFO] |  |  |  |  \- org.eclipse.persistence:org.eclipse.persistence.core:jar:2.5.1:compile
[INFO] |  |  |  +- org.eclipse.persistence:eclipselink:jar:2.5.1:compile
[INFO] |  |  |  |  \- org.eclipse.persistence:commonj.sdo:jar:2.1.1:compile
[INFO] |  |  |  \- com.oracle:ojdbc14:jar:14.0.0:compile
[INFO] |  |  +- org.apache.poi:poi-ooxml:jar:3.7:compile
[INFO] |  |  |  +- org.apache.poi:poi:jar:3.7:compile
[INFO] |  |  |  +- org.apache.poi:poi-ooxml-schemas:jar:3.7:compile
[INFO] |  |  |  |  \- org.apache.xmlbeans:xmlbeans:jar:2.3.0:compile
[INFO] |  |  |  \- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  |  +- com.lowagie:itext:jar:2.1.7.js1:compile
[INFO] |  |  \- it.mycompany:vaadin-common-component:jar:1.0.0:compile
[INFO] |  |     \- org.springframework.data:spring-data-jpa:jar:1.2.0.RELEASE:compile
[INFO] |  |        +- org.springframework.data:spring-data-commons-core:jar:1.4.0.RELEASE:compile
[INFO] |  |        \- org.slf4j:jcl-over-slf4j:jar:1.6.1:runtime
[INFO] |  +- org.springframework:spring-aop:jar:4.1.4.RELEASE:compile
[INFO] |  |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  +- org.springframework:spring-aspects:jar:4.1.4.RELEASE:compile
[INFO] |  |  \- org.aspectj:aspectjweaver:jar:1.8.4:compile
[INFO] |  +- org.springframework:spring-beans:jar:4.1.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-context:jar:4.1.4.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-expression:jar:4.1.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-context-support:jar:4.1.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-core:jar:4.1.4.RELEASE:compile
[INFO] |  |  \- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  +- org.springframework:spring-jdbc:jar:4.1.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-orm:jar:4.1.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-tx:jar:4.1.4.RELEASE:compile
[INFO] |  +- org.springframework:spring-web:jar:4.1.4.RELEASE:compile
[INFO] |  +- org.aspectj:aspectjrt:jar:1.7.1:compile
[INFO] |  +- org.aspectj:aspectjtools:jar:1.7.1:compile
[INFO] |  +- net.sf.jasperreports:jasperreports:jar:5.0.0:compile
[INFO] |  |  +- commons-beanutils:commons-beanutils:jar:1.8.0:compile
[INFO] |  |  +- commons-digester:commons-digester:jar:2.1:compile
[INFO] |  |  +- jfree:jcommon:jar:1.0.15:compile
[INFO] |  |  +- jfree:jfreechart:jar:1.0.12:compile
[INFO] |  |  +- xml-apis:xml-apis:jar:1.3.02:compile
[INFO] |  |  +- org.codehaus.castor:castor:jar:1.2:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-core:jar:2.0.5:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.0.5:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-annotations:jar:2.0.5:compile
[INFO] |  +- net.sf.jasperreports:jasperreports-fonts:jar:4.0.0:compile
[INFO] |  +- commons-io:commons-io:jar:2.4:compile
[INFO] |  +- net.sf.barcode4j:barcode4j:jar:2.1:compile
[INFO] |  |  +- avalon-framework:avalon-framework-impl:jar:4.2.0:compile
[INFO] |  |  +- commons-cli:commons-cli:jar:1.0:compile
[INFO] |  |  \- org.apache.ant:ant:jar:1.7.1:compile
[INFO] |  |     \- org.apache.ant:ant-launcher:jar:1.7.1:compile
[INFO] |  +- org.codehaus.groovy:groovy-all:jar:2.2.1:compile
[INFO] |  +- it.mycompany.fonts:custom-fonts-jasper:jar:1.0:compile
[INFO] |  +- net.sourceforge.barbecue:barbecue:jar:1.5-beta1:compile
[INFO] |  +- batik:batik-bridge:jar:1.6-1:compile
[INFO] |  |  +- batik:batik-gvt:jar:1.6-1:compile
[INFO] |  |  |  \- batik:batik-awt-util:jar:1.6-1:compile
[INFO] |  |  |     \- batik:batik-util:jar:1.6-1:compile
[INFO] |  |  |        \- batik:batik-gui-util:jar:1.6-1:compile
[INFO] |  |  |           \- batik:batik-ext:jar:1.6-1:compile
[INFO] |  |  |              \- xml-apis:xmlParserAPIs:jar:2.0.2:compile
[INFO] |  |  +- batik:batik-script:jar:1.6-1:compile
[INFO] |  |  |  \- rhino:js:jar:1.5R4.1:compile
[INFO] |  |  \- batik:batik-svg-dom:jar:1.6-1:compile
[INFO] |  |     +- batik:batik-dom:jar:1.6-1:compile
[INFO] |  |     |  +- batik:batik-css:jar:1.6-1:compile
[INFO] |  |     |  \- batik:batik-xml:jar:1.6-1:compile
[INFO] |  |     \- batik:batik-parser:jar:1.6-1:compile
[INFO] |  +- xerces:xercesImpl:jar:2.9.0:compile
[INFO] |  +- org.springframework.data:spring-data-jdbc-core:jar:1.0.0.RELEASE:compile
[INFO] |  |  \- org.springframework.retry:spring-retry:jar:1.0.0.RELEASE:compile
[INFO] |  +- org.springframework.data:spring-data-oracle:jar:1.0.0.RELEASE:compile
[INFO] |  +- com.google.collections:google-collections:jar:1.0:compile
[INFO] |  +- net.sf.opencsv:opencsv:jar:2.0:compile
[INFO] |  +- it.mycompany:csv-validator:jar:1.0.0:compile
[INFO] |  +- javax.mail:mail:jar:1.4.7:compile
[INFO] |  |  \- javax.activation:activation:jar:1.1:compile
[INFO] |  +- com.sun.xml.bind:jaxb-xjc:jar:2.2.5:compile
[INFO] |  \- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] +- com.vaadin:vaadin-bom:pom:7.5.5:import
[INFO] +- com.vaadin:vaadin-client:jar:7.5.5:provided
[INFO] |  +- com.vaadin:vaadin-shared:jar:7.5.5:compile
[INFO] |  |  +- com.vaadin.external.flute:flute:jar:1.3.0.gg2:compile
[INFO] |  |  +- com.vaadin.external.streamhtmlparser:streamhtmlparser-jsilver:jar:0.0.10.vaadin1:compile
[INFO] |  |  \- com.vaadin.external.google:guava:jar:16.0.1.vaadin1:compile
[INFO] |  +- org.w3c.css:sac:jar:1.3:compile
[INFO] |  +- javax.validation:validation-api:jar:1.0.0.GA:provided
[INFO] |  \- javax.validation:validation-api:jar:sources:1.0.0.GA:provided
[INFO] +- com.vaadin:vaadin-server:jar:7.5.5:compile
[INFO] |  +- com.vaadin:vaadin-sass-compiler:jar:0.9.12:compile
[INFO] |  \- org.jsoup:jsoup:jar:1.8.1:compile
[INFO] +- com.vaadin:vaadin-themes:jar:7.5.5:compile
[INFO] +- org.vaadin.addon:easyuploads:jar:7.4.2:compile
[INFO] |  \- org.vaadin:viritin:jar:1.35:compile
[INFO] |     +- org.vaadin.addon:confirmdialog:jar:2.1.2:compile
[INFO] |     +- org.commonjava.googlecode.markdown4j:markdown4j:jar:2.2-cj-1.0:compile
[INFO] |     +- org.apache.commons:commons-lang3:jar:3.3.2:compile
[INFO] |     \- javax.el:javax.el-api:jar:2.2.4:compile
[INFO] +- org.vaadin.addons:wizards-for-vaadin:jar:1.1.0:compile
[INFO] +- org.vaadin.addons:filteringtable:jar:0.9.13.v7:compile
[INFO] |  \- org.vaadin.addons:popupbutton:jar:2.5.0:compile
[INFO] +- com.vaadin:vaadin-push:jar:7.5.5:compile
[INFO] |  \- com.vaadin.external.atmosphere:atmosphere-runtime:jar:2.2.7.vaadin1:compile
[INFO] |     \- com.vaadin.external.slf4j:vaadin-slf4j-jdk14:jar:1.6.1:compile
[INFO] +- com.vaadin.addon:vaadin-charts:jar:1.1.7:compile
[INFO] |  \- com.google.code.gson:gson:jar:2.2:compile
[INFO] +- ru.xpoft.vaadin:spring-vaadin-integration:jar:3.1:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.7:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:3.0.1:provided
[INFO] +- org.iban4j:iban4j:jar:2.1.1:compile
[INFO] \- com.google.code.maven-scm-provider-svnjava:maven-scm-provider-svnjava:jar:2.0.6:compile
[INFO]    +- org.apache.maven.scm:maven-scm-provider-svn-commons:jar:1.8:compile
[INFO]    |  \- org.apache.maven.scm:maven-scm-api:jar:1.8:compile
[INFO]    +- org.tmatesoft.svnkit:svnkit:jar:1.7.8:compile
[INFO]    |  +- org.tmatesoft.sqljet:sqljet:jar:1.1.6:compile
[INFO]    |  |  \- org.antlr:antlr-runtime:jar:3.4:compile
[INFO]    |  +- de.regnis.q.sequence:sequence-library:jar:1.0.2:compile
[INFO]    |  \- com.trilead:trilead-ssh2:jar:1.0.0-build215:compile
[INFO]    +- net.java.dev.jna:jna:jar:3.2.2:compile
[INFO]    +- org.codehaus.plexus:plexus-utils:jar:3.0.14:compile
[INFO]    \- commons-lang:commons-lang:jar:2.6:compile

你能给我一些关于这个错误的建议吗?

共有1个答案

王兴腾
2023-03-14

SAX2驱动程序类org.apache.xerces.parsers.SAXParser位于xerces-2.9.0.jar文件中。

当您启动web应用程序时,检查它是否在您的类路径中,如果不存在,只需添加它。

还要检查您包含的某些依赖项是否必须声明为provided,这意味着它们已经存在于您的应用程序服务器库文件夹中,因为可能存在版本冲突。

 类似资料:
  • 问题内容: 输出 >无法连接到数据库服务器java.lang.ClassNotFoundException 问题答案: 看来您应该将MySQL驱动程序jar放入 类路径中 。

  • 问题内容: 我刚刚用Apache,MySQL和PHP安装了Debian Lenny,并且收到了PDOException 。 这是它所指的特定代码行: ,,,和是我所定义的常量。它在生产服务器(以及我以前的Ubuntu Server设置)上运行良好。 这与我的PHP安装有关吗? 搜索互联网没有帮助,我得到的只是专家交流和示例,但没有解决方案。 问题答案: 您需要有一个名为pdo_mysql的模块。在

  • 问题内容: 我在只能访问MySQL和FTP的服务器上开发网站,因此我运行的所有命令都是通过b374k php shell进行的。我在使用SQL驱动程序时遇到Laravel问题。我尝试切换到文件托管的SQLite(在database / database.sqlite中),但是引发的异常与使用MySQL时相同。控制台的输入和输出如下: 服务器上安装的Apache扩展为: 可能是什么问题,我该如何解决

  • 因此,我一直在使用sbt with assembly将所有依赖项打包到一个jar中,用于spark工作。我做了几个工作,使用设置连接池信息,将其广播出去,然后在RDD上使用获取连接,并将数据插入数据库。在我的sbt构建脚本中,我包括 这确保JDBC连接器与作业打包在一起。一切都很好。 因此,最近我开始使用SparkSQL,并意识到使用中的新特性,简单地获取一个dataframe并将其保存到jdbc

  • 我正在一个服务器上开发一个网站,我只能访问MySQL和FTP,所以我运行的所有命令都是通过b374k php shell。我遇到了SQL驱动程序的Laravel问题。我尝试切换到文件托管的SQLite(在database/database.SQLite中),但引发的异常与使用MySQL时相同。控制台的输入输出如下: 服务器上安装的Apache扩展包括: 问题可能是什么?我如何修复它?(我没有访问根

  • 问题内容: 我是java和数据库连接的新手,我试图与oracle数据库建立非常简单的连接。当我运行此代码时: 我得到了输出。我正在使用Eclipse Helios,并且已将其添加到构建路径中(我仔细检查了第一件事),并且正在使用JDK 1.6。 问题答案: 检查.jar是否也在您的运行路径上。在eclipse中,转到运行->运行配置->选择配置->类路径选项卡。如果您的jar不在右侧选择“添加ja