This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes Custom class Serializable Dynamic Class Loading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Custom class Serializable Dynamic Class Loading" Watch "Custom class Serializable Dynamic Class Loading" New topic
Author

Custom class Serializable Dynamic Class Loading

seshu Palamanti
Ranch Hand

Joined: Jul 03, 2004
Posts: 59
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Custom class Serializable Dynamic Class Loading
 
Similar Threads
Writing objects to files and reading them back into the UI
Custom Object Serializable via Session Bean
Hibernate: ID not set upon save
Chapter 6(Session Management) notes (HFSJ) for revision
Convert an Object to ByteArray