Search Results

Search found 2 results on 1 pages for 'eruina'.

Page 1/1 | 1 

  • readobject method throws ClassNotFoundException

    - by eruina
    Hi all, I'm trying to pick up Java and wanted to test around with Java's client/server to make the client send a simple object of a self defined class(Message) over to the server. The problem was that I kept getting a ClassNotFoundException on the server side. I think the rest of the codes seem to be alright because other objects such as String can go through without problems. I had two different netbeans projects in different locations for client and server each. Each of them have their own copy of Message class under their respective packages. Message class implements Serializable. On the client side, I attempt to send a Message object through. On the server side, upon calling the readObject method, it seems to be finding Message class from the client's package instead of it's own. printStackTrace showed: "java.lang.ClassNotFoundException: client.Message" on the server side I have not even tried to cast or store the object received yet. Is there something I left out?

    Read the article

  • Compiling and executing through commandLine shows NoClassDefFoundError when trying to find Java pack

    - by eruina
    I have a client/server program that attempts to send and receive an object. There are three packages: server, client and shared shared contains only the Message class I put Message.java from shared package into the same folder as calcclient package source files and calcserver package source files. I compile using the line: javac -classpath .; Message.java They can compile. Then I change directory up one level and ran with: java -classpath .; .Main When I use Netbeans to run, the entire program works as per normal. But not if I run from command line. If its executed through command line, the program will work until it needs to use the Message object. Then it will show a NoClassDefFoundError Am I putting the right files at the right places? How do I get the program to find shared package through command line?

    Read the article

1