Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

RMI Stubs and "no dynamic class downloading" requirement

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?

    [ October 11, 2005: Message edited by: Tomas Varsavsky ]
    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.
      Bookmark Topic Watch Topic
    • New Topic