logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Grob <andreas.g...@bergauer.ch>
Subject Re: Log4cxx - Illegal argument exception from charsetencoder.cpp:74
Date Tue, 15 Jan 2008 08:41:26 GMT
Curt Arnold <carnold <at> apache.org> writes:

> 
> 
> On Jan 10, 2008, at 4:13 PM, Wilfong, Paul wrote:
> 
> > Hi,
> >
> > 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  
> > 'log4cxx::helpers::IllegalArgumentException'
> >      what():  APR_LOCALE_CHARSET
> >
> > Here are the build details (some "--with" paths are not shown):
> > 1.  Build apr:
> >     extract apr-1.2.9.tar
> >     configure
> >     make (actually, use gmake not make!)
> > 2.  Build apr-iconv:
> >     extract apr-iconv-1.2.1.tar
> >     configure --with-apr
> >     make
> > 3.  Build apr-util:
> >     extract apr-util-1.2.8.tar
> >     configure --with apr -- with-iconv
> >     make
> > 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 -lgcc_s"
> >        < 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.
> >
> 
> APR_LOCALE_CHARSET is not used in the current implementation of  
> charsetencoder.  Also, the #error has been removed.  Could you update  
> to the current log4cxx code and see if you still have the same issue?
> 
> 


Maybe my input may help. Since your last big commits I got following errors
under win2k/vc8:

       [cc] charsetencoder.cpp
       [cc] C:\work\log4cxx\log4cxx-trunk\src\main\cpp\charsetencoder.cpp(198) :
error C2665: 'log4cxx::helpers::Transcoder::decode' : none of the 4 overloads
could convert all the argument types
       [cc]        
C:\work\log4cxx\log4cxx-trunk\src\main\include\log4cxx/helpers/transcoder.h(67):
could be 'unsigned int log4cxx::helpers::Transcoder::decode(const std::string
&,std::_String_const_iterator<_Elem,_Traits,_Alloc> &)'
       [cc]         with
       [cc]         [
       [cc]             _Elem=char,
       [cc]             _Traits=std::char_traits<char>,
       [cc]             _Alloc=std::allocator<char>
       [cc]         ]
       [cc]        
C:\work\log4cxx\log4cxx-trunk\src\main\include\log4cxx/helpers/transcoder.h(81):
or 'void log4cxx::helpers::Transcoder::decode(const std::string
&,log4cxx::LogString &)'
       [cc]         while trying to match the argument list '(const
log4cxx::LogString, std::_String_const_iterator<_Elem,_Traits,_Alloc>)'
       [cc]         with
       [cc]         [
       [cc]             _Elem=wchar_t,
       [cc]             _Traits=std::char_traits<wchar_t>,
       [cc]             _Alloc=std::allocator<wchar_t>
       [cc]         ]

       [cc] C:\work\log4cxx\log4cxx-trunk\src\main\cpp\charsetencoder.cpp(232) :
error C2665: 'log4cxx::helpers::Transcoder::decode' : none of the 4 overloads
could convert all the argument types
--- 8< ---
       [cc] C:\work\log4cxx\log4cxx-trunk\src\main\cpp\charsetencoder.cpp(232) :
error C2665: 'log4cxx::helpers::Transcoder::decode' : none of the 4 overloads
could convert all the argument types
--- 8< ---
       [cc] C:\work\log4cxx\log4cxx-trunk\src\main\cpp\charsetencoder.cpp(232) :
error C2665: 'log4cxx::helpers::Transcoder::decode' : none of the 4 overloads
could convert all the argument types
--- 8< ---
       [cc] C:\work\log4cxx\log4cxx-trunk\src\main\cpp\charsetencoder.cpp(351) :
error C2665: 'log4cxx::helpers::Transcoder::decode' : none of the 4 overloads
could convert all the argument types
--- 8< ---
       [cc] charsetdecoder.cpp
       [cc] C:\work\log4cxx\log4cxx-trunk\src\main\cpp\charsetdecoder.cpp(259) :
error C2665: 'log4cxx::helpers::Transcoder::encode' : none of the 2 overloads
could convert all the argument types
       [cc]        
C:\work\log4cxx\log4cxx-trunk\src\main\include\log4cxx/helpers/transcoder.h(75):
could be 'void log4cxx::helpers::Transcoder::encode(unsigned int,std::string &)'
       [cc]        
C:\work\log4cxx\log4cxx-trunk\src\main\include\log4cxx/helpers/transcoder.h(87):
or 'void log4cxx::helpers::Transcoder::encode(const log4cxx::LogString
&,std::string &)'
       [cc]         while trying to match the argument list '(unsigned int,
log4cxx::LogString)'
       [cc] C:\work\log4cxx\log4cxx-trunk\src\main\cpp\charsetdecoder.cpp(295) :
error C2665: 'log4cxx::helpers::Transcoder::encode' : none of the 2 overloads
could convert all the argument types
--- 8< ---
       [cc] C:\work\log4cxx\log4cxx-trunk\src\main\cpp\charsetdecoder.cpp(336) :
error C2665: 'log4cxx::helpers::Transcoder::encode' : none of the 2 overloads
could convert all the argument types
--- 8< ---
       [cc] transcoder.cpp
       [cc] C:\work\log4cxx\log4cxx-trunk\src\main\cpp\transcoder.cpp(47) :
error C2665: 'log4cxx::helpers::Transcoder::encode' : none of the 2 overloads
couldconvert all the argument types
       [cc]        
C:\work\log4cxx\log4cxx-trunk\src\main\include\log4cxx/helpers/transcoder.h(75):
could be 'void log4cxx::helpers::Transcoder::encode(unsigned int,std::string &)'
       [cc]        
C:\work\log4cxx\log4cxx-trunk\src\main\include\log4cxx/helpers/transcoder.h(87):
or 'void log4cxx::helpers::Transcoder::encode(const log4cxx::LogString
&,std::string &)'
       [cc]         while trying to match the argument list '(unsigned int,
log4cxx::LogString)'
       [cc] C:\work\log4cxx\log4cxx-trunk\src\main\cpp\transcoder.cpp(62) :
error C2665: 'log4cxx::helpers::Transcoder::decode' : none of the 4 overloads
couldconvert all the argument types
       [cc]        
C:\work\log4cxx\log4cxx-trunk\src\main\include\log4cxx/helpers/transcoder.h(67):
could be 'unsigned int log4cxx::helpers::Transcoder::decode(const std::string
&,std::_String_const_iterator<_Elem,_Traits,_Alloc> &)'
       [cc]         with
       [cc]         [
       [cc]             _Elem=char,
       [cc]             _Traits=std::char_traits<char>,
       [cc]             _Alloc=std::allocator<char>
       [cc]         ]
       [cc]        
C:\work\log4cxx\log4cxx-trunk\src\main\include\log4cxx/helpers/transcoder.h(81):
or 'void log4cxx::helpers::Transcoder::decode(const std::string
&,log4cxx::LogString &)'
       [cc]         while trying to match the argument list '(const
log4cxx::LogString, std::_String_const_iterator<_Elem,_Traits,_Alloc>)'
       [cc]         with
       [cc]         [
       [cc]             _Elem=wchar_t,
       [cc]             _Traits=std::char_traits<wchar_t>,
       [cc]             _Alloc=std::allocator<wchar_t>
       [cc]         ]
       [cc] Generating Code...

BUILD FAILED
C:\work\log4cxx\log4cxx-trunk\build.xml:643: cl failed with return code 2


Cheers
~ Andreas



Mime
View raw message