error marshalling return;
I am getting the followin开发者_StackOverflow社区g exception when I tried to execute one my service in my server which is deployed as EJB2.0 stateless session bean.
Error executing services::error marshalling return; nested exception is:
java.io.NotSerializableException: xxx.xxx.xxx.PmsService
here xxx.xxx.xxx.PmsService
is my class which is already implementing java.io.Serializable
interface
can you please help me in getting this resolved.
MUR
Chances are, one of your (non-transient) fields in PmsService does not itself implement Serializable.
Serializability is a recursive property; a class is not, and cannot be serialised unless all of its fields can be serialised too. Check your fields for classes that cannot be serialised, and either make that class serializable (if it's your own class), switch to a serializable alternative, or declare the field transient (only do this latter case if it isn't really part of the object's state; e.g. the thread your task is currently running in).
Could it be that one of your service's fields is of a type which is declared in one of your referenced library JARs?
It is possible that there's a problem with your classpath when using open directory deployment. Deployment via EARs or JARs has the big advantage that the classpath search order is pre-determined in that it always starts within the EAR or JAR, respectively. This way, the specific version of a referenced JAR is always found first.
Now, when using "open deployment", it is possible that one of your library JARs conflicts with the versions your application server uses and that (A) those are found first and (B) are not serializable.
精彩评论