• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Client Class Not Found By Server

Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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/clientengine.java -Djava.rmi.server.codebase=file:/home/gogol/MyProjects/FileClient/ -Djava.security.policy=Gatekeeper.policy 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 java.vm.name read)
(java.util.PropertyPermission os.name read)
(java.util.PropertyPermission java.vm.vendor read)
(java.util.PropertyPermission path.separator read)
(java.util.PropertyPermission java.specification.name 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 java.vm.specification.name read)
(java.util.PropertyPermission java.specification.version read)
(java.util.PropertyPermission java.specification.vendor read)

access: access allowed (java.io.FilePermission 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.
    Bookmark Topic Watch Topic
  • New Topic