• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Useful points on exceptions in ejb 2.0

 
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Just thought that the following points in regards to the exceptions could be useful for the exam preparations:

1. When a session or entity bean call getEJBHome/getEJBObject on SessionContext/EntityContext and the bean does not have a remote interface defined - Container throws java.lang.IllegalStateException

2. When a session or entity bean call getEJBLocalHome/getEJBLocalObject on SessionContext/EntityContext and the bean does not have a local interface defined - Container throws java.lang.IllegalStateException

3. Client gets RemoveException when
a. remove() is called on SFSB that is in a transaction (BMT sfsb)
b. remove(Object pk) is called on a session bean remote/local home intf
c. application level error occurred in ejbRemove() method of the entity bean

4. Client gets a RemoteException when calls getPrimaryKey() on session bean's remote component interface.
Client gets a EJBException when calls getPrimaryKey() on session bean's local component interface

5. Client gets a RuntimeException when extracts EJBMetaData from session bean's remote home interface and calls EJBMetaData#getPrimaryKey()

6. Container throws IllegalStateException when bean calls methods on EJBContext that are not allowed (eg, getEJBObject() from setSessionContext()) or when tried to reset pk, or when performing prohibited operation on java.util.Collection API that represents a cmr-field)

7. When a bean attempts to access a resource manager or other beans and the access is not allowed (accessing a resource in ejbActivate() of entity bean) the behaviour is undefined by ejb spec




[ July 03, 2004: Message edited by: Alex Sharkoff ]

[ July 03, 2004: Message edited by: Alex Sharkoff ]
[ July 05, 2004: Message edited by: Alex Sharkoff ]
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cool complement to my cheatsheet on exceptions handling.
Thanks Alex
 
reply
    Bookmark Topic Watch Topic
  • New Topic