commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <si...@ecnetwork.co.nz>
Subject Re: [Digester] code must be in static method?
Date Tue, 23 Dec 2003 01:21:45 GMT
On Tue, 2003-12-23 at 14:00, Mike Zatko wrote:
> Howdy,
>     I just started looking into the Digester components and I have come 
> across a peculiarity as follows. I began by using a precanned example of 
> using Digester off of an article on IBM's site I think. Basically, all 
> of the Digester code occurrs in the static main method. For my 
> particular app, I didn't want this and wanted to do my Digester code 
> inside an instantiated object. But, it doesn't work. All it was was a 
> simple copy and paste of code from a static main method to inside a 
> method of a class inside the same package as before. Why is this?

Digester is fine. The problem is that you attempt to do all your parsing
in the *constructor* of a ConfigParser object. One of the rules is:
  digester.addObjectCreate("configuration", ConfigParser.class)
which creates a new ConfigParser instance - and runs its constructor.

Result: infinite recursion.

Restructure your code and all should be well.



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


Mime
View raw message