Re: java.lang.InstantiationException:$Proxy0

lachhman <[email protected]> Wed, 11 Feb 2009 16:00:25 -0800
Newsgroups gmane.comp.java.sun.rmi
Message-ID <[email protected]>
Yes.  Dynamically created proxy has InvocationHandler as an argument in the
constructor, and if stub is manually created with rmic compiler then this
stub has java.rmi.server.RemoteRef as an argument in constructor.

Constructor can be obtained from the Class instance and
newInstance(InvocationHandler/RemoteRef) can be called, but  how to get the
instance of InvocationHandler/RemoteRef from Class object of proxy/stub, in
order to be able to call  newInstance(InvocationHandler/RemoteRef) method on
constructor. 

The environment I am working under does not allow to have a method to carry
an argument of any class type, but basic data types(String, float etc.) and
Class type. Thus, I was forced to create a Class object of stub/proxy and
send it as an argument to  method in the receiver. I just serialized stub
into file and sent file name as a String argument to method in the Receiver,
and  method is deserializing the stub.

Thanks Gregg and Peter 













lachhman wrote:
> 
> Hi,
> 
> I am getting this exception(java.lang.InstantiationException:$Proxy0)
> while reconstructing the stub/proxy from the Class instance of stub/proxy.
> 
> Regards,
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/java.lang.InstantiationException%3A%24Proxy0-tp21899006p21967291.html
Sent from the Java - RMI mailing list archive at Nabble.com.

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html