| Author |
Custom Object Serializable via Session Bean
|
seshu Palamanti
Ranch Hand
Joined: Jul 03, 2004
Posts: 54
|
|
I have simple Custom Class which implements Serializable i want to send this one across a stateless session bean import java.io.Serializable; public class TestObject implements Serializable { private String name; private String city; public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getName() { return name; } public void setName(String name) { this.name = name; } } Now when i send this class object through a method on server deployed stateless bean i get...this Before...java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: Failed to load class TestObject at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:191) I thought that we can send any object with implements Serializable across the wire with out the other side having the same class.Is that true? how can we make this work.
|
 |
Pradeep bhatt
Ranch Hand
Joined: Feb 27, 2002
Posts: 8876
|
|
You need the class to be in the CLASSPATH to deserialize. When an object is deserialized only the content is stored and not the class definition. The class definition is in .class file
|
Groovy
|
 |
seshu Palamanti
Ranch Hand
Joined: Jul 03, 2004
Posts: 54
|
|
|
Thanks for your reply Pradip but we have a caching service and cache should be able to taken in any object with out the server side knowing which class object it is getting. Can you please suggest some thing in this scenario.I was reading some thing about dynamic class loading for RMI. It this is the solution can you please tell me how can be achieved a simple example would be good.Thanks in advance Pradip.
|
 |
 |
|
|
subject: Custom Object Serializable via Session Bean
|
|
|