From commons-user-return-11472-apmail-jakarta-commons-user-archive=jakarta.apache.org@jakarta.apache.org Wed Apr 06 05:57:40 2005 Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 53563 invoked from network); 6 Apr 2005 05:57:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Apr 2005 05:57:39 -0000 Received: (qmail 17599 invoked by uid 500); 6 Apr 2005 05:57:29 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 17548 invoked by uid 500); 6 Apr 2005 05:57:29 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 17535 invoked by uid 99); 6 Apr 2005 05:57:29 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from pcmbi15.med.Uni-Marburg.DE (HELO mailgate.med.uni-marburg.de) (137.248.254.138) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 05 Apr 2005 22:57:27 -0700 Received: from localhost (localhost [127.0.0.1]) by mailgate.med.uni-marburg.de (Postfix) with ESMTP id 50744A8AB4 for ; Wed, 6 Apr 2005 07:57:24 +0200 (CEST) Received: from mailgate.med.uni-marburg.de ([127.0.0.1]) by localhost (mailgate [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15906-05 for ; Wed, 6 Apr 2005 07:57:05 +0200 (CEST) Received: from post.med.uni-marburg.de (post.med.uni-marburg.de [137.248.253.12]) by mailgate.med.uni-marburg.de (Postfix) with ESMTP id 1F30BA8AB0 for ; Wed, 6 Apr 2005 07:57:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by post.med.uni-marburg.de (Postfix) with ESMTP id 0D9CC27044 for ; Wed, 6 Apr 2005 07:57:05 +0200 (CEST) Received: from post.med.uni-marburg.de ([127.0.0.1]) by localhost (post [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15082-01 for ; Wed, 6 Apr 2005 07:57:00 +0200 (CEST) Received: from [137.248.224.93] (wstlehre93.med.uni-marburg.de [137.248.224.93]) by post.med.uni-marburg.de (Postfix) with ESMTP id C8AAE27059 for ; Wed, 6 Apr 2005 07:56:59 +0200 (CEST) Message-ID: <42537A44.7010602@med.uni-marburg.de> Date: Wed, 06 Apr 2005 07:57:24 +0200 From: Oliver Heger User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de, de-at, en-us, en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: [configuration] VerifyError References: <4252CDF1.4040107@mci.com> In-Reply-To: <4252CDF1.4040107@mci.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at med.uni-marburg.de X-Virus-Scanned: by amavisd-new at med.uni-marburg.de X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Looks like a problem with the XML parser you use. Which parsers do you have in your classpath? If you use JDK 1.4.x, you don't have to bother about including a specific parser; you can simply use the one shipped with the JDK. For earlier JDKs in our dependencies we have defined Xerces in version 2.2.1. Oliver paul.hopper wrote: > Good day, > > Thought that configuration might be an easy replacement for my > properties configurator since it does both UNIX based key=value > properties but also xml config files. Mine only does the former 8-( > > While setting up my test I came across an error while setting up this > from example: > > #more config.xml > > > > > > > > My src code works fine with just the properties "fileName" but I get a > > 2005-04-05 13:25:52,211 [main] ERROR > org.apache.commons.digester.Digester - Begin event threw error > java.lang.VerifyError: (class: > org/apache/xerces/jaxp/DocumentBuilderImpl, method: parse signature: > (Lorg/xml/sax/InputSource;)Lorg/w3c/dom/Document;) Incompatible object > argument for function call > at > org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(DocumentBuilderFactoryImpl.java:88) > > ...... > ...... > ...... > > with the xml "fileName" when using both loadConfigXML and > loadConfigByFactory method class of my test class. Any suggestions? > > [[my src]] > > import java.io.File; > import java.net.MalformedURLException; > import java.net.URL; > > import org.apache.commons.configuration.Configuration; > import org.apache.commons.configuration.ConfigurationException; > import org.apache.commons.configuration.ConfigurationFactory; > import org.apache.commons.configuration.XMLConfiguration; > import org.apache.log4j.Logger; > import org.apache.log4j.PropertyConfigurator; > > public class TestProperties { > private Logger logger = Logger.getLogger(TestProperties.class); > protected Configuration config = null; > > public TestProperties() { > this.loadConfigByFactory(); > //this.loadConfigXML(); > > //System.out.println("CONFIG::" + > config.getString("DATABASES.DATABASE.DRIVER")); > logger.info("colors.background = " + > config.getString("colors.background")); > logger.info("application.title = " + > config.getString("application.title")); > logger.info("rowsPerPage = " + config.getInt("rowsPerPage")); > } > > public void loadConfigXML() { > //ConfigurationFactory factory = new > ConfigurationFactory("config.conf"); > XMLConfiguration config = new XMLConfiguration(); > config.setFileName("test.xml"); > try { > config.load(); > } catch (ConfigurationException e) { > logger.error(e); > } > logger.info("rowsPerPage = " + config.getInt("rowsPerPage")); > } > > public void loadConfigByFactory() { > ConfigurationFactory factory = new ConfigurationFactory(); > URL configURL = null; > try { > configURL = new File("config.xml").toURL(); > } catch (MalformedURLException mue) { > logger.error("error loading config.conf: ", mue); > } > factory.setConfigurationFileName(configURL.toString()); > > try { > config = factory.getConfiguration(); > } catch (ConfigurationException ce) { > logger.error("error loading configuration: ", ce); > } > } > > public static void main(String[] args) { > PropertyConfigurator.configure("log4j.cfg"); > new TestProperties(); > } > } > > [[my gui.xml]] > > > > > #808080 > #000000 >
#008000
> >
> 15 >
> > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > -- Dipl.-Inform. Oliver Heger Zentrale Informationsverarbeitung (ZIV) / Bereich Anwenderverfahren Klinikum der Philipps-Universität Marburg Baldingerstraße, D-35037 Marburg Tel: +49 6421 28-66679 mailto:oliver.heger@med.uni-marburg.de --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org