You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2001/10/11 12:58:17 UTC

DO NOT REPLY [Bug 4099] New: - GPF when debugging SQL extension

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=4099>.
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=4099

GPF when debugging SQL extension

           Summary: GPF when debugging SQL extension
           Product: XalanJ2
           Version: 2.2.x
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: org.apache.xalan.lib.sql
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: Julian.Birch@ranplc.co.uk


NT4, PII550, 256M, JDK1.3.1, NetBeans 3.2.1, Xalan 2.2D11, Xerces 1.4.3

If you modify the SQL dbtest.xsl to read:
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" 
xmlns:sql="org.apache.xalan.lib.sql.XConnection" extension-element-
prefixes="sql">
	<xsl:output method="html" indent="yes" />
	<xsl:param name="driver" select="'sun.jdbc.odbc.JdbcOdbcDriver'" />
	<xsl:param name="datasource" select="'jdbc:odbc:sql;PWD=;UID=sa'" />
	<xsl:param name="query" select="'SELECT * FROM tempdb.dbo.T'" />
	<xsl:template match="/">
		<xsl:variable name="db" select="sql:new()" /> 
		<!-- Connect to the database with minimal error detection -->
		<xsl:if test="not(sql:connect($db, $driver, $datasource))">
			<xsl:message>Error Connecting to the 
Database</xsl:message>
			<xsl:copy-of select="sql:getError($db)/ext-error" />
		</xsl:if>
		<HTML>
			<HEAD>
				<TITLE>List of products</TITLE>
			</HEAD>
			<BODY>
				<TABLE border="1">
					<xsl:variable name="table" 
select='sql:query($db, $query)' /> 
					<!-- Let's include Error Checking, the 
error is actually stored 
				            in the connection since $table will 
be either data or null
						-->
					<xsl:if test="not($table)">
						<xsl:message>Error in 
Query</xsl:message>
						<xsl:copy-of 
select="sql:getError($db)/ext-error" />
					</xsl:if>
					<TR>
						<xsl:for-each 
select="$table/sql/metadata/column-header">
							<TH>
								<xsl:value-of 
select="@column-label" />
							</TH>
						</xsl:for-each>
					</TR>
					<xsl:apply-templates 
select="$table/sql/row-set/row" />
				</TABLE>
			</BODY>
		</HTML>
		<xsl:value-of select="sql:close($db)" />
	</xsl:template>
	<xsl:template match="row">
		<TR>
			<xsl:apply-templates select="col" />
		</TR>
	</xsl:template>
	<xsl:template match="col">
		<TD>
			<xsl:value-of select="text()" />
		</TD>
	</xsl:template>
</xsl:stylesheet>

The sql dsn points at a local server, the table T has a single column and no 
rows.  However, I've also tried this against a cut-down JDBC example driver and 
I'm pretty sure that the driver isn't the problem.

I'm sorry, but I'm pretty new to this and can't figure out how to extract out a 
stack trace I can include but:

What happens is as follows:
during the SQLDocument constructor, the line
m_nextsib.setElementAt(DTM.NULL, m_LastRowIdx);
is called  (Line 684)
This causes on array index out of bounds error.  The handler then hits the line
error("SQL Error Fetching next row [" + e.getLocalizedMessage() + "]");
(Line769)
which causes the debugger to GPF.