Re: Using an interface between two dl'ed applications
Niclas Hedhman <[email protected]> Mon, 19 Jan 2009 14:33:44 +0100
| Newsgroups | gmane.comp.java.sun.jini |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Jan 19, 2009 at 11:55 AM, Calum Shaw-Mackay <[email protected]> wrote: > Given a system 'A' that allows objects 'B' and 'C' to be deployed to it, > where 'C' has an interface dependency on 'B'. Also 'B' and 'C" are > independently deployed, with potentially different codebases, but with the > same interface definition (compiled) in each. > > When 'C' requests access to 'B' via a dynamic proxy generated from the > Interface declared in 'B's codebase, I get a ClassNotFoundException, I'm > assuming that this is because B's classes are being declared in a different > classloader to 'C's. Are you talking a java.lang.reflect.Proxy, bytecode generated one or something else? I am not sure what you mean by "declared in different classloader to C's". Is it in the same JVM? Otherwise, why do you mention it? (I know you are not a novice... :-) ) If we are talking j.l.r.Proxy, is the InvocationHandler in B serializable and its classes available to C? In JRMP, there is explicit support for j.l.r.Proxy since it is not straight forward. The Proxy from B should be reconstructed at JRMP level from the interface classes and invocationhandler instance received from B using the RMI Classloader in C for B's codebase. Cheers Niclas -- http://www.qi4j.org - New Energy for Java -------------------------------------------------------------------------- Getting Started: http://www.jini.org/wiki/Category:Getting_Started Community Web Site: http://jini.org jini-users Archive: http://archives.java.sun.com/archives/jini-users.html Unsubscribing: email "signoff JINI-USERS" to [email protected]