Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

RMIClassLoader and RMIClassLoaderSpi question  RSS feed

Grigory Ptashko
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First the background.
I have an application the classes of which reside in the database. I have a boostrapper which loads my own class loader. This class loader fetches all the classes (I mean the byte-code) and then the app starts.
This application uses RMI and this is where I've stuck. The problem is that my class loader is not used for fetching stubs and I get the "java.rmi.StubNotFoundException". All the stubs also reside in the database.
So, after reading the manuals I've decided to use RMIClassLoader.
In the mans it is said that RMIClassLoader loads the stubs and RMIClassLoaderSpi is the implementation of those methods in RMIClassLoader for fetching classes. It is also said how to "turn on" my own RMI class loader service provider, i.e. I have to start an app with "-Djava.rmi.server.RMIClassLoaderSpi". If this property is set then this service provider is used for RMIClassLoader.
I've written this service provider (actually I just fetch the classes with JDBC) and set that property. But nothing happens! My RMIClassLoaderSpi-based class is never used!
Has anyone ever worked with that ?
I repeat that I have my own class loader and I want RMI to fetch stubs in the same way as that class loader.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!