DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10748>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10748

Translet class not loading due to java.long.VerifyError





------- Additional Comments From [EMAIL PROTECTED]  2002-07-16 13:11 -------
The problem is reproducible with the following XML,XSL and the java method 
below:

The method that calls the translet is below:

    private String applyXSLTransformation(String xmlStr, String transletName) 
throws NotificationServiceException {
        // parse XML to DOM
        DOMImpl dom = new DOMImpl();
        XMLReader reader = null;
        final SAXParserFactory factory = SAXParserFactory.newInstance();
        try {
            factory.setFeature(Constants.NAMESPACE_FEATURE, true);
        } catch (Exception e) {
            factory.setNamespaceAware(true);
        }
        SAXParser parser = null;
        DTDMonitor _dtdMonitor = new DTDMonitor();
        try {
            parser = factory.newSAXParser();
            reader = parser.getXMLReader();
            reader.setContentHandler(dom.getBuilder());
            _dtdMonitor.handleDTD(reader);
            StringReader stringReader = new StringReader(xmlStr);
            InputSource inputSource = new InputSource(stringReader);
            reader.parse(inputSource);
        } catch (ParserConfigurationException e) {
            Logger.getInstance().error(Logger.LOG_EMAIL_SERVICES, "SAX Parser 
is not configured properly.\n" +
                    e.getMessage());
            throw new NotificationServiceException("SAX Parser is not 
configured properly.\n" +
                    e.getMessage());
        } catch (SAXException e) {
            Logger.getInstance().error(Logger.LOG_EMAIL_SERVICES, "SAX Parser 
could not be created.\n" +
                    e.getMessage());
            throw new NotificationServiceException("SAX Parser could not be 
created.\n" +
                    e.getMessage());
        } catch (IOException e) {
            Logger.getInstance().error(Logger.LOG_EMAIL_SERVICES, "XML Reader 
could not read xml document. " + e.getMessage());
            throw new NotificationServiceException("XML Reader could not read 
xml document. " +
                    e.getMessage());
        }
        DefaultSAXOutputHandler outputhandler = null;
        TextOutput textoutput = null;
        StringWriter stringWriter = new StringWriter();
        try {
            outputhandler = new DefaultSAXOutputHandler(stringWriter, "utf-8");
            textoutput = new TextOutput(outputhandler, "utf-8");
            textoutput.setType(textoutput.TEXT);
        } catch (IOException e) {
            Logger.getInstance().error(Logger.LOG_EMAIL_SERVICES, "Could not 
create SAX Output Handler." +
                    e.getMessage());
            throw new NotificationServiceException("Could not create SAX Output 
Handler." +
                    e.getMessage());
        }
        // instantiate the translet
        Translet translet = null;
        try {
            Class clazz = Class.forName(transletName);
            translet = (Translet) clazz.newInstance();
        } catch (ClassNotFoundException e) {
            Logger.getInstance().error(Logger.LOG_EMAIL_SERVICES, "Translet 
class not found." +
                    e.getMessage());
            throw new NotificationServiceException("Translet class not found." +
                    e.getMessage());
        } catch (InstantiationException e) {
            Logger.getInstance().error(Logger.LOG_EMAIL_SERVICES, "Could not 
instantiate Translet class." +
                    e.getMessage());
            throw new NotificationServiceException("Could not instantiate 
Translet class." +
                    e.getMessage());
        } catch (IllegalAccessException e) {
            Logger.getInstance().error(Logger.LOG_EMAIL_SERVICES, "Illegal 
Access of Translet class." +
                    e.getMessage());
            throw new NotificationServiceException("Illegal Access of Translet 
class." +
                    e.getMessage());
        }
        // do the transformation
        AbstractTranslet absTranslet = (AbstractTranslet) translet;
        absTranslet.setIndexSize(dom.getSize());
        _dtdMonitor.buildIdIndex(dom, 0, absTranslet);
        try {
            absTranslet.transform(dom, textoutput);
        } catch (TransletException e) {
            Logger.getInstance().error(Logger.LOG_EMAIL_SERVICES, "Could not 
transform XML document." +
                    e.getMessage());
            throw new NotificationServiceException("Could not transform XML 
document." +
                    e.getMessage());
        }
        return stringWriter.toString();

    }

The XML looks like this:

<transaction-data>
   <changed-data>
      <dd-change-changed-state>
        <changes-before-image>
          <interest>
            <interest-code>04</interest-code>
            <rate-region>7</rate-region>
            <rate-index>324</rate-index>
            <interest-rate>0.0015</interest-rate>
            <apy>0.0</apy>
          </interest>
        </changes-before-image>
        <changes-after-image>
          <interest>
            <interest-code>05</interest-code>
            <rate-region>7</rate-region>
            <rate-index>354</rate-index>
            <interest-rate>1.45</interest-rate>
            <apy>1.5</apy>
          </interest>
        </changes-after-image>
      </dd-change-changed-state>
   </changed-data>
</transaction-data>

XSL is as below:

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="text" standalone="yes" omit-xml-declaration = "yes"/>

<!-- main template control-->
<xsl:template match="/">
Before Image
------------
<xsl:apply-templates select = "//transaction-data/changed-data/dd-change-
changed-state/changes-before-image" />

After Image
-----------
<xsl:apply-templates select = "//transaction-data/changed-data/dd-change-
changed-state/changes-after-image" />
</xsl:template>

<xsl:template match="interest">INTEREST
   <xsl:apply-templates select = "apy"/>
</xsl:template>

<xsl:template match="//changes-after-image//apy">APY: <xsl:value-of 
select="."/><xsl:text>
</xsl:text>
</xsl:template>

<xsl:template match="//changes-before-image//apy"></xsl:template>


</xsl:stylesheet>

Reply via email to