logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wilfong, Paul" <paul.wilf...@ngc.com>
Subject Log4cxx - Illegal argument exception from charsetencoder.cpp:74
Date Thu, 10 Jan 2008 22:13:48 GMT

I have tried to build log4cxx as an "so" library on a Sun computer (Sun
OS 5.10).  Everyting seems to build Ok (as described below).

This computer is a standalone - my company won't let it be connected to
the internet.

Now I have written a program that builds, but when run, a
log4cxx::helpers::IllegalArgumentException is thrown from
charsetencoder.cpp:74.  The constructor of APRCharsetEncoder uses
apr_xlate_open() with arguments of frompage="UTF-8" and
topage=APR_LOCALE_CHARSET.  The latter is a specially handled value
(defined to be 0x01), meant to return the system's locale charset.  This
call to apr_xlate_open() is failing.  The exact output is:

   terminate called after throwing an instance of
     what():  APR_LOCALE_CHARSET

Here are the build details (some "--with" paths are not shown):
1.  Build apr:
    extract apr-1.2.9.tar
    make (actually, use gmake not make!)
2.  Build apr-iconv:
    extract apr-iconv-1.2.1.tar
    configure --with-apr
3.  Build apr-util:
    extract apr-util-1.2.8.tar
    configure --with apr -- with-iconv
4.  Build log4cxx:
    extract log4cxx.0.10.tar
    configure --with-apr --with-apr-util
    edit log4cxx.10.10.0/libtool
       < postdeps="-lstdc++ -lm -R/usr/sfw/lib -lgcc_s -R/usr/sfw/lib
       < posteps="-lm -R/usr/sfw/lib -lgcc_s -R/usr/sfw/lib -lgcc_s"
    make LDFLAGS=/path/to/libapriconv-1.so
5.  Build the application and try to execute it.  At this point the
failure described above occurs.

When apr-util (1.2.8) is not configured to use apr-iconv (1.2.1) then
CharsetDecoder::createDefaultDecoder() #errors out during compilation,
complaining that no charset decoder is available.

When apr-util is configured to use apr-iconv, APRCharsetDecoder throws a
log4cxx::helpers::IllegalArgumentException at runtime (from
charsetencoder.cpp:74).  This happens because apr_xlate_open() calls
apr_iconv_open(), which returns an error value of 22.  A comment on
APR_CharsetDecoder says it "requires real iconv implementation,
apr-iconv will crash in use."  Maybe that's what's happening.

Any assistance would be greatly appreciated.

View raw message