Exception Handling in EJb2.0
hi all
Problem: How to handle EJB1.0 RemoteException in EJB2.0 while migrating from EJB1.0 to EJb2.0.
Description:
Remote interface: RepoMain
Home Interface: RepoMainHome
Bean Class : RepoMainBean
My application developed using Stateless Session Beans 1.0 and it is using some User Defined Java classes.My Bean class and Java classes are throwing RemoteExceptions(According to EJB1.0 Spec.).While migrating to EJb2.0 i replaced RemoteException with EJBExceptions in Bean class and Java classes.Now iam getting some Warnings.
Warning:From the above RepoMain(RemoteInterface)methods must throw EJBExceptions.
According to EJb2.0 i can throw RemoteException in Remote and Home Interfaces.But i should not throw RemoteException in Bean class.
so is there any way to handle RemoteException from EJB1.0 in EJB2.0
without replacing with EJBExceptions.but my userdefined java class must throw either Remote or EJBException.
Actually i want to get feeling that my Beans are devoped purely in EJB2.0.forthat one i don't want throw any exceptions in Bean(RepomainBean)class.is it possible to handle those Exceptions in Bean class try/catch block.if not
please let me know how to handle those Exceptions.
Advance Thanks
Mahender Reddy
|