• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

in rmi Its necessary to manually copy a Class file for remote interface in client directory?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its possible to load class dynamically ...from any other location...
how its done......
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
through RMI.

It will do loading classes dymanically. It needs only the class objects to be loaded.
 
dashang trivedi
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In serever directory

three file
calc.java(interface)
calcimpl.java
calcserver.java



In client directory......

public class CalcClient
{
public static void main(String args[])throws RemoteException,NamingException
{




System.setProperty("java.security.policy","client.policy");
System.setSecurityManager(new SecurityManager());
Context nc=new InitialContext();

try
{

Calc c = (Calc)nc.lookup("rmi://localhost/Calc_Service");
System.out.println("3");
System.out.println("addition-->"+ c.add(10,10));
System.out.println("Subtraction-->"+ c.sub(5,6));
System.out.println("Multiplication-->"+ c.mul(5,3));
System.out.println("Division-->"+ c.div(10,5));
}
catch(Exception e)
{
System.out.println("Error" + e );
}
}


}

it will give Exception class not found.....
If i manually copy Calc.class file in client directory....then program success fully run...........
so any body know HOW THE DYNAMIC DOWNLOADING is done.......
 
reply
    Bookmark Topic Watch Topic
  • New Topic