Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 25671 invoked from network); 15 Jan 2004 08:05:44 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 15 Jan 2004 08:05:44 -0000 Received: (qmail 17906 invoked by uid 500); 15 Jan 2004 08:05:17 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 17672 invoked by uid 500); 15 Jan 2004 08:05:16 -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 17658 invoked from network); 15 Jan 2004 08:05:15 -0000 Received: from unknown (HELO mailgate.med.uni-marburg.de) (137.248.254.138) by daedalus.apache.org with SMTP; 15 Jan 2004 08:05:15 -0000 Received: from localhost (localhost [127.0.0.1]) by mailgate.med.uni-marburg.de (Postfix) with ESMTP id 8CBFAA8AC5 for ; Thu, 15 Jan 2004 09:05:27 +0100 (CET) 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 14885-09 for ; Thu, 15 Jan 2004 09:05:15 +0100 (CET) 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 1251DA8ADA for ; Thu, 15 Jan 2004 09:05:06 +0100 (CET) Received: from med.uni-marburg.de (wstlehre93.med.uni-marburg.de [137.248.224.93]) by post.med.uni-marburg.de (Postfix) with ESMTP id 54A31AFAA7 for ; Thu, 15 Jan 2004 09:05:05 +0100 (CET) Message-ID: <400649D4.50000@med.uni-marburg.de> Date: Thu, 15 Jan 2004 09:05:40 +0100 From: Oliver Heger User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.4) Gecko/20030624 X-Accept-Language: de, de-at, en-us, en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: [Configuration] Hierarchical Configuration Problem: Newbie References: <8765557836794E4EADF7F31290F4C39F046A3454@ASMCMAIL.suz.com> In-Reply-To: <8765557836794E4EADF7F31290F4C39F046A3454@ASMCMAIL.suz.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at med.uni-marburg.de X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Vikas, you won't have much luck with earlier versions, they all make use of this 1.4 method. I will provide a patch (in the next days) that should fix this problem because [configuration] should not depent on JDK 1.4. So long. Oli Vikas Phonsa schrieb: > Yeah I agree with you, that's what I found too. I'm going to try things with > some earlier versions of configuration if that works, maybe. > > Thanks for your response > > Vikas > > -----Original Message----- > From: Tong, Andrew [mailto:ATong@CreativeSolutions.com] > Sent: Wednesday, January 14, 2004 12:04 PM > To: Jakarta Commons Users List > Subject: RE: [Configuration] Hierarchical Configuration Problem: Newbie > > Although I've never used commons-configurations, the NoSuchMethodException > leads me to believe that you need to have JDK 1.4 or higher. The docs say > that the StringBuffer.indexOf(String) method was introduced in that version. > > http://java.sun.com/j2se/1.4.1/docs/api/java/lang/StringBuffer.html#indexOf( > java.lang.String) > > -----Original Message----- > From: Vikas Phonsa [mailto:VPhonsa@suz.com] > Sent: Wednesday, January 14, 2004 2:32 PM > To: 'commons-user@jakarta.apache.org' > Subject: Hierarchical Configuration Problem: Newbie > > > Hi Everybody, > > I am trying to learn the commons-configuration from the examples given on > the website http://jakarta.apache.org/commons/configuration/examples.html > > Things were working as expected until I started to use the Hierarchical > Properties. I'm listing my source code, the exceptions that I'm getting and > the properties file that I'm using. I would appreciate any thoughts. > > Thanks > > Vikas > > ---------------Source Code---------------------------------- > public class FirstConfig { > > public static void main(String[] args) throws Exception{ > > > ConfigurationFactory configFactory = new > ConfigurationFactory(); > URL configFile = new File("config\\config.xml").toURL(); > System.out.println("URL== "+ configFile); > configFactory.setConfigurationURL(configFile); > Configuration config = configFactory.getConfiguration(); > > String backgroundColor = > config.getString("color.background"); > String textColor = config.getString("color.text"); > String rows = config.getString("rowsPerPage"); > System.out.println("Here is the back ground color property: "+ > backgroundColor); > System.out.println("Here is the text color property: "+ textColor); > System.out.println("Here is the rows per page property: "+ rows); > > //Everything is working perfectly fine till here > > Object tablename = config.getProperty("tables.table(0).name"); > System.out.println("Here is tablename.toString() : "+tablename.toString()); > > > } > } > > --------------Exception Stack Trace---------------------------------------- > > URL== file:/c:/wsad_workspaces/Eclipse/Commons-Config/config/config.xml > Here is the back ground color property: black; > Here is the text color property: #000000 > Here is the rows per page property: 15 > java.lang.NoSuchMethodError: java.lang.StringBuffer: method > indexOf(Ljava/lang/String;I)I not found > at > org.apache.commons.configuration.ConfigurationKey$KeyIterator.findNextIndice > s(ConfigurationKey.java:431) > at > org.apache.commons.configuration.ConfigurationKey$KeyIterator.nextKey(Config > urationKey.java:472) > at > org.apache.commons.configuration.HierarchicalConfiguration.findPropertyNodes > (HierarchicalConfiguration.java:476) > at > org.apache.commons.configuration.HierarchicalConfiguration.fetchNodeList(Hie > rarchicalConfiguration.java:449) > at > org.apache.commons.configuration.HierarchicalConfiguration.getPropertyDirect > (HierarchicalConfiguration.java:188) > at > org.apache.commons.configuration.HierarchicalConfiguration.containsKey(Hiera > rchicalConfiguration.java:354) > at > org.apache.commons.configuration.CompositeConfiguration.getFirstMatchingConf > ig(CompositeConfiguration.java:753) > at > org.apache.commons.configuration.CompositeConfiguration.getProperty(Composit > eConfiguration.java:220) > at com.suz.config.first.FirstConfig.main(FirstConfig.java:58) > Exception in thread "main" > > --------------------config.xml------------------------- > > > > > > > > > ---------------------tables.xml---------------------- > > ?xml version="1.0" encoding="ISO-8859-1" ?> > > > > > users > > > uid > long > > > uname > java.lang.String > > > firstName > java.lang.String > > > lastName > java.lang.String > > > email > java.lang.String > > >
> > documents > > > docid > long > > > name > java.lang.String > > > creationDate > java.util.Date > > > authorID > long > > > version > int > > >
>
>
> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org