Re: Stub File

Paulo Melo <[email protected]>
Newsgroups gmane.comp.java.sun.rmi
Message-ID <[email protected]>
Ok guys, the problem is solved.I thank to all for
suport.
For more details, there is in Release Notes:

"When an application exports a remote object (using
the constructors or static exportObject methods of
the classes java.rmi.server.UnicastRemoteObject or
java.rmi.activation.Activatable) and a pregenerated
stub class for the remote object's class cannot be
loaded, the remote object's stub will be a
java.lang.reflect.Proxy instance (whose class is
dynamically generated) with a
java.rmi.server.RemoteObjectInvocationHandler as its
invocation handler."

http://java.sun.com/j2se/1.5.0/docs/guide/rmi/relnotes.html#callout

So, when the application don't find the pregenerated
stub class, the stub will be a java.lang.reflect.Proxy
instance.
We can this in the source code. (-:

Thank very much!

A Paz!!
Paulo Henrique


 --- Peter Jones - JavaSoft East
<[email protected]> escreveu:
> > In the API Documentation from RMI Tiger says that
> I don't need
> > pregenerated the stub file from the Remote Object
> class, but in my
> > application when i run the server(that is the
> remote object) the JVM
> > request the _stub file.
> >
> > What will be?
> >
> > Bellow the source code:
>
> [snip]
>
> > Servidor stub = (Servidor)
> UnicastRemoteObject.exportObject(this);
>
> Unfortunately, a pregenerated stub class is still
> required when you
> use that particular exportObject method, because its
> return type is
> java.rmi.server.RemoteStub (a class, which cannot be
> extended by a
> dynamic proxy class); changing that return type
> would have broken
> binary compatibility.  See this footnote in the
> release notes[*]:
>
>
http://java.sun.com/j2se/1.5.0/docs/guide/rmi/relnotes.html#callout
>
> Instead, use the UnicastRemoteObject.exportObject
> method that also has
> a port parameter; its return type is
> java.rmi.Remote, an interface, so
> a dynamic proxy instance can be returned (and is, if
> a pregenerated
> stub class is not available).  Use zero for an
> anonymous port:
>
>     Servidor stub = (Servidor)
> UnicastRemoteObject.exportObject(this, 0);
>
> -- Peter
>
> [*] or the documentation for the UnicastRemoteObject
> class:
>
>
http://java.sun.com/j2se/1.5.0/docs/api/java/rmi/server/UnicastRemoteObject.html
>





_______________________________________________________
Yahoo! Acesso Grátis - Instale o discador do Yahoo! agora. http://br.acesso.yahoo.com/ - Internet rápida e grátis

===========================================================================
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.