Hi all.
First at all... sorry for my english mistakes...
I'am generating a create exception in a simple session bean. On the client i get
[java] Excepcion!!! java.lang.reflect.UndeclaredThrowableException - javax.ejb.CreateException: hola2
The bizarre thing that i cant understand is that ejbCreate is called until i invoke a method in the Remote interface, ie. if i put in comments the bussines method and left only de home.create() nothing pass, but if i invoke the bussines method, the ejbCreate is invoked too....
Well i believe that is wrong, but i don know... But it´s sure that my client must get a createException... right?
thanks for any help!
The code:
in my ejbCreate i have:
public void ejbCreate()throws RemoteException,CreateException {
System.out.println("creando");
throw new CreateException("hola2");
}public void migrateHistoricData() throws RemoteException{
try{
System.out.println("va a migrar");
}catch(Exception e){
System.out.println("en bean other exception "+e.getMessage());;
throw (RemoteException)e;
}
}MigrationManagerSessionHome home = (MigrationManagerSessionHome) PortableRemoteObject.narrow(obj,MigrationManagerSessionHome.class); MigrationManagerSession migraMgr = home.create(); migraMgr.migrateHistoricData();