Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2007

Tip: Looking for answers? Try searching our database.

RMI - downloading class definition?

Thread view: 
michaelp - 03 May 2007 13:00 GMT
Hello!

I am writing a little RMI application, where the server has access to a
database (sort of persistence layer), and the client sends search terms
to it over RMI.

The server loads the answer from the database into a JavaBean object
that is downloaded over the network so that the client can extract the
results from it. The javabean implements an interface with all the
exposed methods (get and set).

My question: Can RMI download the class definition from the server at
run-time, or do I need to have the class definition available at the
client as a .class file.

When I try to compile and run the client without having the bean class
definition (i.e. only using the methods in the interface it implements)
I get a security error message. This made me think that the client tries
to download the class definition, but fails due to security constraints.

I have tried to use a security policy file that grants the code base
where the server classes are located all permissions,

In the Main method of server I put:
       if (System.getSecurityManager() == null) {
            System.setSecurityManager(new SecurityManager());
        }

and at the command line
java -Djava.security.policy=policyfile MyRMIServer

policyfile:
grant codeBase "file:/home/michaelp/rmiDB/" {
    permission java.security.AllPermission;
};

but to no avail.The server wont even start... I get a security exception.

Greatful to any pointers:

Michael
Esmond Pitt - 04 May 2007 04:08 GMT
> Greatful to any pointers:

http://java.sun.com/j2se/1.5.0/docs/guide/rmi/codebase.html


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.