The java.io.InvalidClassException is generally raised when the Serialization runtime detects a problem with a Class.
Possibly, the class at the client side does not match the serial version of the class in the stream.
You may be having two diferent versions of the either the Home or the Remote Interface on the client and the server. These classes would be required while casting the Object that u receive from either the lookup() or the create().
The InteresetBean has not been changed at all. It comes from the documentation-example.zip from jboss (http://www.jboss.org/doco_files/). I modified the InterestClient as seen above but not the InterestBean. So, as you can see the "Got Context" message is printed and I think it blows up on the getting reference. So what do I have to change in this client code to have the "interest.calculateCompoundInterest(1000, 0.10, 2)" method called for Interest EJB running on different machine then the client. Can some one be more specific. Thanks.
Your code is OK, but you may want to change your
property to "org.jboss.naming:org.jnp.interfaces".
After changing the following, I am now getting this error message.
[java] Got context
[java] javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
[java] java.net.ConnectException: Connection refused: connect]
I found out what the problem was. It turned out to be a firewall issue. I did have successful test with another machine. I just wanted to make sure the code was ok and thanks for every one's help.