Results 1 to 4 of 4
  1. #1
    pwnzer is offline Member
    Join Date
    Nov 2009
    Posts
    2
    Rep Power
    0

    Default Client to Server, ClassNotFound Package Problem

    ClassNotFound Package Problem

    Well when I am sending a login object from client to server in the beginning of my program its unable to convert it due to package being different. My clients object is called "client.LogInfo" as the server has and is expecting "LogInfo", they both have the same variables inside of them, but the packaging being different server doesn't recognize the incoming object.

    server code:
    Java Code:
    LogInfo loginInfo = (LogInfo)( _inputFromClient.readObject());
    client code:
    Java Code:
    LogInfo info = login.showPasswordForm();
                _OutStream.writeObject(info);
    There is a lot of code behind this, more than postable but I think this is clear enough. From this comes the ClassNotFound Exception and the .getmessage came: client.LogInfo

    Sorry to post if I'm missing something the obvious, i just cant find this problem elsewhere, though it seems like others should have come across it by now...

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Add the class that is not found to the classpath.

  3. #3
    pwnzer is offline Member
    Join Date
    Nov 2009
    Posts
    2
    Rep Power
    0

    Default

    the server though it has a duplicate of the LogInfo class doesn't know what client.Login is due to package tacked on. exception.getmessage says client.LogInfo to be exact.

    The class doesn't exist when client is put into the servers conversion

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    If the client runs code that accesses client.LogInfo class then that class needs to be on the client's classpath. It's as simple as that.

Similar Threads

  1. Simple server/client text problem
    By Singing Boyo in forum New To Java
    Replies: 5
    Last Post: 06-02-2009, 11:33 AM
  2. Client Server socket problem - help needed
    By kellaw in forum Threads and Synchronization
    Replies: 6
    Last Post: 10-03-2008, 07:49 PM
  3. Replies: 1
    Last Post: 10-02-2008, 08:03 PM
  4. passing info between server/client problem
    By DarkBlaze in forum New To Java
    Replies: 13
    Last Post: 07-24-2008, 04:14 AM
  5. client-server communication problem
    By revathi17 in forum New To Java
    Replies: 1
    Last Post: 08-09-2007, 03:21 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
  •