01 Feb 2006
For some reason chucknorrisfacts.com has been spreading like wildfire throughout the office. After dealing with some Hibernate lameness today, I thought I’d add a new fact.
If Chuck Norris were to re-write Hibernate, he’d have it done yesterday without any bugs.
The issue I was having with Hibernate today was some nasty logger usage occuring within a catch{} block. I’m sure Gavin had his reasons, but I generally consider this type of explicit logging before re-throwing inside of a try/catch to be an annoying practice. It popped up today as we were writing unit tests that expected the exception to get thrown minus the annoying ERROR messages filling up our console. My less-than-ideal solution was to bump the logging level up for the AbstractBatcher to FATAL.
BatchingBatcher.java
try
{
if (batchSize!=0)
{
// do something
}
}
catch (RuntimeException re)
{
log.error(“Exception executing batch: “, re);
throw re;
}
finally
{
// cleanup
}
I did a quick check and noticed the same usage existed in 3.1.1 (we’re still using 3.0). Also noticed that there were a few other cases where logging was occuring from within the scope of a try/catch.
Is there a reason?
29 Jan 2006
One of our customers (a mac user) has recently reported an issue that appears to stem from somewhere in execution trace of a JDIC/native Desktop call.
The issue we’re having is exactly similar to this thread in the JDIC forum which unfortunately hasn’t been answered.
Our code is doing the following:
try
{
Desktop.open(localFile);
}
catch (Exception e)
{
// some generic exception handling
}
It looks like the JdicInitException is happening on the first call to Desktop.open, but the call actually succeeds and the document is opened. I’ve actually been able to make 6 or 7 calls to Desktop.open() without a problem. However, eventually the application does lockup (without dumping another exception stacktrace).
The stack trace is as follows:
org.jdesktop.jdic.init.JdicInitException: java.lang.UnsatisfiedLinkError: getEnv
at org.jdesktop.jdic.init.JdicManager.initShareNative(Unknown Source)
at org.jdesktop.jdic.desktop.internal.ServiceManager.(Unknown Source)
at org.jdesktop.jdic.desktop.Desktop.open(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Anyone else run into a similar issue and have a solution? The client is running JDK 1.4.2_09. Also, does anyone have an OS X binary for JDIC newer than 0.8.6.x ?