Peer-to-peer systems have the desirable property that the amount of resources available in the system increase as demand for services increases due to growth of the system. We explore how resources in such systems can be used to support distributed object-based middleware. The remote nvocation abstraction reduces the complexity of distributed programming and its implementation in peer-topeer systems can permit general services to be deployed and shared in such systems. We extend the Java remote method invocation (RMI) framework to support its implementation in peer-to-peer systems. In addition to various implementation related issues, we also explore the performance benefits of this approach using a prototype and simulations.