• 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 ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Location of stub and Remote Interface...Urgent pls

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
In my rmi-iiop call to a remote server I have placed the stb class and the Remote interface class along with the client and I am able to complete the call successfully.
my question is that do I really need to place the remote interface with the client and Stb classes.
If I try to remove the remote interface from the client directory then it gives me an error saying that "Remote Interface is not found.
I thought that the remote interface need not be with the client and the stb class.
please clarufy on this if I am wrong i.e. do i really need the remote interface with the client in order to make the rmi-iiop call.
Thanks and regards
sagar

 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
u only need to download stub file on client machine
remote interface shouldn't be downloaded on client machine
Naming class will itself find the refrence of remote object itself from stub on client
i think it will help u
other wise feel free to ask about problem if it still exists.
 
Sagar Sharma
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have tried removing the Remote Interface from the client machine but the code did not compile giving me the error "myInterface class not found" in the line when i cast to it using PortableRemoteObject.
Pls help if I am wrong somewhere.
I have bounded the remote object as ;
MyImplementation abc=new MyImplementation()
also i am casting in the following way;
MyInterface xyz=(MyInterface)PortableRemoteOPbject.narrow(objref,MyInterface.class);
Please e know as to why am i not able to compile the Client without having the remote interface on its side.
Thanks and Regards

Sagar
 
Sagar Sharma
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please help me
sagar
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Saga:
if you want sperate your client application with stub, there a couple of things you need to do.
First, in server side, make sure where is stub location. in a jar or in class pacakge or just in a directory, which is not related any packages.
Second, every time you start the server, you should refer this location to the rmi.server by following syntex commands:
java -Djava.rmi.server.codebase=file:/c:\your firl location
-Djava.rmi.server.hostname=host
your_application_name
check for this to see if you can get it or not.
David
 
Sagar Sharma
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,
Thanks for your response but as suggested by David I alwaiys start the server with the -D java.rmi.codebase property which holds the URL where my Stub is.
Yet now if I remove the RemoteInterface from the directory where my client is (on a separate machine) I am not able to compile the client and it still gives me an error in the line where I cast the remote reference to the RemoteInterface. It says "class 'remoteinterface not found' ".
Please throw some more light o this as I also believe that the remote interface should not be present with the client and should be reference remotely through the stub but my client fails to compile if I dont include it in the Client's directory.
Pls reply to me urgently!!!
Sagar
 
Sagar Sharma
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pls reply urgently!!!
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Remote interfaces define methods which need to be implemented.
If you remove the remote interface and then compile(as you mentioned) definitely you will get errors.
Keep the remote interfaces while compiling and later remove it and try to run the program.
Suneel
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
let me share my experience with you regarding the problem I too faced
I tried to compile the client programe in adifferent machine.surely it did not recognise the interface .
then i compiled it in the same directory as the interface.
i put both the client class and the interface class in
a different machine.
I work in a network evironment .
and use dhcp server which assigns dynamic ip addresses .
so the client programe sometimes worked and at times it did not .this was as i discovered due to the ever changing ip addresses.
each time i had to remove the clent .class from the client machine and recompile the client .java in the server machine making changes to the ip address.by running the command ipconfig at command promt which gave me the day's ip address for the server machine.
and copied the class file in the other machine.
it worked.
please pass on any info you may stumble upon
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic