[kaffe] Character encoder/ClassLoader initialization

Guilhem Lavaux guilhem at kaffe.org
Thu Jan 13 02:40:20 PST 2005


Hi,

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.

Any other idea ?

Regards,

Guilhem Lavaux.

Please check your CLASSPATH and your installation.
java/lang/Error: Unexpected problems with default encoder
         at java.lang.VMThrowable.fillInStackTrace(VMThrowable.java:native)
         at java.lang.VMThrowable.fillInStackTrace(VMThrowable.java:76)
         at java.lang.Throwable.fillInStackTrace(Throwable.java:498)
         at java.lang.Throwable.<init>(Throwable.java:159)
         at java.lang.Error.<init>(Error.java:81)
         at gnu.java.io.EncodingManager.getEncoder(EncodingManager.java:387)
         at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:114)
         at java.io.PrintWriter.<init>(PrintWriter.java:121)
         at java.io.PrintWriter.<init>(PrintWriter.java:137)
         at java.io.PrintStream.<init>(PrintStream.java:152)
         at java.lang.System.<clinit>(System.java:45)
         at 
java.security.SecureClassLoader.<init>(SecureClassLoader.java:61)
         at java.net.URLClassLoader.<init>(URLClassLoader.java:548)
         at kaffe.lang.AppClassLoader.<init>(AppClassLoader.java:237)
         at kaffe.lang.AppClassLoader.<clinit>(AppClassLoader.java:35)
         at 
java.lang.VMClassLoader.getSystemClassLoader(VMClassLoader.java:273)
         at java.lang.ClassLoader$StaticData.<clinit>(ClassLoader.java:160)
         at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:772)



More information about the kaffe mailing list