
Lucy decides to distribute the load of the server by creating a distributed application.
Lucy has to maintain two servers, one for storing the database and the other for storing the books in the .pdf format. The application should enable an employee to access the database and download books from the server. How will she ensure that the files are sent and received across JVM?
While creating the distributed application using RMI, the developer writes the following code to create an RMI server: import java.rmi.*; import java.rmi.server.*; public class HelloServer { public static void main(String args[]) { try { System.setSecurityManager(new RMISecurityManager()); Hello h = new HelloImpl(); Naming.bind("server",h); System.out.println("Object is registered."); } catch(Exception e) { System.out.println("Error : "+e); } } } The preceding code works when executed for the first time. However, when the code is executed again, it gives an exception. Identify the exception and the reason.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.