[kaffe] Character encoder/ClassLoader initialization

Helmer Krämer hkraemer at freenet.de
Thu Jan 13 04:41:03 PST 2005


Guilhem Lavaux <guilhem at kaffe.org> wrote:

Hey,
 
> It seems that when we don't use iconv there are some problems in 
> initializing the EncodingManager. CharToByteConverter.getEncoder needs 
> ClassLoader.getSystemResource which needs ClassLoader.staticData. 
> However staticData is not yet initialized because getEncoder is called 
> while initializing ClassLoader.StaticData.systemClassLoader. Everything 
> goes to a NPE.
> 
> The initialization loop can be broken either:
> 
> * by removing the dependency on getSystemResource (but I bet it will be 
> difficult)
> * by getting rid of AppClassLoader which is the source of the loop: it 
> uses URLClassLoader.

Note that AppClassLoader did not extend URLClassLoader in the beginning.
That was changed because some application wanted to call addURL on the
SystemClassLoader (I don't remember which application that was, you'd
have to search the archive for details).

A third option might be to find out why I don't get the exception in
my tree ;) If I undef HAVE_ICONV_H and HAVE_ICONV in CharToByteIconv.c
and ByteToCharIconv.c I don't get any exceptions when trying to start
kjc, I just see the usual messages from kjc when no input files are
given. The only difference between my local tree and HEAD is the merged
java.lang.Class implementation from GNU classpath.

Regards,
Helmer



More information about the kaffe mailing list