Announcement Announcement Module
No announcement yet.
HttpInvoker server and client deployment Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • HttpInvoker server and client deployment

    hi All,

    I have a set of service interfaces and object interfaces that I would like to expose to the client. The server obviously contains these interfaces and their implementations. However when I invoke these services from the client, the client throws an exception at runtime mentioning classnotfound exceptions.

    Why is the client concerned about the implementation classes?

    public interface EmployeeService {
       public void addEmployee(String id, Employee employee);
    public interface Employee {
       pubic String getFirstname();
       public String getLastname();
       public void setFirstname(String fname);
       public void setLastname(String lname);
    These two interfaces are all that I package in client.jar

    The client has client.jar, spring.jar, spring-remoting.jar, and commons-xxx.jar

    The clientContext.xml file points to the remote server url.

    Is this configuration invalid? Do I have to provide the implementations of these two services to the client?

  • #2
    The client must have the byte code for any objects that are going to be transferred to it from the server otherwise they can't be deserialized.

    So from your example you'll need to include the implementation of Employee but not an implementation of EmployeeService on the client.

    You can setup HttpInvoker to automatically download the code for missing classes using the setCodebaseUrl method however I would not recommend you go down this path as it eliminates a lot of the simplicity you gain by using HttpInvoker.