commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 35923] New: - SetNestedPropertiesRule throws a ClassCastException
Date Thu, 28 Jul 2005 21:52:08 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35923>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35923

           Summary: SetNestedPropertiesRule throws a ClassCastException
           Product: Commons
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Digester
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: logan.allred@convergys.com


I'm using Commons Digester 1.7 with JasperReports 1.0, and while parsing my
report, I get this exception:

java.lang.ClassCastException
        at
org.apache.commons.digester.SetNestedPropertiesRule.body(SetNestedPropertiesRule.java:261)
        at org.apache.commons.digester.Digester.endElement(Digester.java:1006)
        at
org.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:585)
        at
org.apache.xerces.impl.XMLNamespaceBinder.endElement(XMLNamespaceBinder.java:647)
        at
org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:1937)
        at
org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:851)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1008)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:14
69)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:329)
        at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:525)
        at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581)
        at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
        at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1175)
        at org.apache.commons.digester.Digester.parse(Digester.java:1514)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:225)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:209)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:163)
        at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:147)
        at
net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:142)
        at com.convergys.wo.jr.CVGJRUtils.compileReport(CVGJRUtils.java:41)
        at com.convergys.wo.jr.CVGJRUtils.printReport(CVGJRUtils.java:77)
        at BackgroundReporting.printReport(BackgroundReporting.java:542)
        at BackgroundReporting.generateReportNamed(BackgroundReporting.java:390)
        at BackgroundReporting.generateBatchReports(BackgroundReporting.java:595)
        at BackgroundReporting.run(BackgroundReporting.java:269)
        at java.util.TimerThread.mainLoop(Timer.java:432)
        at java.util.TimerThread.run(Timer.java:382)

The debug logs show this:
...
DEBUG 13:35:41 (org.apache.commons.digester.Digester.sax:989) 
-endElement(,,textElement)
DEBUG 13:35:41 (org.apache.commons.digester.Digester.sax:989) 
-endElement(,,textElement)
DEBUG 13:35:41 (org.apache.commons.digester.Digester:992)  - 
match='jasperReport/pageHeader/band/staticText/textElement'
DEBUG 13:35:41 (org.apache.commons.digester.Digester:992)  - 
match='jasperReport/pageHeader/band/staticText/textElement'
DEBUG 13:35:41 (org.apache.commons.digester.Digester:993)  -  bodyText=''
DEBUG 13:35:41 (org.apache.commons.digester.Digester:993)  -  bodyText=''
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1004)  -  Fire body() for
FactoryCreateRule[className=net.sf.jasperreports.engine.xml
.JRTextElementFactory, attributeName=null,
creationFactory=net.sf.jasperreports.engine.xml.JRTextElementFactory@2d502d]
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1004)  -  Fire body() for
FactoryCreateRule[className=net.sf.jasperreports.engine.xml
.JRTextElementFactory, attributeName=null,
creationFactory=net.sf.jasperreports.engine.xml.JRTextElementFactory@2d502d]
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1024)  -  Popping body text ''
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1024)  -  Popping body text ''
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1034)  -  Fire end() for
FactoryCreateRule[className=net.sf.jasperreports.engine.xml.
JRTextElementFactory, attributeName=null,
creationFactory=net.sf.jasperreports.engine.xml.JRTextElementFactory@2d502d]
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1034)  -  Fire end() for
FactoryCreateRule[className=net.sf.jasperreports.engine.xml.
JRTextElementFactory, attributeName=null,
creationFactory=net.sf.jasperreports.engine.xml.JRTextElementFactory@2d502d]
DEBUG 13:35:41 (org.apache.commons.digester.Digester:308) 
-[FactoryCreateRule]{jasperReport/pageHeader/band/staticText/textElement} Pop n
et.sf.jasperreports.engine.design.JRDesignStaticText
DEBUG 13:35:41 (org.apache.commons.digester.Digester:308) 
-[FactoryCreateRule]{jasperReport/pageHeader/band/staticText/textElement} Pop n
et.sf.jasperreports.engine.design.JRDesignStaticText
DEBUG 13:35:41 (org.apache.commons.digester.Digester.sax:1101) 
-ignorableWhitespace(
                                )
DEBUG 13:35:41 (org.apache.commons.digester.Digester.sax:1101) 
-ignorableWhitespace(
                                )
DEBUG 13:35:41 (org.apache.commons.digester.Digester.sax:1201) 
-startElement(,,text)
DEBUG 13:35:41 (org.apache.commons.digester.Digester.sax:1201) 
-startElement(,,text)
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1208)  -  Pushing body text ''
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1208)  -  Pushing body text ''
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1224)  -  New
match='jasperReport/pageHeader/band/staticText/text'
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1224)  -  New
match='jasperReport/pageHeader/band/staticText/text'
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1248)  -  No rules found
matching 'jasperReport/pageHeader/band/staticText/text'.
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1248)  -  No rules found
matching 'jasperReport/pageHeader/band/staticText/text'.
DEBUG 13:35:41 (org.apache.commons.digester.Digester.sax:921) 
-characters(Inbound Summary List)
DEBUG 13:35:41 (org.apache.commons.digester.Digester.sax:921) 
-characters(Inbound Summary List)
DEBUG 13:35:41 (org.apache.commons.digester.Digester.sax:989)  -endElement(,,text)
DEBUG 13:35:41 (org.apache.commons.digester.Digester.sax:989)  -endElement(,,text)
DEBUG 13:35:41 (org.apache.commons.digester.Digester:992)  - 
match='jasperReport/pageHeader/band/staticText/text'
DEBUG 13:35:41 (org.apache.commons.digester.Digester:992)  - 
match='jasperReport/pageHeader/band/staticText/text'
DEBUG 13:35:41 (org.apache.commons.digester.Digester:993)  -  bodyText='Inbound
Summary List'
DEBUG 13:35:41 (org.apache.commons.digester.Digester:993)  -  bodyText='Inbound
Summary List'
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1017)  -  No rules found
matching 'jasperReport/pageHeader/band/staticText/text'.
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1017)  -  No rules found
matching 'jasperReport/pageHeader/band/staticText/text'.
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1024)  -  Popping body text ''
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1024)  -  Popping body text ''
DEBUG 13:35:41 (org.apache.commons.digester.Digester.sax:1101) 
-ignorableWhitespace(
                                )
DEBUG 13:35:41 (org.apache.commons.digester.Digester.sax:1101) 
-ignorableWhitespace(
                                )
DEBUG 13:35:41 (org.apache.commons.digester.Digester.sax:989) 
-endElement(,,staticText)
DEBUG 13:35:41 (org.apache.commons.digester.Digester.sax:989) 
-endElement(,,staticText)
DEBUG 13:35:41 (org.apache.commons.digester.Digester:992)  - 
match='jasperReport/pageHeader/band/staticText'
DEBUG 13:35:41 (org.apache.commons.digester.Digester:992)  - 
match='jasperReport/pageHeader/band/staticText'
DEBUG 13:35:41 (org.apache.commons.digester.Digester:993)  -  bodyText=''
DEBUG 13:35:41 (org.apache.commons.digester.Digester:993)  -  bodyText=''
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1004)  -  Fire body() for
FactoryCreateRule[className=net.sf.jasperreports.engine.xml
.JRStaticTextFactory, attributeName=null,
creationFactory=net.sf.jasperreports.engine.xml.JRStaticTextFactory@cd6aa0]
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1004)  -  Fire body() for
FactoryCreateRule[className=net.sf.jasperreports.engine.xml
.JRStaticTextFactory, attributeName=null,
creationFactory=net.sf.jasperreports.engine.xml.JRStaticTextFactory@cd6aa0]
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1004)  -  Fire body() for
SetNextRule[methodName=addElement, paramType=net.sf.jasperr
eports.engine.design.JRDesignElement]
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1004)  -  Fire body() for
SetNextRule[methodName=addElement, paramType=net.sf.jasperr
eports.engine.design.JRDesignElement]
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1004)  -  Fire body() for
SetNestedPropertiesRule[allowUnknownChildElements=true, tri
mData=false, elementNames={}]
DEBUG 13:35:41 (org.apache.commons.digester.Digester:1004)  -  Fire body() for
SetNestedPropertiesRule[allowUnknownChildElements=true, tri
mData=false, elementNames={}]
ERROR 13:35:41 (org.apache.commons.digester.Digester:1008)  -Body event threw
exception
java.lang.ClassCastException
...<stack trace from above>...

The XML file in question contains this up to this point:
<?xml version="1.0" encoding="UTF-8"  ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN"
"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
		 name="InboundHolding"
		 columnCount="1"
		 printOrder="Vertical"
		 orientation="Portrait"
		 pageWidth="612"
		 pageHeight="792"
		 columnWidth="540"
		 columnSpacing="15"
		 leftMargin="20"
		 rightMargin="20"
		 topMargin="30"
		 bottomMargin="30"
		 whenNoDataType="AllSectionsNoDetail"
		 scriptletClass="com.convergys.wo.jr.CGTReportsScriptlet"
		 isTitleNewPage="false"
		 isSummaryNewPage="false">
	<property name="ireport.scriptlethandling" value="2" />
	<reportFont name="DefaultFont" isDefault="false" fontName="Courier New"
size="12" isBold="false" isItalic="false" isUnderline="false"
isStrikeThrough="false" pdfFontName="Courier" pdfEncoding="Cp1252"
isPdfEmbedded="true"/>
	<field name="removedForBugReport" class="java.lang.String"/>
	<field name="removedForBugReport" class="java.math.BigDecimal"/>
	<field name="removedForBugReport" class="java.lang.String"/>
	<field name="removedForBugReport" class="java.lang.String"/>
	<field name="removedForBugReport" class="java.lang.String"/>
	<field name="removedForBugReport" class="java.lang.String"/>
	<field name="removedForBugReport" class="java.math.BigDecimal"/>
	<field name="removedForBugReport" class="java.sql.Timestamp"/>
		<background>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</background>
		<title>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</title>
		<pageHeader>
			<band height="50"  isSplitAllowed="true" >
				<staticText>
					<reportElement
						mode="Opaque"
						x="176"
						y="1"
						width="212"
						height="14"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="staticText"
						stretchType="NoStretch"
						positionType="Float"
						isPrintRepeatedValues="true"
						isRemoveLineWhenBlank="false"
						isPrintInFirstWholeBand="false"
						isPrintWhenDetailOverflows="false"/>
					<textElement textAlignment="Center" verticalAlignment="Middle"
rotation="None" lineSpacing="Single">
						<font reportFont="DefaultFont"/>
					</textElement>
				<text><![CDATA[Inbound Summary List]]></text>
				</staticText>
...

The XML report file validates successfully. From perusing the source, it appears
the problem is here:
260     public void body(String bodyText) throws Exception {
261         AnyChildRules newRules = (AnyChildRules) digester.getRules();
262         digester.setRules(newRules.getOldRules());
263     }
Apparently digester.getRules() is not returning an AnyChildRules. I have no
familiarity with digester, so I don't have any idea what that means or why it
might be the case.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message