printf in ClassLoader constructor causes java.lang.Error: java.lang.IllegalStateException: recursive invocation
omajid at redhat.com
Wed Mar 23 09:29:26 PDT 2011
On 03/23/2011 11:53 AM, Xerxes Rånby wrote:
> Hi all, I am observing a spooky issue while working on a small classloader.
> In the classloader constructor, im able to use
> System.out.printf causes an exception
> Is this an OpenJDK library bug or have I forgotten something crucial in my loader?
From a very quick glance, this looks like neither. printf (through the
Formatter object) uses the classloader to find locale-specific files (so
it can do proper formatting operations). Since the classloader is not
initialized yet, it cant be used; creating a new one would lead to
infinite recursion (since the new classloader would again try to
initialize the Formatter object).
More information about the distro-pkg-dev