Hi Tom,
This is a known problem which should be fixed in CVS and WILL be fixed
before we release the 1.5 release. Due note: At this late stage in the
game I do not recommend using and release < 1.4583 because all the
package names have changed g/net.sourceforge.poi/s//org.apache.poi/g
Logging in POI is primarily for tracing. We're of the opinion that
logging is a prevalent concern of everything! Class libraries need it
for debugging (turn on debug level logging and you find out all sorts of
things). So as far as Major errors, yes, Exceptions are the preferred
method of error handling. As far as debugging and diagnostics, well we
think the logging is a necessary and important thing to have.
Say you have a production problem. Lets say you have an XLS file that
HSSF doesn't handle correctly. Well you can just turn on debug-level
logging and send us all sorts of information about the structure of the
file, and what exactly HSSF choked on.
However, as I mentioned this is a known problem. Originally it did not
seem like a horrid idea to tie POI to Log4J, we included the version we
needed in the distribution and it seemed fairly stable and innocuous.
However Log4J is apparently undergoing some pretty dramatic changes that
have pointed out the errors in our logic. Furthermore, now that POI is
on Jakarta, it must conform to Jakarta convention of building in GUMP to
the latest Now you actually have to rebuild POI with different editions
of Log4J that you might already have deployed! This is horrible. To
make matters worse, the last build accidently left the version of log4j
out of the distribution (it was not a production release).
Anyhow, this was the biggest problem with POI and I believe Nicola Ken
Barozzi has fixed it. We just need people to test it. Check out and
build the sources from CVS on Jakarta and let us know if you have
problems. Up to now most of these things have been shaken out by user
tests. The only way we'll get a good production release is if enough
folks shake out the development builds and test the CVS sources.
Thanks,
Andy
On Sun, 2002-03-17 at 13:37, Thomas Linden wrote:
> Hi,
>
> I found the POI project, which seems to be the thing I was always
> looking for :-) Thanks for this great classes!
>
> But I have one problem with the software. It complains about some
> classes which I do not have installed here:
>
> scip@monster: $ ./jzeff
> Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Category
> at
>net.sourceforge.poi.hssf.usermodel.HSSFWorkbook.<clinit>(HSSFWorkbook.java:127)
> at Jzeff.<init>(Jzeff.java:115)
> at Jzeff.main(Jzeff.java:367)
>
> After downloading the source I found that HSSF uses a thing called POILogger
> to log things, for whatever reason. POILogger imports org/apache/log4j/Category
> and org/apache/log4j/Priority - both are not in the package nor do I have them
> installed.
>
> I assume this stuff is part of jakarta or something, I don't know.
>
> The problem is, that my project is a swing gui application, it has nothing
> to do with java server pages or apache webserver things. Because of this I don't
> want to include the whole jakarta engine into my project to get the creation
> of excel files work (beside: how shall I explain this to my users?).
>
> So my simple questions are:
>
> 1. How do I get rid of the whole logging stuff without completely
> rewriting or patching POI?
>
> or, if the above is not possible:
>
> 2. How can I get POI working without installing jakarta (and possibly
> more stuff) ?
>
> and, finally, just because I'm interested:
>
> Why does a class library log informations to somewhere? If I had the
> org/apache/log4j/Category installed I would not know that. IMHO a
> class library should not log things. It should be completely silent.
> The only thing it is allowed to do is it's purpose: Do it's job, throw
> exceptions in case of errors and/or return the appropriate values
> back to the application that uses it. The application then is responsible
> to log errors or whatever it decides to log.
> ^^^^
>
> Thanks in advance,
>
>
> - Tom
>
>
> --
> $_=`perl -v`;s;^.*ll;;s;$^=unpack"u","'8V]D;')E<```";s;\W;;gs;$/=7*
> ($^=~s;.;;g);%^=map{$_=>1}split//,lc;$_=join$\,(sort keys(%^))[map{
> ord($_)-$/}split//,'1I7E13?@E:7C1A7C=1:35<7C'];s"0(.)" \U$1"g;print;
--
http://www.superlinksoftware.com
http://jakarta.apache.org/poi - port of Excel/Word/OLE 2 Compound
Document
format to java
http://developer.java.sun.com/developer/bugParade/bugs/4487555.html
- fix java generics!
The avalanche has already started. It is too late for the pebbles to
vote.
-Ambassador Kosh