简体   繁体   English

XSLT在使用SAXON Java程序进行转换时无法找到SQL jar文件

[英]XSLT not able to find SQL jar files while Transformation using SAXON java Programme

I am doing Transformation of XML to DITA using XSLT and SAXON jar. 我正在使用XSLT和SAXON jar将XML转换为DITA。 Normally when I run my Java program in eclipse it working fine but when I create jar file of project and run XSLTL is not able to communicate SQL jar 通常,当我在Eclipse中运行Java程序时,它运行良好,但是当我创建项目的jar文件并运行XSLTL时,则无法通信SQL jar

<!-- SQL login -->
<xsl:param name="jdbc.driver" as="xsd:string" select="'com.mysql.jdbc.Driver'" />
<xsl:param name="jdbc.database" as="xsd:string" select="'jdbc:mysql://my URL:3306/mydb'" />
<xsl:param name="jdbc.user" as="xsd:string" select="'user'" />
<xsl:param name="jdbc.pass" as="xsd:string" select="'pass'" />

I have included saxon9pe.jar, mysql-connector-java-5.1.28.jar, resolver.jar in my classpath and its working fine from eclipse. 我在类路径中包含了saxon9pe.jar,mysql-connector-java-5.1.28.jar,resolver.jar,并且在eclipse中可以正常工作。

But my question is when i create jar of my project using maven and invoke the jar file as below 但是我的问题是当我使用maven创建项目的jar并按如下方式调用jar文件时

java -cp export-data-web-0.0.1-SNAPSHOT.jar com.deere.utils.XmlToDitaTransform

its not working or saye not able to communicate with sql jar file from xslt showing error 它无法正常工作或无法从xslt与sql jar文件通信,显示错误

<xsl:fallback>
    <xsl:message terminate="yes">Cannot access SQL database.</xsl:message>
</xsl:fallback>

您需要将撒克逊罐子放到类路径中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM