File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Distributed Java and the fly likes Client Class Not Found By Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Client Class Not Found By Server" Watch "Client Class Not Found By Server" New topic

Client Class Not Found By Server

Aniruddha Mukherjee

Joined: Aug 01, 2011
Posts: 3
Hello Everyone,

I am creating a client-server java rmi application, which copies a particular file from Server to Client.
Server is running on windows 7 and client on Linux.
I have sorted most of the things by myself and I am able to connect to the server through the client but there is a class files in my client machine which the server needs to load.
Now when I am starting the client with -Djava.rmi.server.codebase=file:/home/gogol/MyProjects/FileClient/ (which is where one of my client class file is loacted) the server(Which is in Windows) seems to look for that class in C:/home/gogol/MyProjects/FileClient/ (mixing up the windows directory structure with linux) and obviously the class is not found.

This is how I start My Client
sudo java -cp /home/gogol/MyProjects/FileClient/compute.jar:/home/gogol/MyProjects/FileClient/ -Djava.rmi.server.codebase=file:/home/gogol/MyProjects/FileClient/ client.Client C:\Users\GOGOL\Desktop\gogoljava\Objects.txt /home/gogol/MyProjects/output.txt

where client.Client is the Client Program.

By looking at the debug information of the Server, the Server execution stops at
(java.util.PropertyPermission read)
(java.util.PropertyPermission read)
(java.util.PropertyPermission java.vm.vendor read)
(java.util.PropertyPermission path.separator read)
(java.util.PropertyPermission read)
(java.util.PropertyPermission os.version read)
(java.util.PropertyPermission os.arch read)
(java.util.PropertyPermission java.class.version read)
(java.util.PropertyPermission java.version read)
(java.util.PropertyPermission file.separator read)
(java.util.PropertyPermission java.vendor read)
(java.util.PropertyPermission read)
(java.util.PropertyPermission java.specification.version read)
(java.util.PropertyPermission java.specification.vendor read)

access: access allowed ( C:\home\gogol\MyProjects\FileClie
nt\client\GetFile.class read)

Please see the last line clearly it is searching my GetFile class in a wrong location with wrong format.

Please suggest me a way to overcome this problem using codebase as "file:" string only.

Many Many thanks for your time and help.
I agree. Here's the link:
subject: Client Class Not Found By Server
It's not a secret anymore!