Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI Stubs and "no dynamic class downloading" requirement

 
Tomas Varsavsky
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am ready to submit my assignment and I'm having the typical last minute doubts! I searched the forum on this I could not find a clear enough answer.

My question is to do with the RMI requirement:

You must provide all classes pre-installed so that no dynamic class downloading occurs.

I'm new to RMI and I'm not 100% sure if "dynamic class downloading" is occurring in my implementation, described below:
  • Server extends UnicastRemoteObject
  • Creates registry in code with LocateRegistry.createRegistry(port)
  • Bind with Naming.rebind(url, obj)
  • I never manually created any stubs. i.e. I never ran "rmic".
  • I'm using J2SE 5.0 & Eclipse as my IDE
  • I do not set java.rmi.server.codebase or any other system properties


  • Everything works fine. My question is: is "dynamic class downloading" occurring since I did not explicitly create and include any stubs in the runme.jar? Should I run rmic and include stubs in the runme.jar?

    In the J2SE 5.0 "New features" document it states that:

    Dynamic Generation of Stub Classes - This release adds support for the dynamic generation of stub classes at runtime, obviating the need to use the Java Remote Method Invocation (Java RMI) stub compiler, rmic, to pregenerate stub classes for remote objects. Note that rmic must still be used to pregenerate stub classes for remote objects that need to support clients running on earlier versions.

    Is this why it works? Am I violating the requirement?

    Thanks!
    [ October 11, 2005: Message edited by: Tomas Varsavsky ]
     
    Daniel Dalton
    Ranch Hand
    Posts: 146
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Tomas - it only works because you're using J2SE 5.0 and yes you are violating the requirement. I queried more or less the same thing in a post the other day:

    Cannot create stub

    Andrew kindly got confirmation from Sun Education that use of this feature is prohibited. Bottom line: generate stubs.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic