Results 1 to 2 of 2

Thread: HttpInvoker server and client deployment

  1. #1
    Join Date
    Jun 2005
    Location
    San Mateo, CA
    Posts
    34

    Default 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?

    Client
    -------
    Code:
    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. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    335

    Default

    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.

    Ollie

Similar Threads

  1. Replies: 8
    Last Post: Oct 19th, 2012, 02:49 AM
  2. Replies: 1
    Last Post: Aug 23rd, 2005, 09:24 AM
  3. HttpInvoker server side deserialization problem
    By JohnDoeKyrgyz in forum Remoting
    Replies: 1
    Last Post: May 12th, 2005, 08:48 AM
  4. Client - Server And Spring Framework
    By kotesh in forum JMS
    Replies: 5
    Last Post: Apr 8th, 2005, 03:15 PM
  5. Server side exceptions propogate to client - how to
    By darrell_2399 in forum Remoting
    Replies: 0
    Last Post: Oct 12th, 2004, 05:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •