Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 38768 invoked from network); 2 Aug 2007 14:56:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Aug 2007 14:56:18 -0000 Received: (qmail 24701 invoked by uid 500); 2 Aug 2007 14:56:13 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 24624 invoked by uid 500); 2 Aug 2007 14:56:13 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 24609 invoked by uid 99); 2 Aug 2007 14:56:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2007 07:56:12 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.97.132.145] (HELO spaceymail-a4.g.dreamhost.com) (208.97.132.145) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2007 14:55:47 +0000 Received: from [192.168.2.100] (dsl-083-247-122-068.solcon.nl [83.247.122.68]) by spaceymail-a4.g.dreamhost.com (Postfix) with ESMTP id C9B641617CB for ; Thu, 2 Aug 2007 07:55:44 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) Content-Transfer-Encoding: 7bit Message-Id: <0DB7A78C-D517-46C9-A156-D5359F4759F6@ernstdehaan.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: user@commons.apache.org From: Ernst de Haan Subject: [Digester] Generic digester patterns? Date: Thu, 2 Aug 2007 16:55:44 +0200 X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org I'm struggling to implement generic digester patterns. Some hints or references to appropriate examples would be much appreciated! This is my input XML: ----------------------- ----------------------- and these are my Digester rules: ----------------------- ----------------------- The factory is accessed properly, but I cannot get Digester to bind the result of the "*/Color" rule set (a java.awt.Color object) so it gets associated with the Config object. Instead, I'm getting the following exception: ----------------------- Exception in thread "main" java.lang.IllegalArgumentException: Cannot invoke com.pensioenpage.protea.ChartRenderConfig.setBackground - argument type mismatch at org.apache.commons.digester.Digester.createSAXException (Digester.java:3181) at org.apache.commons.digester.Digester.createSAXException (Digester.java:3207) at org.apache.commons.digester.Digester.endElement(Digester.java:1195) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) ----------------------- but the argument type does match (the method accepts a java.awt.Paint, which is an interface implemented by java.awt.Color). When I enable logging, I see the problem: ----------------------- [DEBUG] Digester - [SetNestedPropertiesRule]{ChartRenderConfig/ background} Setting property 'background' to '' [DEBUG] Digester - [SetNestedPropertiesRule]{ChartRenderConfig/ background} Set com.pensioenpage.protea.ChartRenderConfig properties [DEBUG] ConvertUtils - Convert string '' to class 'java.awt.Paint' [ERROR] PropertyUtils - Method invocation failed. java.lang.IllegalArgumentException: argument type mismatch ----------------------- So how do I bind the Color object to the enclosing object in a generic manner? My environment: - Commons Digester 1.8.0 - Java 1.5.0 - Mac OS X 10.4.10 Kind regards, Ernst --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org