/* 358 */ if (isLocal)
/* */ {
/* 360 */ return ejbException;
/* */ }
/* */
/* 365 */ return new ServerException("EJBException:", ejbException);
/* */ }
/* */
/* 373 */ if (((e instanceof SecurityException)) || ((e instanceof GeneralSecurityException)))
/* */ {
/* 375 */ Exception runtimeException = (Exception)e;
/* 376 */ if (this.log.isTraceEnabled())
/* 377 */ this.log.trace("SecurityException in method: " + invocation.getMethod() + ":", runtimeException);
/* 378 */ if (isAppException(invocation, e))
/* */ {
/* 380 */ return runtimeException;
/* */ }
/* 382 */ if (isLocal)
/* */ {
/* 384 */ return new AccessLocalException("SecurityException", runtimeException);
/* */ }
/* */
/* 388 */ return new AccessException("SecurityException", runtimeException);
/* */ }
/* */
/* 394 */ if ((e instanceof JBossLazyUnmarshallingException))
/* */ {
/* 396 */ RuntimeException runtimeException = (RuntimeException)e;
/* 397 */ this.log.error("UnmarshalException:", e);
/* */
/* 399 */ if (isLocal)
/* */ {
/* 401 */ return new EJBException("UnmarshalException", runtimeException);
/* */ }
/* */
/* 405 */ return new MarshalException("MarshalException", runtimeException);
/* */ }
/* */
/* 410 */ if ((e instanceof RuntimeException))
/* */ {
/* 412 */ RuntimeException runtimeException = (RuntimeException)e;
/* 413 */ this.log.error("RuntimeException in method: " + invocation.getMethod() + ":", runtimeException);
/* */
/* 415 */ if (isLocal)
/* */ {
/* 417 */ return new EJBException("RuntimeException", runtimeException);
/* */ }
/* */
/* 421 */ return new ServerException("RuntimeException", runtimeException);
/* */ }
/* */
/* 424 */ if ((e instanceof Error))
/* */ {
/* 426 */ this.log.error("Unexpected Error in method: " + invocation.getMethod(), e);
/* 427 */ if (isLocal)
/* */ {
/* 429 */ String msg = formatException("Unexpected Error", e);
/* 430 */ return new EJBException(msg);
/* */ }
/* */
/* 434 */ return new ServerError("Unexpected Error", (Error)e);
/* */ }
/* */
/* 440 */ if ((isLocal) && ((e instanceof RemoteException)))
/* */ {
/* 442 */ if (this.callLogging)
/* */ {
/* 444 */ this.log.info("Remote Exception in method: " + invocation.getMethod(), e);
/* */ }
/* 446 */ return new EJBException((RemoteException)e);
/* */ }
/* */
/* 449 */ if ((e instanceof Exception))
/* */ {
/* 451 */ if (this.callLogging)
/* */ {
/* 453 */ this.log.info("Application Exception in method: " + invocation.getMethod(), e);
/* */ }
/* 455 */ return (Exception)e;
/* */ }
/* */
/* 460 */ String msg = formatException("Unexpected Throwable", e);
/* 461 */ this.log.warn("Unexpected Throwable in method: " + invocation.getMethod(), e);
/* 462 */ if (isLocal)
/* */ {
/* 464 */ return new EJBException(msg);
/* */ }
/* */
/* 468 */ return new ServerException(msg);
/* */ }