Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UnknownException

 
Anupreet Arora
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whenever any unchecked runtime exeption (For Ex
Nullpointer) is thrown from beyond the EJB layer in our application, it is
getting converted to Corba Unknown Exception (org.omg.CORBA.portable.UnknownException) and shown to the user on the
error screen.

This is misleading as the actual error gets lost. This happens in WSAD as well as WAS server (Version 5.1) where the application is deployed.

Early investigation shows that there is some problem with the stubs and ties being generated by websphere.

Has anybody faced similar problem using Websphere 5.1 and is there a fix or workaround.

Many Thanks
Anupreet
 
Dileep Kamath
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB 2.0 specification says that RuntimeExceptions should no be thrown across the EJB layer:

Found this in the ejb 2.0 specification (Chapter 18, downloaded from http://java.sun.com/products/ejb/docs.html 2.0 Final Release Specification):

An application exception class must be a subclass (direct or indirect) of java.lang.Exception.
An application exception class must not be defined as a subclass of the java.lang.RuntimeException,
or of the java.rmi.RemoteException. These are reserved for system exceptions.
(See next subsection).

The Bean Provider is also responsible for using the standard EJB application exceptions
(javax.ejb.CreateException, javax.ejb.RemoveException, javax.ejb.FinderException,
and subclasses thereof) as described in Subsections 10.5.8 and 12.1.8.
 
Anupreet Arora
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dileep..

Thanks for your response. The exceptions I am talking about would come under the 18.2.2 System exceptions section of the specs.

What is happening is, if a NullPointer comes for some unknown reason, it is to be thrown as is .. it gets propagated across the tiers of the application till it reaches EJB stubs and skeleton, which are supposed to convert it to remote exception.
"The Container catches a non-application exception; logs it (which can result in alerting the SystemAdministrator); and, unless the bean is a message-driven bean, throws the java.rmi.RemoteException(or subclass thereof) to the client if the client is a remote client, or throws the javax.ejb.EJBException (or subclass thereof) to the client if the client is a local client. TheBean Provider can rely on the Container to perform the following tasks when catching a non-applicationexception:
The transaction in which the bean method participated will be rolled back.
No other method will be invoked on an instance that threw a non-application exception.


But sth goes wrong, and all we get is Corba Unknown Exception (org.omg.CORBA.portable.UnknownException)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic