Andrea Aime a écrit :
> Updates landed both on gt2 trunk and 2.4.x
Thanks. I just did some experiment with that. Since we removed LoggingFramework,
can I add "throws ClassNotFoundException" declaration in LoggerFactory
constructor and 'getInstance()' method? Since it is a checked exception, it will
require updates in GeoServer.
Rational: first, the "catch" blocks in GeoTools.init(...) code are ineffective.
The throwable that we may get is NoClassDefFoundError (not to be confused with
ClassNotFoundException), which is an Error, not an Exception, and consequently
is not handled in the "catch" blocks provided in GeoTools.init(...).
Second, we are at risk to get NoClassDefFoundError right at GeoTools class
loading even if GeoTools.init(...) is never invoked. It is JVM-implementation
dependent (depends how deep the ClassLoader checks GeoTools class dependencies).
Fortunatly Java 6 behave well, but we have no garantee that all JVM behave as
well.
Actually Java 6 behave so well in deferring dependencies checks that
'setLoggerFactory(Log4JLogger.getInstance())' always succeed, and we get
NoClassDefFoundError only the first time we try to log a message (I just tried
that).
The LoggingFramework stuff was there exactly for handling those issues through
reflections. Since we removed it, I would like to:
- Adds some code in LoggerFactory for checking that the logging framework
is available in the classpath (i.e. reinsert some of LoggingFramework
code into LoggerFactory).
- Throws ClassNotFound checked exception if the above test fails.
Note that it does not completly eliminate the risk of NoClassDefFoundError (only
LoggingFramework completly eliminated it), but it should greatly reduce it.
Martin
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel