From: Dain S. <da...@da...> - 2002-06-28 17:46:09
|
Scott M Stark wrote: >>Problem: >>This code assumes that an invocation is always a remote invocation, and >>therefore throws the wrong exception for local interfaces. For example, >>an EJBException are wrapped with ServerException, which is a (checked) >>subclass of RemoteException. This causes an >>UndeclaredThrowableException to be thrown from the local interface. >> >>Possible Solution: >>Modify LogInterceptor to check invocation.getType() for remote or local >>and wrap the exception appropriately. I prefer this solution because it >>is the simplest. >> > > Its an improvement so just do this. Working on it. >>Problem: >>Exception are logged many times. I think Jason has already done some >>work on this, so my comments may be dated. When an exception is thrown >>deep in an execution stack (remoteA -> localB -> localC -> localD -> >>etc) the exception will be logged by the LogInterceptor in each >>interceptor chain. >> >>Possible Solution: >>Instead of having the LogInterceptor wraps the exception with a normal >>wrapper, it wraps it with a JBoss subclass. When JBoss subclass is >>caught it does not log the exception. This will work for all standard >>container exception but will not work for application exceptions. This >>is big problem because LogInterceptor will only log application >>exception if call logging is enabled. > > Unless requested application exceptions should not be logged. An application > declared exception is just another return value and we don't log those. I mis-typed. I ment NOT a big problem. I have a better solution. After logging the exception, I simply add a key to the invocation which flags the exception as already been logged. This is less intrusive and easier to code. -dain |