Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > RMI - downloading class definition?

Thread Tools

RMI - downloading class definition?

Posts: n/a

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 MyRMIServer

grant codeBase "file:/home/michaelp/rmiDB/" {

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

Greatful to any pointers:


Reply With Quote
Esmond Pitt
Posts: n/a
michaelp wrote:
> Greatful to any pointers:
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
A parameterized class (i.e. template class / class template) is not a class? christopher diggins C++ 16 05-04-2005 12:26 AM
Why does java.rmi.Naming not implement interface java.rmi.Registry? Jan Schulze Java 1 03-26-2005 07:45 AM
RMI Vs RMI over IIOP JScoobyCed Java 1 01-28-2005 09:54 AM
RMI, JINI or RMI/IIOP Buu Nguyen Java 1 08-25-2004 11:28 AM