0

Barcode4j と FOP を使用して、バーコードを含む PDF を生成しています。私の Eclipse ローカル環境では完璧に動作しますが、weblogic にデプロイし、web 経由で関数にアクセスした後、次のエラーが発生します。

エラー: '非静的 Java 関数 'org.krysalis.barcode4j.xalan.BarcodeExt.generate(result-tree, 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、fop 1.1 を使用しています

どんな助けでも大歓迎です。

4

1 に答える 1

0

バーコード拡張子の名前空間プレフィックスを定義する場合は、それも使用する必要があります。そうしないと、Xalan は必要な Java クラスを見つけられません。したがって、「バーコード」だけでなく、「バーコード:バーコード」と書きます。

于 2014-03-10T10:19:30.573 に答える