views:

71

answers:

1

Can anyone tell me why following exception comes?

java.rmi.ServerException: RuntimeException; nested exception is:
    java.lang.IllegalStateException: Cannot obtain inMethodFlag for: getPrimaryKey

How to avoid it?

Thanks in advance.

A: 

According to the AllowedOperationsFlags API it will be thrown when the getPrimaryKey() has been called at a wrong time, e.g. during ejbCreate(). It's hard to suggest a solution without more context about your particular problem and/or a SSCCE.

BalusC
Thanx, The code was calling getPrimaryKey() method on EntityContext reference from unsetEntityContext, resulting in IllegalStateException. I wrapped that part into try-caltch and it worked correctly. I am still surprised, how the same thing works on weblogic, without any errors?
Shivey Upadhyay