Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom class Serializable Dynamic Class Loading

 
seshu Palamanti
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a simple custom object like this.
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;
}


}
I want to send it across the wire through a simple stateless session bean. We are using this session bean as More of a Facade to a caching framework to cache custom user objects who's class will not be there on the server side. So as you might expect i get
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)

How can we solve this problem as i require that we can take in any object on the server side with out the server actually having the class in its path.I was reading about Dynamic Class loading for RMI can this used for this scenario i.e server getting code from codebase from client side.I would really appreciate if some answers this and provide some sample code.

Regards

Thanks in advance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic