我使用Barcode4j和FOP生成一个包含条形码的PDF。它在我的Eclipse本地环境中工作得很好,但是在部署到weblogic并通过web访问该函数之后,我得到以下错误:
错误:“非静态Java函数'org.krysalis.barcode4j.xalan.BarcodeExt.generate(result-tree,结果树的第一个参数”不是有效的对象引用。致命错误:“无法编译样式表”
以下是样式表的部分:
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:barcode="org.krysalis.barcode4j.xalan.BarcodeExt"
extension-element-prefixes="barcode"
exclude-result-prefixes="fo">条形码生成:
<fo:instream-foreign-object>
<xsl:variable name="barcodeNumber">
<xsl:value-of select="barcodeNumber" />
</xsl:variable>
<xsl:variable name="barcode-cfg">
<barcode>
<intl2of5>
<height>18mm</height>
<module-width>0.28mm</module-width>
<human-readable><placement>none</placement>
</human-readable>
</intl2of5>
</barcode>
</xsl:variable>
<xsl:copy-of select="barcode:generate($barcode-cfg, $barcodeNumber)" />
我使用的是jdk 1.5.0_22,xalan-2.7.0,fop1.1
任何帮助都将不胜感激。
发布于 2014-03-10 10:19:30
如果为条形码扩展定义名称空间前缀,则还必须使用它。否则,Xalan就不会发现Java类是必需的。所以,写“条形码:条形码”,而不仅仅是条形码。
https://stackoverflow.com/questions/22052547
复制相似问题