Platform:
WINDOWS NT4.0
WEBLOGIC SERVER 6.1(eval)
DB2 UDB 6
I am using an entity bean (cmp) to simulate a customer. Everything is working fine except the remove( ) method.
In a client. I first applied findByPrimaryKey(..) to get the remot object. Then I applied the remove() method on it. This fails with following error...
============= Error Msg copied ===========================
Remove failed java.rmi.RemoteException: Exception during remove.; nested exception is:
java.lang.IllegalStateException: Illegal call to EJBContext method. The EJB specification (See Section 9.6.5, for example.) places restrictions on the m
ethods that may be invoked during certain phases of a bean's lifecycle. One of these restrictions has been violated.
==========================================================
Rest all - Create, Modify and Search are working great
Anybody out there! please help me with some suggestions
any attempt to help me will be rewarded with my appreciation and gratitude..
take care
rc
-
Problem with remove( ) method (3 messages)
- Posted by: sgt pepper
- Posted on: September 27 2001 08:43 EDT
Threaded Messages (3)
- Problem with remove( ) method by Igor Borisovsky on September 27 2001 09:59 EDT
- Problem with remove( ) method by sgt pepper on September 27 2001 23:53 EDT
- Problem with remove( ) method by sgt pepper on September 27 2001 23:58 EDT
-
Problem with remove( ) method[ Go to top ]
- Posted by: Igor Borisovsky
- Posted on: September 27 2001 09:59 EDT
- in response to sgt pepper
before remove() method, just call any other method in the entity bean(for example, some getXXX() method). -
Problem with remove( ) method[ Go to top ]
- Posted by: sgt pepper
- Posted on: September 27 2001 23:53 EDT
- in response to Igor Borisovsky
public void doWhatYouWant(TimeStamp dob)throws CreateException, RemoteException, FinderException
{
Insured insured = (Insured) PortableRemoteObject.narrow(home.create("INS333","BobDylan",dob,"M","6th Avenue,Paris","","INS28837722","Uni","Single","Rock star","Sony","Guitar","NIL","Y","Active"),Insured.class);
if(insured != null){
System.out.println("Going to remove record for "+insured.getInsInsuredName());
try{
insured.remove();
}
catch(Exception ex){
System.out.println("Remove failed "+ex);
}
}
else{
System.out.println("Not Found for deletion");
}
}
-
Problem with remove( ) method[ Go to top ]
- Posted by: sgt pepper
- Posted on: September 27 2001 23:58 EDT
- in response to Igor Borisovsky
Hi there!
Thanks for the reply
but.. still the same error i am getting... attaching the main code below.. please tell me if anything can be done?
for demo purpose it creates one Insured and removes it...
===========================================================
public void doWhatYouWant(Timestamp dob)throws CreateException,RemoteException, FinderException{
Insured insured = (Insured) PortableRemoteObject.narrow(home.create("INS333","BobDylan",dob,"M","6th Avenue,Paris","","INS28837722","xzy","Single","Rock satr","Sony","Guitar","NIL","Y","Active"),Insured.class);
if(insured != null){
System.out.println("Going to remove record for "+insured.getInsInsuredName());
try{
insured.remove();
}
catch(Exception ex){
System.out.println("Remove failed "+ex);
}
}
else{
System.out.println("Create Failed");
}
}
==================================================
thankx
rc